vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 7773d1db871aadd0c949426a926bbf3e4b9549a5
parent 55b6c7decf0de6349ea907141f8975ad5c284e09
Author: Randy Palamar <palamar@ualberta.ca>
Date:   Fri, 22 Sep 2023 09:08:05 -0600

vis-complete: use hand picked set of characters for word splitting

{w,}ctype(3) character classes are essentially broken for non-ascii
text. b8e48c9 tried to fix this for words surrounded by blanks but forgot
the use case of completing function and variable names in source code.

Instead of relying on the terrible ctype interface we can hand pick
a set that is good enough for both source code completion and writing
prose. This set is consistent with the old [:alnum:] behaviour for ascii
text but also supports words with single width non-ascii characters.

fixes b8e48c9: vis-complete: handle non-ascii text
closes #1132: Source code completion are broken

Diffstat:
Mvis-complete | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vis-complete b/vis-complete @@ -48,7 +48,7 @@ fi PATTERN="$1" if [ $COMPLETE_WORD = 1 ]; then - tr -s '[:blank:]_' '\n' | + tr -s '\t {}()[],<>%^&.' '\n' | grep "^$(basic_regex_quote "$PATTERN")." | sort -u else