mirror of https://github.com/MidnightCommander/mc
start viewer from editor
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
parent
af9cc81804
commit
0782b3d7c8
|
@ -72,6 +72,8 @@
|
|||
#define CK_Replace_Again 304
|
||||
#define CK_Complete_Word 305
|
||||
|
||||
#define CK_Load_Viewer 311
|
||||
|
||||
#if 0
|
||||
/* debugger commands */
|
||||
#define CK_Debug_Start 350
|
||||
|
|
|
@ -291,6 +291,7 @@ void format_paragraph (WEdit * edit, int force);
|
|||
|
||||
/* either command or char_for_insertion must be passed as -1 */
|
||||
void edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion);
|
||||
void edit_open_viewer (WEdit * edit);
|
||||
|
||||
#define get_sys_error(s) (s)
|
||||
|
||||
|
|
|
@ -3481,6 +3481,10 @@ edit_execute_cmd (WEdit * edit, unsigned long command, int char_for_insertion)
|
|||
edit->force |= REDRAW_PAGE;
|
||||
break;
|
||||
|
||||
case CK_Load_Viewer:
|
||||
edit_open_viewer (edit);
|
||||
dlg_stop (edit->widget.parent);
|
||||
break;
|
||||
case CK_Find:
|
||||
edit_search_cmd (edit, 0);
|
||||
break;
|
||||
|
|
|
@ -3152,3 +3152,11 @@ edit_move_block_to_left (WEdit * edit)
|
|||
while (cur_bol >= start_bol);
|
||||
edit->force |= REDRAW_PAGE;
|
||||
}
|
||||
|
||||
void
|
||||
edit_open_viewer (WEdit * edit)
|
||||
{
|
||||
char *filename = vfs_canon (edit->filename);
|
||||
|
||||
view_file_at_line (filename, 1, 1, edit->curs_line + 1);
|
||||
}
|
||||
|
|
|
@ -231,6 +231,8 @@ static name_keymap_t command_names[] = {
|
|||
{ "EditChooseSyntax", CK_Choose_Syntax },
|
||||
{ "EditAbout", CK_About },
|
||||
|
||||
{ "EditLoadViewer", CK_Load_Viewer },
|
||||
|
||||
#if 0
|
||||
{ "EditFocusNext", CK_Focus_Next },
|
||||
{ "EditFocusPrev", CK_Focus_Prev },
|
||||
|
|
Loading…
Reference in New Issue