mirror of
https://github.com/nadrad/h-m-m.git
synced 2024-05-16 22:36:32 +02:00
check mark and ballot X character toggle
It's a quick way of adding the ✓ and ✗ symbols at the beginning of titles by pressing the 't' key.
This commit is contained in:
parent
3a1f2db77d
commit
9ab20b40da
21
h-m-m
21
h-m-m
|
@ -948,6 +948,25 @@ function build_map(&$mm)
|
|||
}
|
||||
|
||||
|
||||
// }}}
|
||||
// {{{ toggle symbol
|
||||
|
||||
function toggle_symbol(&$mm)
|
||||
{
|
||||
$chr = mb_substr($mm['nodes'][ $mm['active_node'] ]['title'],0,2);
|
||||
if ($chr=='✓ ')
|
||||
$mm['nodes'][ $mm['active_node'] ]['title'] = '✗ '.mb_substr($mm['nodes'][ $mm['active_node'] ]['title'],2);
|
||||
elseif ($chr=='✗ ')
|
||||
$mm['nodes'][ $mm['active_node'] ]['title'] = mb_substr($mm['nodes'][ $mm['active_node'] ]['title'],2);
|
||||
else
|
||||
$mm['nodes'][ $mm['active_node'] ]['title'] = '✓ '.$mm['nodes'][ $mm['active_node'] ]['title'];
|
||||
|
||||
$mm['modified'] = true;
|
||||
build_map($mm);
|
||||
display($mm);
|
||||
}
|
||||
|
||||
|
||||
// }}}
|
||||
// {{{ toggle node
|
||||
|
||||
|
@ -2709,6 +2728,8 @@ function monitor_key_presses(&$mm)
|
|||
case 's': save($mm); break;
|
||||
case 'S': save($mm, true); break;
|
||||
|
||||
case 't': toggle_symbol($mm); break;
|
||||
|
||||
case 'u': undo($mm); break;
|
||||
|
||||
case 'v': collapse_all($mm); break;
|
||||
|
|
|
@ -22,6 +22,7 @@ Adding, removing, and editing nodes:
|
|||
* `Ctrl+p` - appends the clipboard text at the end of the active node's title
|
||||
* `e`, `i`, or `a` - edits the active node
|
||||
* `E`, `I`, or `A` - edits the active node, ignoring the existing text
|
||||
* `t` - toggles '✓ ', '✗ ', and '' at the beginning of the title
|
||||
* `u` - undo
|
||||
* `Ctrl+r` - redo
|
||||
|
||||
|
|
Loading…
Reference in a new issue