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

Syntax highlighting for messages with RFC3339 timestamp #946

Closed
solarispika opened this issue Jul 25, 2016 · 3 comments
Closed

Syntax highlighting for messages with RFC3339 timestamp #946

solarispika opened this issue Jul 25, 2016 · 3 comments
Labels

Comments

@solarispika
Copy link

vim-messages
It seems that the hostname is considered as a tag name.

By checking the file runtime/syntax/messages.vim, I found it is easy to fix.

diff --git a/runtime/syntax/messages.vim b/runtime/syntax/messages.vim
index c22e4e8..59425fc 100644
--- a/runtime/syntax/messages.vim
+++ b/runtime/syntax/messages.vim
@@ -26,7 +26,7 @@ syn match   messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d'
 syn match   messagesRFC3339T    contained display '\cT'
                                 \ nextgroup=messagesHourRFC3339

-syn match   messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
+syn match   messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)\s*'
                                 \ nextgroup=messagesHost

 syn match   messagesHost        contained display '\S*\s*'
@chrisbra
Copy link
Member

please contact the syntax script maintainer and discuss the issue with him. Thanks.

@lacygoill
Copy link

vim/runtime/doc/todo.txt

Lines 1486 to 1487 in 21829c5

Syntax highlighting for messages with RFC3339 timestamp (#946)
Did maintainer reply?

It's been more than 4 years; I think the maintainer did not reply.

As suggested by the OP, this patch fixes the issue:

diff --git a/runtime/syntax/messages.vim b/runtime/syntax/messages.vim
index c22e4e8d0..59425fca5 100644
--- a/runtime/syntax/messages.vim
+++ b/runtime/syntax/messages.vim
@@ -26,7 +26,7 @@ syn match   messagesDateRFC3339 contained display '\d\{4}-\d\d-\d\d'
 syn match   messagesRFC3339T    contained display '\cT'
                                 \ nextgroup=messagesHourRFC3339
 
-syn match   messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)'
+syn match   messagesHourRFC3339 contained display '\c\d\d:\d\d:\d\d\(\.\d\+\)\=\([+-]\d\d:\d\d\|Z\)\s*'
                                 \ nextgroup=messagesHost
 
 syn match   messagesHost        contained display '\S*\s*'

@brammool
Copy link
Contributor

I'll include that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants