mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-06-03 03:02:12 +02:00
Compare commits
3 commits
44a7ab6b82
...
1266938001
Author | SHA1 | Date | |
---|---|---|---|
1266938001 | |||
43b76efaf9 | |||
17b9cec51b |
20
h-m-m
20
h-m-m
|
@ -180,6 +180,7 @@ const ctrl_r = "\022";
|
||||||
const ctrl_f = "\006";
|
const ctrl_f = "\006";
|
||||||
const ctrl_v = "\026";
|
const ctrl_v = "\026";
|
||||||
const ctrl_h = "\010";
|
const ctrl_h = "\010";
|
||||||
|
const ctrl_o = "\017";
|
||||||
|
|
||||||
const arr_down = "\033\133\102";
|
const arr_down = "\033\133\102";
|
||||||
const arr_right = "\033\133\103";
|
const arr_right = "\033\133\103";
|
||||||
|
@ -470,7 +471,6 @@ function load_file(&$mm)
|
||||||
$lines = file($mm['filename'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
$lines = file($mm['filename'], FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unset($mm['filename']);
|
|
||||||
load_empty_map($mm);
|
load_empty_map($mm);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2528,9 +2528,13 @@ function load_empty_map(&$mm)
|
||||||
]
|
]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$title = basename( $mm['filename'] ?? 'root' );
|
||||||
|
if (substr($title,-4)=='.hmm')
|
||||||
|
$title = substr($title,0,-4);
|
||||||
|
|
||||||
$mm['nodes'][1] =
|
$mm['nodes'][1] =
|
||||||
[
|
[
|
||||||
'title'=> basename( $mm['filename'] ?? 'root' )
|
'title'=> $title
|
||||||
,'is_leaf'=>true
|
,'is_leaf'=>true
|
||||||
,'children'=>[]
|
,'children'=>[]
|
||||||
,'collapsed'=>false
|
,'collapsed'=>false
|
||||||
|
@ -3058,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
|
// {{{ sort
|
||||||
|
|
||||||
|
@ -3166,6 +3181,7 @@ function monitor_key_presses(&$mm)
|
||||||
case 'n': next_search_result($mm); break;
|
case 'n': next_search_result($mm); break;
|
||||||
case 'N': previous_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_sibling); break;
|
||||||
case 'O': insert_new_node($mm, insert_child); break;
|
case 'O': insert_new_node($mm, insert_child); break;
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ Search:
|
||||||
* `n` - goes to the next search result
|
* `n` - goes to the next search result
|
||||||
* `N` - goes to the previous 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 the previous file name (or asks for one if there's none)
|
||||||
* `S` - saves with a new file name
|
* `S` - saves with a new file name
|
||||||
|
@ -85,6 +85,7 @@ Save, export, and quit:
|
||||||
* `X` - export as a text map into clipboard
|
* `X` - export as a text map into clipboard
|
||||||
* `q` - quits (if the changes were already saved)
|
* `q` - quits (if the changes were already saved)
|
||||||
* `Q` - quits, ignoring the changes
|
* `Q` - quits, ignoring the changes
|
||||||
|
* `Ctrl+o` - open the active node as a file or URL using xdg-open
|
||||||
|
|
||||||
In the text editor:
|
In the text editor:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue