[vim/vim] Syntax highlighting for messages with RFC3339 timestamp (#946)

32 views
Skip to first unread message

Sung Po-Han

unread,
Jul 25, 2016, 12:57:56 AM7/25/16
to vim/vim

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*'


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, .

Charles E Campbell

unread,
Jul 26, 2016, 1:13:12 PM7/26/16
to vim...@googlegroups.com
Sung Po-Han wrote:
>
> vim-messages
> <https://cloud.githubusercontent.com/assets/4366282/17090117/0268ef74-5260-11e6-9929-dfc1f238dd38.png>
> 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*' |
>
Please send changes to syntax files to their maintainer; typically,
you'll find their name and email at the top of the sytnax file itself.
Hint: its Yakov Lerner, for syntax/messages.vim. Otherwise, unless the
maintainer keeps an eye on the mailing list, your changes will not be
included.
Chip Campbell

Christian Brabandt

unread,
Jul 26, 2016, 1:17:47 PM7/26/16
to vim/vim

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

lacygoill

unread,
Jan 27, 2021, 12:36:42 PM1/27/21
to vim/vim, Subscribed

https://github.com/vim/vim/blob/21829c5f2c86cd525c8468121b4fc54c5d75bf6e/runtime/doc/todo.txt#L1486-L1487

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*'


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
Jan 27, 2021, 4:05:58 PM1/27/21
to vim/vim, Subscribed

I'll include that change.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
Jan 27, 2021, 4:06:00 PM1/27/21
to vim/vim, Subscribed

Closed #946.


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or unsubscribe.

Reply all
Reply to author
Forward
0 new messages