Commit Graph

135 Commits

Author SHA1 Message Date
Pavel Roskin 089a1ae9e5 * editcmd.c (compl_callback): Use common_dialog_repaint(). 2002-08-22 06:10:41 +00:00
Pavel Roskin 8275c2f5fd * editcmd.c (raw_callback): Use standard common_dialog_repaint()
to handle DLG_DRAW.
2002-08-22 05:58:30 +00:00
Pavel Roskin 231f67342e * editwidget.c (edit): Make edit_bar a local variable. 2002-08-21 22:54:27 +00:00
Pavel Roskin 9e36fa257d * global.h: Move include for rx.h and eregex.h here. 2002-08-21 07:20:39 +00:00
Pavel Roskin 4756fbf271 * editcmd.c (freestrs): Set freed strings to NULL.
(catstrs): Use g_malloc() and g_free().
2002-08-20 23:57:34 +00:00
Pavel Roskin 42f28932fc * editcmd.c (freestrs): New function to clean temporary strings.
* edit.c (edit_clean): Call freestrs().
2002-08-20 23:18:36 +00:00
Pavel Roskin 37318c2b78 * editmenu.c: Use new create_menu() interface. 2002-08-20 21:31:23 +00:00
Pavel Roskin 3a93326ce7 * editoptions.c: Make some variables static.
* edit.h: Take extern declaratrions from all C files.
2002-08-19 01:23:24 +00:00
Pavel Roskin 5dbb74eca2 * editcmd.c (edit_block_process_cmd): Plug memory leak.
Simplify logic, reformat.
2002-08-19 00:33:08 +00:00
Pavel Roskin 21cc1c5e28 * edit.c (edit_push_action): Fix access to uninitialized memory.
Found by Valgrind.
2002-08-02 16:44:04 +00:00
Pavel Roskin d6a8671055 * syntax.c: Remove all references to MAD. 2002-08-01 20:44:24 +00:00
Pavel Roskin e692d7865c * edit.h: Don't include mad.h. 2002-08-01 19:42:45 +00:00
Andrew V. Samoilov bfe29a4ac2 * edit.h: Really remove open, close, write, read and mkdir definitions. 2002-07-30 18:39:04 +00:00
Andrew V. Samoilov f7de38f345 * edit.h (edit_get_load_file): Mark message for translation.
(edit_get_save_file): Ditto.
2002-07-29 17:09:02 +00:00
Pavel Roskin 2e17e22122 * syntax.c (apply_rules_going_right): Recheck keyword rules when
a keyword is found on the left border of a context.
2002-07-20 09:12:55 +00:00
Pavel Roskin 72a5fc5cc1 * syntax.c (edit_get_syntax_color): Return colorpair index, not
attribute, when syntax highlighting is disabled.  Handle black
and white mode separately.
2002-07-14 22:39:07 +00:00
Pavel Roskin 3c437c273d * syntax.c (edit_load_syntax): Do nothing in black and white
mode.
2002-07-14 22:19:49 +00:00
Pavel Roskin 75666df0fe * edit.h [!HAVE_SLANG]: Enable syntax highlighting.
* editdraw.c [!HAVE_SLANG]: Respect attributes for color pairs
by using MY_COLOR_PAIR macro.
2002-07-14 21:43:53 +00:00
Pavel Roskin a23618b2ef * edit.h (struct key_word): Remove unused "bg" field, rename
"fg" to	"color", since it keeps all color information.
* syntax.c (edit_get_syntax_color): Replace "fg" and "bg"
arguments with a single argument "color".
Adjust all dependencies.
2002-07-14 17:56:47 +00:00
Pavel Roskin bb989f677a * editdraw.c (edit_draw_this_line): Fix setting MOD_ABNORMAL
attribute.
(print_to_widget): Fix displaying non-printable characters with
ncurses.  Set color for every character even if syntax
highlighting is not compiled - it's needed to reset color after
non-printable characters.
2002-07-14 07:49:24 +00:00
Pavel Roskin 4655fbbb6b * editdraw.c (edit_status): Use EDITOR_NORMAL_COLOR instead of
NORMAL_COLOR.
* syntax.c (edit_get_syntax_color) [!HAVE_SYNTAXH]: Likewise.
2002-07-14 06:17:02 +00:00
Pavel Roskin 2ce74d23e1 * edit.c (check_file_access): Return 1 on all errors, document
this behavior.  Set edit->delete_file to 1 for newly created
files.
(edit_open_file): Don't set edit->delete_file, it's now done in
check_file_access().
Reported by Saso <saso@bojler.dhs.org>
2002-06-24 23:41:59 +00:00
Andrew V. Samoilov a1efabf66b Revert two casts back to fix calculation 2002-05-13 17:28:28 +00:00
Andrew V. Samoilov 17a0c13186 s/declaration/definitions/ in the last but one entry 2002-05-13 17:15:14 +00:00
Andrew V. Samoilov 16b73c1f39 * editcmd.c (edit_save_file): Call mc_chown () and mc_chmod ()
before mc_open () to prevent hangs over ftpfs.
2002-05-13 17:12:45 +00:00
Andrew V. Samoilov 0b08e1b69f * edit.h: Remove open, close, write, read and mkdir declaration.
* edit.c: Use mc_open, mc_close, mc_write, mc_read, mc_rename,
mc_chmod and mc_chown. Don't cast (char *) to (unsigned long)
in pointer arithmetics.
* editcmd.c: Likewise.
2002-05-13 16:53:51 +00:00
Andrew V. Samoilov 47f1ce66af * syntax.c (edit_read_syntax_file): Use system wide Syntax
Highlighting definitions' file if there is no users one.
2002-03-25 07:52:53 +00:00
Pavel Roskin 351a118d20 * edit.h: Use eregex.h, not regex.h.
From Alexander Varakin <avarakin00@hotmail.com>
2002-03-18 21:09:50 +00:00
Andrew V. Samoilov 80fb518808 * editcmd.c (edit_replace_cmd): Eliminate fin_string
and use message() to fix possible buffer overflow.
(edit_search_cmd): Likewise.
2002-02-27 15:40:22 +00:00
Andrew V. Samoilov fc3ef44f3b * syntax.c (convert): Fix buffer overflow for ".*\" cases. 2002-02-18 14:48:36 +00:00
Pavel Roskin 817602f8af * editdraw.c (edit_scroll_screen_over_cursor): Do nothing if the
edit widget has zero width or height.
2002-01-23 00:12:17 +00:00
Pavel Roskin 3d0de08b32 * edit.c: Rename DELETE to DELCHAR to avoid macro redefinition
on Win32.
* edit.h: Likewise.
2002-01-22 00:49:33 +00:00
Pavel Roskin 7ed785e3cc * edit.c: Add support for CK_Complete_Word event.
* editcmddef.h: Likewise.
* edit_key_translator.c (cooledit_key_map): Bind Alt-Tab to
CK_Complete_Word.
(emacs_key_map): Likewise.
* editcmd.c: Implement word completion.
2002-01-21 17:49:57 +00:00
Pavel Roskin eb28e580d9 * editmenu.c (CmdMenuEmacs): Add mail command without shortcut.
Users of emacs keys should be able to send mail too.
2002-01-21 08:26:23 +00:00
Andrew V. Samoilov 1e5b1bfde1 * edit-widget.h: Use PATH_SEP_STR. 2002-01-15 01:43:50 +00:00
Andrew V. Samoilov e41f4c01e4 (edit_read_syntax_rules): Eliminate c->single_char.
It's only written but never read.

