mirror of https://github.com/MidnightCommander/mc
Handle CK_ShowNumbers action in dialog level instead of widget one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
85ad1fe4ce
commit
6038c893e4
|
@ -254,6 +254,7 @@ void edit_refresh_cmd (void);
|
|||
void edit_syntax_onoff_cmd (Dlg_head * h);
|
||||
void edit_show_tabs_tws_cmd (Dlg_head * h);
|
||||
void edit_show_margin_cmd (Dlg_head * h);
|
||||
void edit_show_numbers_cmd (Dlg_head * h);
|
||||
void edit_date_cmd (WEdit * edit);
|
||||
void edit_goto_cmd (WEdit * edit);
|
||||
int eval_marks (WEdit * edit, long *start_mark, long *end_mark);
|
||||
|
|
|
@ -2176,10 +2176,7 @@ edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * f
|
|||
gboolean to_free = FALSE;
|
||||
|
||||
option_auto_syntax = 1; /* Resetting to auto on every invokation */
|
||||
if (option_line_state)
|
||||
option_line_state_width = LINE_STATE_WIDTH;
|
||||
else
|
||||
option_line_state_width = 0;
|
||||
option_line_state_width = option_line_state ? LINE_STATE_WIDTH : 0;
|
||||
|
||||
if (edit != NULL)
|
||||
edit_purge_widget (edit);
|
||||
|
@ -3928,12 +3925,6 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
|
|||
edit_mark_current_line_cmd (edit);
|
||||
break;
|
||||
|
||||
case CK_ShowNumbers:
|
||||
option_line_state = !option_line_state;
|
||||
option_line_state_width = option_line_state ? LINE_STATE_WIDTH : 0;
|
||||
edit->force |= REDRAW_PAGE;
|
||||
break;
|
||||
|
||||
case CK_Bookmark:
|
||||
book_mark_clear (edit, edit->curs_line, BOOK_MARK_FOUND_COLOR);
|
||||
if (book_mark_query_color (edit, edit->curs_line, BOOK_MARK_COLOR))
|
||||
|
|
|
@ -1530,6 +1530,22 @@ edit_show_margin_cmd (Dlg_head * h)
|
|||
dlg_redraw (h);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/**
|
||||
* Toggle line numbers showing in all editor windows.
|
||||
*
|
||||
* @param h root widget for all windows
|
||||
*/
|
||||
|
||||
void
|
||||
edit_show_numbers_cmd (Dlg_head * h)
|
||||
{
|
||||
option_line_state = !option_line_state;
|
||||
option_line_state_width = option_line_state ? LINE_STATE_WIDTH : 0;
|
||||
g_list_foreach (h->widgets, edit_redraw_page_cb, NULL);
|
||||
dlg_redraw (h);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
|
|
|
@ -590,6 +590,9 @@ edit_dialog_command_execute (Dlg_head * h, unsigned long command)
|
|||
case CK_ShowMargin:
|
||||
edit_show_margin_cmd (h);
|
||||
break;
|
||||
case CK_ShowNumbers:
|
||||
edit_show_numbers_cmd (h);
|
||||
break;
|
||||
case CK_Refresh:
|
||||
edit_refresh_cmd ();
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue