Skip to content

Commit

Permalink
showmeta: vi: Fix ? and +
Browse files Browse the repository at this point in the history
  • Loading branch information
aureliojargas committed Apr 10, 2020
1 parent 42af5fe commit c084ed8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmdline.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ javascript + ? {} | ()
sed \+ \? \{\} \| \(\)
tcl + ? | ()
vbscript + ? {} | ()
vi \{1\} \{01\} \{\} \(\)
vi \{\} \(\)
vim \+ \= \{} \| \(\)

NOTE: . [] [^] and * are the same on all programs.
Expand Down
7 changes: 6 additions & 1 deletion txt2regex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,12 @@ getMeta(){
local m="$1[$2]"
m=${!m}
m=${m//[@!,_]/}
printf '%s\n' "${m//\\\\{[01]*}" # needed for vi

# Remove when getting '?' or '+' for 'vi', since they are unsupported
# and the current values are workarounds using '{}'
[ "$1" == S2_vi ] && { [ "$2" -eq 2 ] || [ "$2" -eq 4 ]; } && m=""

printf '%s\n' "$m"
}

ShowMeta(){
Expand Down

0 comments on commit c084ed8

Please sign in to comment.