* edit.h (struct context_rule): Comment out single_char field.
It is written once but never read.
2002-01-15 01:41:18 +00:00
Andrew V. Samoilov 3eea969c3b * syntax.c (syntax_g_free): New macro to release and NULLify
glib allocated memory area(s).
(strdup_convert): Rename to ...
(convert): ... this.  Don't strdup passed string.
(get_args): Use convert instead of strdup_convert.
(free_args): Make it do notning macro.
(open_include_file): Eliminate p array. Use glib function to
construct error_file_name. Use PATH_SEP instead of '/';
(edit_read_syntax_file): Use PATH_SEP_STR.
(edit_load_syntax): Use syntax_g_free to release error_file_name.
(edit_read_syntax_rules): Likewise.
2002-01-15 01:32:59 +00:00
Andrew V. Samoilov 3f55f6bf2f * editcmd.c (sprintf_p): Don't cast (char *) to (unsigned long). 2001-12-22 17:34:51 +00:00
Andrew V. Samoilov c69a25c5eb * editcmd.c (edit_goto_cmd): Use g_free to release f.
(edit_save_file): Use PATH_SEP instead of '/'.
Undefine "close" before closing file created by mc_mkstemps.
Define close to mc_close after it - temporary fix.
2001-12-22 17:29:46 +00:00
Andrew V. Samoilov bd3bdac638 * syntax.c (read_one_line): Undo last patch - errno is a
function on some systems.  Check ferror() status before
everithing else if fgetc returns EOF.
Accept last line without trailing newline.

