[vim/vim] Hyphenated usernames not highlighted correctly in sudoers files (Issue #18963)

5 views
Skip to first unread message

StephenWall

unread,
Dec 18, 2025, 11:39:39 AM (12 hours ago) Dec 18
to vim/vim, Subscribed
StephenWall created an issue (vim/vim#18963)

Steps to reproduce

Use vim to edit a sudoers file that has hyphenated username in it, such as www-data (the apache username on Ubuntu 24.04 LTS).
Note that the hyphenated usernames are not colored. This would also occur with usernames containing digits.
Ubuntu has NAME_REGEX setting of "^[a-z][-a-z0-9_]*$?$", so a trailing "$" is also allowed.

Expected behaviour

I expect "www-data" to be highlighted the same as any non-hyphenated username.

I achieved this locally by changing vim91/syntax/sudoers.vim to have \l[a-z0-9-]* instead of \l\+ in all syn match statements that had UserName, Group, or UserNetgroup in the name. Note that doesn't allow the trailing dollar sign.

Version of Vim

vim 9.1, patches 1-16, 647, 678, 697

Environment

Ubuntu 24.04 LTS
Windows Terminal
xterm-256color
bash

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18963@github.com>

Christian Brabandt

unread,
Dec 18, 2025, 11:44:47 AM (12 hours ago) Dec 18
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18963)

@e-kwsm please


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18963/3671167637@github.com>

Reply all
Reply to author
Forward
0 new messages