From 9757d53cf42b70a9673d0e3f9511e735a9e46bb2 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 4 Dec 2013 16:43:22 +0400 Subject: [PATCH] Launching external editor/viewer with F4/F3 w/o passing line number. Signed-off-by: Andrew Borodin --- src/filemanager/cmd.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/src/filemanager/cmd.c b/src/filemanager/cmd.c index a235e3e82..69a1969dc 100644 --- a/src/filemanager/cmd.c +++ b/src/filemanager/cmd.c @@ -169,17 +169,7 @@ do_view_cmd (gboolean normal) static inline void do_edit (const vfs_path_t * what_vpath) { - long line = 0; - - if (!use_internal_edit) - { - long column; - off_t offset; - - if (what_vpath != NULL && *(vfs_path_get_by_index (what_vpath, 0)->path) != '\0') - load_file_position (what_vpath, &line, &column, &offset, NULL); - } - edit_file_at_line (what_vpath, use_internal_edit != 0, line); + edit_file_at_line (what_vpath, use_internal_edit != 0, 0); } /* --------------------------------------------------------------------------------------------- */ @@ -662,7 +652,7 @@ view_file_at_line (const vfs_path_t * filename_vpath, gboolean plain_view, gbool { char view_entry[BUF_TINY]; - if (start_line != 0) + if (start_line > 0) g_snprintf (view_entry, sizeof (view_entry), "View:%ld", start_line); else strcpy (view_entry, "View"); @@ -706,18 +696,7 @@ view_file_at_line (const vfs_path_t * filename_vpath, gboolean plain_view, gbool gboolean view_file (const vfs_path_t * filename_vpath, gboolean plain_view, gboolean internal) { - long line = 0; - - if (!internal) - { - long column; - off_t offset; - - if (filename_vpath != NULL && *(vfs_path_get_by_index (filename_vpath, 0)->path) != '\0') - load_file_position (filename_vpath, &line, &column, &offset, NULL); - } - - return view_file_at_line (filename_vpath, plain_view, internal, line); + return view_file_at_line (filename_vpath, plain_view, internal, 0); } @@ -810,9 +789,6 @@ edit_file_at_line (const vfs_path_t * what_vpath, gboolean internal, long start_ editor = get_default_editor (); } - if (start_line < 1) - start_line = 1; - execute_external_editor_or_viewer (editor, what_vpath, start_line); }