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

Fix highlight for usernames #83

Merged

Conversation

mrparalon
Copy link
Contributor

  1. Fixed regex for username. Now it supports_-. and Unicode symbols like German letters.
    изображение
    Here is example of usernames, which is valid, but didn't work before
@pötzsch 1 day ago 
@Aleksei.Sherchenkov 1 day ago 
@Aleksei-Sherchenkov 1 day ago 
@Aleksei_Sherchenkov-Second 1 day ago 
  1. Fixed getting colors from HL groups. On my Mac in terminal, terminal using tmux and neovide it returned empty string. I took code from documentation of vim.fn.hlID()

@mrparalon mrparalon force-pushed the fix-username-highlights branch from 79e3776 to c8e16ec Compare November 8, 2023 17:47
Copy link
Owner

@harrisoncramer harrisoncramer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing this, one small comment relating to the Regex.

@@ -2,7 +2,7 @@ if filereadable($VIMRUNTIME . '/syntax/markdown.vim')
source $VIMRUNTIME/syntax/markdown.vim
endif

syntax match Username "@\w\+"
syntax match Username "@\I\+[\_\-\.]*\I\+"
Copy link
Owner

@harrisoncramer harrisoncramer Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me this isn't capturing the final digit in my username. I think the regular expression you provided does not include digits?

Screenshot 2023-11-08 at 12 52 27 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIxed

@harrisoncramer harrisoncramer merged commit a032c64 into harrisoncramer:main Nov 8, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants