-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Description
Steps to reproduce
- In a new buffer, source:
for c in range(32, 48, 8)
echo nr2char(c) .. ' charclass=' .. nr2char(c)->charclass()
endfor
Echos (correctly):
charclass=0
( charclass=1
0 charclass=2
- In a help buffer,
set ma
to make it modifiable, then put the same for loop and source it:
Echos:
charclass=0
( charclass=2
0 charclass=2
Screenshots to illustrate:
Expected behaviour
charclass()
should always return 1 for the left parenthesis (and any punctuation character):
builtin.txt
help:
charclass({string}) charclass()
Return the character class of the first character in {string}.
The character class is one of:
0 blank
1 punctuation
2 word character
3 emoji
other specific Unicode class
The same thing happens for all punctuation characters, returning 2 instead of 1.
Version of Vim
9.1.90
Environment
Same result in Win11 gvim, Debian WSL Huge GTK3 GUI.
Also happens in Neovim 0.10.2, incidentally, just to see whether the same thing happens in it, and it does (not that I care particularly).
Logs and stack traces
No response