diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 11:54:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 11:54:00 -0700 |
commit | 609b0dd2146330e61d8ed024fca660158836d8c0 (patch) | |
tree | 576e0d3556a77a8608ad99cdc111568fb4a2cf3d /txr.1 | |
parent | ba911c661c4a3607c80dcd0c30d4313e558a9243 (diff) | |
download | txr-609b0dd2146330e61d8ed024fca660158836d8c0.tar.gz txr-609b0dd2146330e61d8ed024fca660158836d8c0.tar.bz2 txr-609b0dd2146330e61d8ed024fca660158836d8c0.zip |
linenoise: paren matching jump finds closes paren.
* linenoise/linenoise.c (find_nearest_paren): New static
function.
(edit_move_matching_paren): Use find_matching_paren to
usefully handle situations when the cursor is not on
a parenthesis, bracket or brace.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -33607,9 +33607,22 @@ edit buffer. .NP* Jump to Matching Parenthesis If the cursor is on an opening or closing parenthesis, brace or bracket, -the Ctrl-] command will jump to the matching character. The logic for +the Ctrl-] command tries to jump to the matching character. The logic for finding the matching character is identical to that of the Parenthesis Matching -feature. +feature. If no matching character is found, then no movement takes place. + +If the cursor is not on an opening or closing parenthesis, brace or bracket, +then the closest such character is found. The cursor is moved to that character +and then an attempt is made to jump to the matching one from that new +position. + +If the cursor is equidistant to two such characters, then one of them +is chosen as follows. If the two characters are oriented in the same way (both +are opening and closing), then that one is chosen whose convex side faces the +cursor position. Thus, effectively, an inner enclosure is favored over an +outer one. Otherwise, if the two characters have opposite orientation (one is +opening and the other closing), then the one which is to the right of the +cursor position is chosen. Note: the Ctrl-] character can be produced on some terminals using Ctrl-5 (using the keyboard home row 5, not the numeric keypad 5). This the same |