Skip to content
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 #7402

Closed
mildred opened this issue Oct 16, 2017 · 4 comments
Closed

help syntax don't support help tags with unicode characters #7402

mildred opened this issue Oct 16, 2017 · 4 comments
Labels
bug issues reporting wrong behavior bug-vim wrong behavior inherited from vim closed:wontfix current behavior is by design, and change is not desired runtime funtime

Comments

@mildred
Copy link

mildred commented Oct 16, 2017

Here is defined the syntax highlighting pattern for help tags:

syn match helpHyperTextJump "\\\@<!|[#-)!+-~]\+|" contains=helpBar
syn match helpHyperTextEntry "\*[#-)!+-~]\+\*\s"he=e-1 contains=helpStar
syn match helpHyperTextEntry "\*[#-)!+-~]\+\*$" contains=helpStar

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 #-) range, and out of +-~ with the ! character excluded there are only control characters below 32, space , double quote", and the star *

@mildred
Copy link
Author

mildred commented Oct 16, 2017

Note that the :helptags commands already supports tags with unicode characters.

@mildred
Copy link
Author

mildred commented Oct 16, 2017

I am using this in my vimrc:

augroup vimrc_filetype_help
  au FileType help syn match helpHyperTextJump	"\\\@<!|[^ \þ!*]\+|" contains=helpBar
  au FileType help syn match helpHyperTextEntry	"\*[^ \t!*]\+\*\s"he=e-1 contains=helpStar
  au FileType help syn match helpHyperTextEntry	"\*[^ \t!*]\+\*$" contains=helpStar
augroup END

@justinmk
Copy link
Member

We don't want to fork the Vim runtime plugins in most cases (especially syntax plugins), unless there's a very good reason. Because if Vim changes something in the same file, it takes time to figure out the differences.

Probably this change will be accepted at https://github.com/vim/vim, could you report it there?

@justinmk justinmk added runtime funtime bug issues reporting wrong behavior bug-vim wrong behavior inherited from vim labels Oct 16, 2017
@justinmk
Copy link
Member

this was rejected at vim/vim#2213 , and we're not going to diverge here, since we merge Vim's runtime updates. And this can be overridden in one's vimrc as shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior bug-vim wrong behavior inherited from vim closed:wontfix current behavior is by design, and change is not desired runtime funtime
Projects
None yet
Development

No branches or pull requests

2 participants