From 042380d3a02c3cf77cb971aea0e538bd9122c748 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 5 Jul 2001 15:19:34 +0000 Subject: [PATCH] * editdraw.c: Comment fixes. --- gtkedit/ChangeLog | 22 +++++++++++++--------- gtkedit/editdraw.c | 29 +++++++++++++++++------------ 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/gtkedit/ChangeLog b/gtkedit/ChangeLog index d536a5193..6e82805cf 100644 --- a/gtkedit/ChangeLog +++ b/gtkedit/ChangeLog @@ -1,3 +1,7 @@ +2001-07-05 Pavel Roskin + + * editdraw.c: Comment fixes. + 2001-06-26 Pavel Roskin * edit-widget.h (editor_widget): Rename `stat' to `stat1' to @@ -76,7 +80,7 @@ 2001-05-31 Andrew V. Samoilov - * editdraw.c (edit_status): Use strcpy (s, ) instead of + * editdraw.c (edit_status): Use strcpy (s, ) instead of sprintf (s, "%s", ). (set_color) [MIDNIGHT]: Became a macro. @@ -96,7 +100,7 @@ 2001-05-30 Andrew V. Samoilov - * syntax.c (open_include_file) [MIDNIGHT]: Don't hardcode location + * syntax.c (open_include_file) [MIDNIGHT]: Don't hardcode location of syntax file(s) with LIBDIR, use mc_home instead. From Ludovic Drolez . @@ -136,7 +140,7 @@ (edit_split_filename): f constified - * edit.c (edit_init) [ENABLE_NLS]: option_whole_chars_search + * edit.c (edit_init) [ENABLE_NLS]: option_whole_chars_search expanded by national letters using current locale on first call (edit_file_is_open) [MIDNIGHT]: all occurences and related code @@ -153,7 +157,7 @@ * editcmd.c (edit_delete_macro, edit_(load|save)_macro_cmd): don't translate keywords written to macro file or macro don't work, at least - for Cyrillic. Made this as separate commit, so, if it seriously breaks + for Cyrillic. Made this as separate commit, so, if it seriously breaks compatibility it's easy to revert it. 2000-09-15 Andrew V. Samoilov @@ -161,7 +165,7 @@ * editcmd.c (edit_save_file): fopen()+fwrite()+fclose() replaced by open()+write()+close() to restore possibility to edit files over Midnight Commander's VFSes - + (edit_replace_cmd) [MIDNIGHT]: some more right algorithm to calculate menu coordinates used. I don't like if menu hides replaced text. @@ -172,11 +176,11 @@ * edit.c (check_file_access) [MIDNIGHT,GTK]: error message localized; some cosmetics changes to avoid annoying warnings - * editcmd.c (edit_save_file): pclose returns 0 on success, + * editcmd.c (edit_save_file): pclose returns 0 on success, file fclose()d when fwrite fails - + (pipe_mail): malloc () + sprintf () replaced by g_strdup_printf () - + * syntax.c (syntax_text): Makefile replaced by [Mm]akefile to cover makefile and GNUmakefile (upgrade_syntax_file): infinitive loop fixed when rule file @@ -211,7 +215,7 @@ (edit_block_process_cmd): don't translate empty string * gtkedit/edit.h (edit_get_write_filter, edit_write_stream, - edit_init_file): added declarations + edit_init_file): added declarations * edit.c (edit_filters): constified (edit_get_write_filter): filename constified diff --git a/gtkedit/editdraw.c b/gtkedit/editdraw.c index 78e33d1da..0d51dfcd6 100644 --- a/gtkedit/editdraw.c +++ b/gtkedit/editdraw.c @@ -60,7 +60,7 @@ static void status_string (WEdit * edit, char *s, int w, int fill, int font_widt strcpy(byte_str, ""); } - /* The field lengths just prevent the status line from shortening to much */ + /* The field lengths just prevent the status line from shortening too much */ snprintf (s, w, "[%c%c%c%c] %2ld L:[%3ld+%2ld %3ld/%3ld] *(%-4ld/%4ldb)= %s", edit->mark1 != edit->mark2 ? ( column_highlighting ? 'C' : 'B') : '-', @@ -79,7 +79,7 @@ static void status_string (WEdit * edit, char *s, int w, int fill, int font_widt byte_str); } -#endif +#endif /* MIDNIGHT || GTK */ #ifdef MIDNIGHT @@ -198,10 +198,10 @@ void edit_status (WEdit * edit) #endif /* GTK */ -#endif /* MIDNIGHT */ +#endif /* !MIDNIGHT */ -/* boolean */ +/* result is boolean */ int cursor_in_screen (WEdit * edit, long row) { if (row < 0 || row >= edit->num_widget_lines) @@ -295,7 +295,10 @@ void edit_scroll_screen_over_cursor (WEdit * edit) int EditExposeRedraw = 0; int EditClear = 0; -/* background colors: marked is refers to mouse highlighting, highlighted refers to a found string. */ +/* + * background colors: marked is refers to mouse highlighting, + * highlighted refers to a found string. + */ unsigned long edit_abnormal_color, edit_marked_abnormal_color; unsigned long edit_highlighted_color, edit_marked_color; unsigned long edit_normal_background_color; @@ -376,7 +379,7 @@ static void print_to_widget (WEdit * edit, long row, int start_col, float start_ } } -/* b pointer to begining of line */ +/* b is a pointer to the beginning of the line */ static void edit_draw_this_line (WEdit * edit, long b, long row, long start_col, long end_col) { static unsigned int line[MAX_LINE_LEN]; @@ -502,7 +505,6 @@ static int key_pending (WEdit * edit) #endif -/* b for pointer to begining of line */ static void edit_draw_this_char (WEdit * edit, long curs, long row) { int b = edit_bol (edit, curs); @@ -537,8 +539,8 @@ void render_edit_text (WEdit * edit, long start_row, long start_column, long end #endif /* - if the position of the page has not moved then we can draw the cursor character only. - This will prevent line flicker when using arrow keys. + * If the position of the page has not moved then we can draw the cursor + * character only. This will prevent line flicker when using arrow keys. */ if ((!(force & REDRAW_CHAR_ONLY)) || (force & REDRAW_PAGE) #ifndef MIDNIGHT @@ -802,9 +804,12 @@ void edit_render (WEdit * edit, int page, int row_start, int col_start, int row_ #endif #endif render_edit_text (edit, row_start, col_start, row_end, col_end); - if (edit->force) /* edit->force != 0 means a key was pending and the redraw - was halted, so next time we must redraw everything in case stuff - was left undrawn from a previous key press */ + /* + * edit->force != 0 means a key was pending and the redraw + * was halted, so next time we must redraw everything in case stuff + * was left undrawn from a previous key press. + */ + if (edit->force) edit->force |= REDRAW_PAGE; #ifndef MIDNIGHT if (f) {