diff --git a/h-m-m b/h-m-m index 5997efa..723ed2c 100755 --- a/h-m-m +++ b/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; diff --git a/readme.md b/readme.md index 327065a..879341d 100644 --- a/readme.md +++ b/readme.md @@ -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