From dac6a7e5a603be7b55180815f3f072e632d87b8b Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Fri, 22 Sep 2023 09:08:05 -0600 Subject: vis-complete: use hand picked set of characters for word splitting {w,}ctype(3) character classes are essentially broken for non-ascii text. 711447a 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 711447a: vis-complete: handle non-ascii text closes #1132: Source code completion are broken --- vis-complete | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vis-complete b/vis-complete index 5468073..b9e4357 100755 --- 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 -- cgit v1.2.3