aboutsummaryrefslogtreecommitdiff
path: root/vis-complete
diff options
context:
space:
mode:
authorRandy Palamar <palamar@ualberta.ca>2023-09-22 09:08:05 -0600
committerRandy Palamar <palamar@ualberta.ca>2023-09-22 09:08:05 -0600
commitdac6a7e5a603be7b55180815f3f072e632d87b8b (patch)
treebb4aedea19e38567e57acb20db0f5f3211457784 /vis-complete
parent1344151b195c5ff83c2337427c1fdb1162250045 (diff)
downloadvis-dac6a7e5a603be7b55180815f3f072e632d87b8b.tar.gz
vis-dac6a7e5a603be7b55180815f3f072e632d87b8b.tar.xz
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
Diffstat (limited to 'vis-complete')
-rwxr-xr-xvis-complete2
1 files changed, 1 insertions, 1 deletions
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