ctrl+p function added

This commit is contained in:
nadrad 2022-09-02 09:16:02 +02:00
parent 5a2c79bf03
commit 36da570c07
2 changed files with 21 additions and 3 deletions

23
h-m-m
View file

@ -1643,6 +1643,22 @@ function encode_tree(&$mm, $id, $exclude_parent = false, $base = 0){
}
// }}}
// {{{ append
function append(&$mm){
$mm['nodes'][ $mm['active_node'] ]['title'] .=
' '.
trim(get_from_clipboard());
build_map($mm);
display($mm);
}
// }}}
// {{{ paste sub-tree
@ -2200,8 +2216,9 @@ function monitor_key_presses(&$mm){
if ($in=='d') delete_node($mm);
if ($in=='D') delete_node($mm, true);
if ($in=='p') paste_sub_tree($mm, false);
if ($in=='P') paste_sub_tree($mm, true);
if ($in=='p') paste_sub_tree($mm, false);
if ($in=='P') paste_sub_tree($mm, true);
if ($in=="\020") append($mm); // ^p
if ($in=='J') move_active_node_down($mm);
if ($in=='K') move_active_node_up($mm);
@ -2216,7 +2233,7 @@ function monitor_key_presses(&$mm){
// move(1,1);
// for ($i=0; $i<strlen($in); $i++)
// echo ord($in[$i]).' ';
// echo base_convert(ord($in[$i]),10,8).' ';
// echo ' ';
}

View file

@ -18,6 +18,7 @@ Adding, removing, and editing nodes:
* `D` - deletes (cuts) the descendants of the active node
* `p` - pastes as descendants of the active node
* `P` - pastes as siblings of the active node
* `ctrl+p` - appends the clipboard text at the end of the active node's title
* `e` - edits the active node
* `E` - edits the active node, ignoring the existing text