start viewer from editor

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2010-06-11 22:45:32 +00:00
parent af9cc81804
commit 0782b3d7c8
5 changed files with 17 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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;

View File

@ -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);
}

View File

@ -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 },