new feature for opening the active node with xdg-open

This commit is contained in:
nadrad 2023-04-19 17:58:56 +02:00
parent 17b9cec51b
commit 43b76efaf9
2 changed files with 15 additions and 1 deletions

13
h-m-m
View file

@ -180,6 +180,7 @@ const ctrl_r = "\022";
const ctrl_f = "\006";
const ctrl_v = "\026";
const ctrl_h = "\010";
const ctrl_o = "\017";
const arr_down = "\033\133\102";
const arr_right = "\033\133\103";
@ -3061,6 +3062,17 @@ function rank(&$mm, $add_positive, $add_negative)
}
// }}}
// {{{ open link
function open_link(&$mm)
{
message($mm,'Opening the node with xdg-open...');
exec('xdg-open "'.$mm['nodes'][ $mm['active_node'] ]['title'].'" >/dev/null 2>&1 &', $output, $result);
display($mm);
}
// }}}
// {{{ sort
@ -3169,6 +3181,7 @@ function monitor_key_presses(&$mm)
case 'n': next_search_result($mm); break;
case 'N': previous_search_result($mm); break;
case ctrl_o: open_link($mm); break;
case 'o': insert_new_node($mm, insert_sibling); break;
case 'O': insert_new_node($mm, insert_child); break;

View file

@ -77,7 +77,7 @@ Search:
* `n` - goes to the next search result
* `N` - goes to the previous search result
Save, export, and quit:
Save, export, quit, etc.:
* `s` - saves with the previous file name (or asks for one if there's none)
* `S` - saves with a new file name
@ -85,6 +85,7 @@ Save, export, and quit:
* `X` - export as a text map into clipboard
* `q` - quits (if the changes were already saved)
* `Q` - quits, ignoring the changes
* `Ctrl+r` - open the active node as a file or URL using xdg-open
In the text editor: