summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Dight <joe.dight@ntmail.uk>2022-06-29 22:41:42 +0100
committerJoe Dight <joe.dight@ntmail.uk>2022-07-05 15:36:21 +0100
commit15b7bab3a7a7f0cdd18b1c8c37f86a43edc3387f (patch)
tree84311068f356c015f0f90133ec23d5c3ad2f162a
parente18d0be2fb036f0832f4aaadc369359f9d19bf4a (diff)
Allow changing default_open_file_under_cursor_cmd at runtime
-rwxr-xr-xsrc/doc6
-rwxr-xr-xsrc/gram.y9
2 files changed, 14 insertions, 1 deletions
diff --git a/src/doc b/src/doc
index 1e917ab..070c30a 100755
--- a/src/doc
+++ b/src/doc
@@ -59,7 +59,10 @@ Navigation commands:
g$ Go to the rightmost column visible on screen.
gM Go to the middle column on the screen.
gf Open filename or URL in current cell.
- Uses helper script 'scopen'.
+ Uses helper script 'scopen' by default.
+ A different executable may be used by changing the
+ 'default_open_file_under_cursor_cmd' configuration variable
+ at runtime, using the :set command.
H Go to the top row visible on screen.
L Go to the lowest row visible on screen.
M Go to the middle row on the screen.
@@ -2162,6 +2165,7 @@ Commands for handling cell content:
COPY_TO_CLIPBOARD_DELIMITED_TAB
COPY_TO_CLIPBOARD_DELIMITED_TAB = {NUMBER}
NOCOPY_TO_CLIPBOARD_DELIMITED_TAB
+ DEFAULT_OPEN_FILE_UNDER_CURSOR_CMD = {strarg}
NEWLINE_ACTION = {NUMBER}
TM_GMTOFF
TM_GMTOFF = {num}
diff --git a/src/gram.y b/src/gram.y
index 6e2d9d3..299975f 100755
--- a/src/gram.y
+++ b/src/gram.y
@@ -288,6 +288,7 @@ token S_YANKCOL
%token K_DEFAULT_PASTE_FROM_CLIPBOARD_CMD
%token K_COPY_TO_CLIPBOARD_DELIMITED_TAB
%token K_NOCOPY_TO_CLIPBOARD_DELIMITED_TAB
+%token K_DEFAULT_OPEN_FILE_UNDER_CURSOR_CMD
%token K_IGNORECASE
%token K_NOIGNORECASE
%token K_TM_GMTOFF
@@ -1684,6 +1685,14 @@ setitem :
else parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=1", TRUE); }
| K_NOCOPY_TO_CLIPBOARD_DELIMITED_TAB { parse_str(user_conf_d, "copy_to_clipboard_delimited_tab=0", TRUE); }
+ | K_DEFAULT_OPEN_FILE_UNDER_CURSOR_CMD '=' strarg {
+ char cmd[MAXCMD];
+ char * s = (char *) $3;
+ sprintf(cmd, "default_open_file_under_cursor_cmd=%s", s);
+ parse_str(user_conf_d, cmd, FALSE);
+ scxfree(s);
+ }
+
| K_NEWLINE_ACTION '=' NUMBER {
if ($3 == 0) parse_str(user_conf_d, "newline_action=0", TRUE); }
| K_COMMAND_TIMEOUT { parse_str(user_conf_d, "command_timeout=3000", TRUE); }