(compare_word_to_right): Don't cast p and q to unsigned long.
(apply_rules_going_right): Likewise.
2001-12-22 16:00:30 +00:00
Pavel Roskin eba0c6e703 * edit.c (user_menu): Don't move the cursor before and after
inserting the block.
Reported by Matthias Urban <murban@cs.uni-magdeburg.de>
2001-12-22 00:32:20 +00:00
Pavel Roskin 6c821c8ad5 * syntax.c (read_one_line): Clear errno before using it. Don't
use the result of fgetc() if errno is EINTR.
2001-12-21 23:33:18 +00:00
Pavel Roskin 27d176979b s/crush/crash/ and other minor things. 2001-12-03 23:38:11 +00:00
Andrew V. Samoilov a34c2786cb * syntax.c (apply_rules_going_right): Fix crush for lines like
\s+ \n lightgray/13 red
in Syntax file.
(read_one_line): Use EOF instead of -1.
(get_args): Fix buffer overflow for l without trailing
whitespace(s).
(break_a): New macro.
(edit_read_syntax_rules): Use break_a to fix memory leaks.
(edit_load_syntax): Eliminate s and use message to prevent
buffer overflow.
2001-11-28 12:40:18 +00:00
Andrew V. Samoilov 23bdcf3d1e * editdraw.c (edit_render): Eliminate f. It's only written
but never read.
2001-11-28 12:31:48 +00:00
Andrew V. Samoilov d9a88088d1 * editmenu.c (edit_wrap_cmd): Use g_free() on the result
of input_dialog().
2001-11-27 12:38:30 +00:00
Andrew V. Samoilov 08a8461efa * editcmd.c (edit_save_file): Use g_free() on the result of
mc_mkstemps().
2001-11-22 10:56:09 +00:00
Andrew V. Samoilov 29dd051ce8 * edit.c (edit_renew): Release dir after use.
* editcmd.c (edit_replace_dialog): Eliminate tsearch_text,
treplace_text and targ_order.
(edit_replace_cmd): edit_replace_dialog gives g_malloced
strings, so g_strdup/g_free have to be used.  Accept only
positive pattern number in Scanf search and replace.
(edit_save_file): Enable safe save and backups on remote VFS.
2001-11-19 07:31:32 +00:00
Andrew V. Samoilov b6b8cd0433 * edit_key_translator.c (cooledit_key_map):
Add C-k, CK_Delete_To_Line_End.

* edit.c (user_menu): Don't assign block_file twice.
2001-11-16 07:23:36 +00:00
Andrew V. Samoilov 51b1972843 * edit.c (edit_reload): destroy_dlg g_free()s widgets, so
g_malloc/g_free have to be used.
	(edit_init): Ditto.  Eliminate st.
2001-11-07 08:43:15 +00:00