mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-20 18:29:19 +03:00
Launching external editor/viewer with F4/F3 w/o passing line number.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
cef5286fce
commit
9757d53cf4
@ -169,17 +169,7 @@ do_view_cmd (gboolean normal)
|
|||||||
static inline void
|
static inline void
|
||||||
do_edit (const vfs_path_t * what_vpath)
|
do_edit (const vfs_path_t * what_vpath)
|
||||||
{
|
{
|
||||||
long line = 0;
|
edit_file_at_line (what_vpath, use_internal_edit != 0, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
@ -662,7 +652,7 @@ view_file_at_line (const vfs_path_t * filename_vpath, gboolean plain_view, gbool
|
|||||||
{
|
{
|
||||||
char view_entry[BUF_TINY];
|
char view_entry[BUF_TINY];
|
||||||
|
|
||||||
if (start_line != 0)
|
if (start_line > 0)
|
||||||
g_snprintf (view_entry, sizeof (view_entry), "View:%ld", start_line);
|
g_snprintf (view_entry, sizeof (view_entry), "View:%ld", start_line);
|
||||||
else
|
else
|
||||||
strcpy (view_entry, "View");
|
strcpy (view_entry, "View");
|
||||||
@ -706,18 +696,7 @@ view_file_at_line (const vfs_path_t * filename_vpath, gboolean plain_view, gbool
|
|||||||
gboolean
|
gboolean
|
||||||
view_file (const vfs_path_t * filename_vpath, gboolean plain_view, gboolean internal)
|
view_file (const vfs_path_t * filename_vpath, gboolean plain_view, gboolean internal)
|
||||||
{
|
{
|
||||||
long line = 0;
|
return view_file_at_line (filename_vpath, plain_view, internal, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -810,9 +789,6 @@ edit_file_at_line (const vfs_path_t * what_vpath, gboolean internal, long start_
|
|||||||
editor = get_default_editor ();
|
editor = get_default_editor ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start_line < 1)
|
|
||||||
start_line = 1;
|
|
||||||
|
|
||||||
execute_external_editor_or_viewer (editor, what_vpath, start_line);
|
execute_external_editor_or_viewer (editor, what_vpath, start_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user