lexicon_filter fix for escaped options

Fixes #1703. Also fixes short and long options markup in synopsis when
directly following a '(' or '[' character.
This commit is contained in:
Mark Griffiths 2014-09-23 05:18:16 +01:00 committed by Kevin Ballard
parent 5afd42c097
commit 8d3d51a020
2 changed files with 14 additions and 8 deletions

View file

@ -120,6 +120,6 @@ Performs a history search when the @key{Page Up} key is pressed.
\fish
set -g fish_key_bindings fish_vi_key_bindings
bind -M insert @args{@bksl{cc}} kill-whole-line force-repaint
bind -M insert \cc kill-whole-line force-repaint
\endfish
Turns on Vi key bindings and rebinds @key{Control,C} to clear the input line.

View file

@ -188,14 +188,14 @@ s/@sgst{\([^}]*\)}/\\\
#.
# Command/Function options
# Short options
s/ -\([A-Za-z][A-Za-z]*\)\([^A-Za-z}]\)/ \\\
<@opts{-\1}\
\2/g
s/\([[( ]\)-\([A-Za-z][A-Za-z]*\)\([^A-Za-z}]\)/\1\\\
<@opts{-\2}\
\3/g
#.
# Long options
s/ --\([A-Za-z][A-Za-z0-9=_-]*\)\([^A-Za-z0-9=_-]*\)/ \\\
<@opts{--\1}\
\2/g
s/\([[( ]\)--\([A-Za-z][A-Za-z0-9=_-]*\)\([^A-Za-z0-9=_-]*\)/\1\\\
<@opts{--\2}\
\3/g
#.
# Prompt
s/~>_/\\\
@ -211,6 +211,9 @@ s/___\(.\)/\\\
<@curs{\1}\
/
#.
# Escaped Options
s/ \\\([A-Za-z0-9][A-Za-z0-9]*\) / @bksl{\1} /g
#.
# Trailing Backslash
s/ \\$/ @bksl{ }/
#.
@ -447,7 +450,10 @@ s/\( *@redr{|} *\)@bltn/\1@xbln/g
s/^\( *\)@func/\1@xfnc/
s/\( *[;()] *\)@func/\1@xfnc/g
s/\( *@redr{|} *\)@func/\1@xfnc/g
s/\\@bltn{\([^}]*\)/@args{@bksl{\1}/g
s/ @bksl{\([^}]*\)} / @args{@bksl{\1}} /g
s/ @bksl{@bltn{\([^}]*\)}/ @args{@bksl{\1}/g
s/ @bksl{@func{\([^}]*\)}/ @args{@bksl{\1}/g
s/ @bksl{@cmnd{\([^}]*\)}/ @args{@bksl{\1}/g
s/@bltn/@args/g
s/@func/@args/g
s/@cmnd/@args/g