-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
help syntax don't support help tags with unicode characters #2213
Labels
Comments
Is |
yes, it is, sorry
|
I prefer to keep the help tags ASCII, so that they still work when 'encoding' is some code page. Some people still use that. And there is not much point in non-ASCII characters in help tags. |
But isn't it useful for translated help?
|
Most helpfiles are in ASCII anyway (which is compatible both with
UTF-8 multibyte and with ISO-8859 8bit). A few, like arabic.txt, are
in UTF-8 but won't be needed when compiled with -multi_byte.
options.txt is in UTF-8 because of the example for 'langmap' which
includes Greek letters, and is clearly marked as being in UTF-8. (By
default, +langmap is compiled into Big and Huge builds only, while
+multi_byte is already in Normal builds of Vim.)
For translated help, the _helpfiles_ may be in UTF-8 for non-ASCII
characters in the languages concerned, but IMHO the _tags_ themselves
ought to remain identical with those in the English-language help,
i.e., untranslated and in ASCII, so they will be found regardless of
which help language is in use, and even if one translated helpfile is
missing (in which case Vim falls back on the English help). Words in
the non-English 'helplang' language can be found by means of :helpgrep
Best regards,
Tony.
|
closing then. |
alerque
pushed a commit
to preservim/vim-textobj-quote
that referenced
this issue
Sep 1, 2021
Vim does not support non-ASCII characters in help documents. They can lead to an error when building help tags. See the following link for details: vim/vim#2213 (comment) However, if we remove the non-ASCII characters from just the first line of the document, then help tags build correctly. The alternative is to rename the document from *.txt to *.??x, which seems more confusing than changing one line. (In the future, if we have to choose between removing *all* the non-ASCII characters and changing the filename, I would support changing the filename.) This should fix #29. Thanks to @Freed-Wu for teaching us about this corner case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is defined the syntax highlighting pattern for help tags:
vim/runtime/syntax/help.vim
Lines 27 to 29 in 3ec574f
This pattern doesn't match utf-8 unicode characters. More specifically, the
[
...+-~]
matches the pure ASCII alphabet but not any alphabetic character beyond that. Specifying negative character class using[^ "*\t]
instead of[#-)!+-~]
would match all unicode charactes (and control characters, but those are not supposed to be present in text files except for tabs)A ASCII table would show that out of the
, double quote
#
-)
range, and out of+
-~
with the!
character excluded there are only control characters below 32, space"
, and the star*
Note that
:helptags
already supports unicode tags, it's just syntax hifhlighting that is lagging behind. I currently use this in my.vimrc
:Also reported with neovim in neovim/neovim#7402
The text was updated successfully, but these errors were encountered: