From cef5286fce2f9ddca7a5ab28e4edf9654f8085c6 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 4 Dec 2013 14:27:15 +0400 Subject: [PATCH] Allow launch external editor/viewer w/o line number. Signed-off-by: Andrew Borodin --- src/execute.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/execute.c b/src/execute.c index 66eaff019..db742dbbf 100644 --- a/src/execute.c +++ b/src/execute.c @@ -266,9 +266,13 @@ execute_get_external_cmd_opts_from_config (const char *command, const vfs_path_t if (filename_vpath == NULL) return g_strdup (""); + parameter = g_shell_quote (vfs_path_get_last_path_str (filename_vpath)); + + if (start_line <= 0) + return parameter; + str_from_config = execute_get_opts_from_cfg (command, "%filename"); - parameter = g_shell_quote (vfs_path_get_last_path_str (filename_vpath)); return_str = str_replace_all (str_from_config, "%filename", parameter); g_free (parameter); g_free (str_from_config); @@ -615,6 +619,7 @@ execute_with_vfs_arg (const char *command, const vfs_path_t * filename_vpath) * @param command editor/viewer to run * @param filename_vpath path for edit/view * @param start_line cursor will be placed at the 'start_line' position after opening file + * if start_line is 0 or negative, no start line will be passed to editor/viewer */ void -- 2.11.4.GIT