Broken syntax in vim.vim

137 views
Skip to first unread message

mattn

unread,
Jun 26, 2013, 8:34:42 AM6/26/13
to vim...@googlegroups.com
Hi list.

When below's text in foo.vim
---------
augroup x
g:indent_guides_enable_on_vim_startup
---------

The syntax is broken.

http://cache.gyazo.com/c7d8bdc05b41dde7621d2262d8a9ca56.png

This patch fixes syntax of global autoload variable like 'g:foo#bar#bar'.

Below is a patch. Please check.

https://gist.github.com/5867028

- Yasuhiro Matsumoto

Charles Campbell

unread,
Jun 26, 2013, 9:57:35 AM6/26/13
to vim...@googlegroups.com
I'm afraid that I don't see this problem with synax/vim.vim v7.3-25.
You can get a copy from my website:
http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM .
Please try it out and see if your problem persists.

Regards,
C Campbell

Lech Lorens

unread,
Jun 26, 2013, 10:10:18 AM6/26/13
to vim_dev
On 26 June 2013 15:57, Charles Campbell <Charles.E...@nasa.gov> wrote:
> mattn wrote:
>>
>> Hi list.
>>
[...]
>>
> I'm afraid that I don't see this problem with synax/vim.vim v7.3-25. You
> can get a copy from my website:
> http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM .
> Please try it out and see if your problem persists.

I do see the problem with vim.vim v7.3-25.
The strange highlighting comes from vimSubstFlagErr.

--
Cheers,
Lech

Charles Campbell

unread,
Jun 26, 2013, 10:31:31 AM6/26/13
to vim...@googlegroups.com
I tried it again with simple.vimrc:

set nocp
syn on

vim -u simple.vimrc junk.vim

where junk.vim is:

augroup indent_guides
autocmd!
if g:indent_guides_enable_on_vim_startup
autocmd VimEnter * :IndentGuidesEnable
endif
augroup END

This is with syntax/vim.vim v7.3-25 and vim v7.3.1237.

Still, I see no errant highlighting present.

Regards,
C Campbell

Yukihiro Nakadaira

unread,
Jun 26, 2013, 11:02:45 AM6/26/13
to vim...@googlegroups.com
On Wed, Jun 26, 2013 at 11:31 PM, Charles Campbell <Charles.E...@nasa.gov> wrote:
I tried it again with simple.vimrc:

  set nocp
  syn on

":filetype plugin on" is also required to reproduce.
ftplugin/vim.vim executes ":set iskeyword+=:"

I tried the patch and it seems not fix that strange highlighting.

--
Yukihiro Nakadaira - yukihiro....@gmail.com

Yasuhiro MATSUMOTO

unread,
Jun 26, 2013, 11:34:32 AM6/26/13
to vim...@googlegroups.com
What value of your 're'?
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


--
- Yasuhiro Matsumoto

Charles Campbell

unread,
Jun 26, 2013, 11:38:34 AM6/26/13
to vim...@googlegroups.com
Yukihiro Nakadaira wrote:
> On Wed, Jun 26, 2013 at 11:31 PM, Charles Campbell
> <Charles.E...@nasa.gov <mailto:Charles.E...@nasa.gov>> wrote:
>
> I tried it again with simple.vimrc:
>
> set nocp
> syn on
>
>
> ":filetype plugin on" is also required to reproduce.
> ftplugin/vim.vim executes ":set iskeyword+=:"
>
> I tried the patch and it seems not fix that strange highlighting.
>
I just did a pull from the Merc repository; the system ftplugin/vim.vim
I got from it does not have set isk+=: in it. Is this your own change?
Anyway, it seems that that's your problem.

Regards,
C Campbell

Charles Campbell

unread,
Jun 26, 2013, 11:39:20 AM6/26/13
to vim...@googlegroups.com
Yasuhiro MATSUMOTO wrote:
> What value of your 're'?
>
Not sure what you want here. I usually interpret 're' in a vim context
as meaning "regular expression".

Regards,
C Campbell

Yukihiro Nakadaira

unread,
Jun 26, 2013, 11:50:29 AM6/26/13
to vim...@googlegroups.com
On Thu, Jun 27, 2013 at 12:38 AM, Charles Campbell <Charles.E...@nasa.gov> wrote:
Yukihiro Nakadaira wrote:

On Wed, Jun 26, 2013 at 11:31 PM, Charles Campbell <Charles.E...@nasa.gov <mailto:Charles.E.Campbell@nasa.gov>> wrote:

    I tried it again with simple.vimrc:

      set nocp
      syn on


":filetype plugin on" is also required to reproduce.
ftplugin/vim.vim executes ":set iskeyword+=:"

I tried the patch and it seems not fix that strange highlighting.

I just did a pull from the Merc repository; the system ftplugin/vim.vim I got from it does not have set isk+=: in it.  Is this your own change?  Anyway, it seems that that's your problem.

Ingo Karkat

unread,
Jun 26, 2013, 11:56:34 AM6/26/13
to vim...@googlegroups.com
The runtime update of Vim 7.3.488 (changeset 2cfb68fa26cd) adds ":" to
'iskeyword'; ostensibly "To make syntax highlighting of 'vimVar's work
correctly". Since you, Charles, maintain the Vimscript syntax, I'd
thought this actually came from you. (I had earlier complained about the
intransparent and infrequent change process of runtime files in
Mercurial; this is one instance where it hurts.)

I'd like to object against this change, not just because of the current
issue, but this also breaks tag jumping, because ctags puts functions
without the scope prefix into the tags database. (And this is better,
because prefixes are sometimes optional, and <SID> and s: are equivalent.)

Therefore, Charles, can't you make "vimVar's work correctly" without
adding ":" to 'iskeyword', and send a corresponding patch (for both
syntax/vim.vim and ftplugin/vim.vim) to Bram?! That would solve both the
broken syntax and the broken tag jumps.

-- regards, ingo

Yukihiro Nakadaira

unread,
Jun 26, 2013, 12:42:34 PM6/26/13
to vim...@googlegroups.com
Sorry, "set isk+=:" is not essential to reproduce.
"g:indent_guides_enable_on_vim_startup" is not highlighted as "vimVar" anyway.

ZyX

unread,
Jun 26, 2013, 1:01:27 PM6/26/13
to vim...@googlegroups.com
> The runtime update of Vim 7.3.488 (changeset 2cfb68fa26cd) adds ":" to
> 'iskeyword'; ostensibly "To make syntax highlighting of 'vimVar's work
> correctly". Since you, Charles, maintain the Vimscript syntax, I'd
> thought this actually came from you. (I had earlier complained about the
> intransparent and infrequent change process of runtime files in
> Mercurial; this is one instance where it hurts.)
>
>
>
> I'd like to object against this change, not just because of the current
> issue, but this also breaks tag jumping, because ctags puts functions
> without the scope prefix into the tags database. (And this is better,
> because prefixes are sometimes optional, and <SID> and s: are equivalent.)
>
> Therefore, Charles, can't you make "vimVar's work correctly" without
> adding ":" to 'iskeyword', and send a corresponding patch (for both
> syntax/vim.vim and ftplugin/vim.vim) to Bram?! That would solve both the
> broken syntax and the broken tag jumps.

I second the request and can add another reasons:

- It breaks python << EOF highlighting: `try:`/`else:` and so on is too common in python code.
- It breaks using `*` for searching for function argument (in function definition there are no `a:`).
- It breaks completion for functions with unique argument names (for the same reason) and completion for standard names (e.g. with consistent coding style there may be `l:repository` (`repository`) and `a:repository` at the same time).
- It breaks expectations of how searching works: if I want to find some word in comment using `\<works\>` I definitely not expect that `works:` in this sentence is not matched. I also would not expect searching for `\<works:\>` if I press `*` on `works:` in this sentence. It is hard to keep different habits for different filetypes. `-` in `isk` in zsh files is already too bad, do not make it worse by adding third filetype to a list.

Charles Campbell

unread,
Jun 26, 2013, 1:09:41 PM6/26/13
to vim...@googlegroups.com
Sounds like nasty stuff. Two problems:

1. There is no isk+=: in syntax/vim.vim v7.3-25
2. My copy of ftplugin/vim.vim, which I don't maintain, also does not
have isk+=: in it.

Regards,
C Campbell

Bram Moolenaar

unread,
Jun 26, 2013, 1:18:24 PM6/26/13
to Charles Campbell, vim...@googlegroups.com
Right. I don't know how this got there. If it really is for syntax
highlighting it should be in the syntax plugin, not the ftplugin.

In case of doubt I prefer to leave 'iskeyword' alone.

--
FATHER: Make sure the Prince doesn't leave this room until I come and
get him.
FIRST GUARD: Not ... to leave the room ... even if you come and get him.
FATHER: No. Until I come and get him.
SECOND GUARD: Hic.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Manuel Ortega

unread,
Jun 26, 2013, 1:28:19 PM6/26/13
to vim...@googlegroups.com
On Wed, Jun 26, 2013 at 1:09 PM, Charles Campbell <Charles.E...@nasa.gov> wrote:


Sounds like nasty stuff.  Two problems:

1. There is no isk+=: in syntax/vim.vim v7.3-25

Not here either.

 
2. My copy of ftplugin/vim.vim, which I don't maintain, also does not have isk+=: in it.


But mine does (line 26: setlocal isk+=:), and I don't fiddle with mine either.

-Manny

mattn

unread,
Jun 27, 2013, 1:36:36 AM6/27/13
to vim...@googlegroups.com
https://gist.github.com/mattn/5865363

I fixed patch.
Could you try this again?

mattn

unread,
Jun 27, 2013, 2:22:05 AM6/27/13
to vim...@googlegroups.com

Ingo Karkat

unread,
Jun 27, 2013, 2:47:27 AM6/27/13
to vim...@googlegroups.com, Bram Moolenaar
On 26-Jun-2013 19:18 +0200, Bram Moolenaar wrote:

> [44 lines deleted]
>
> Right. I don't know how this got there. If it really is for syntax
> highlighting it should be in the syntax plugin, not the ftplugin.

While I respect your decision to keep the dev process as it currently
works for you, and while I don't want to resurrect the old discussion
(https://groups.google.com/d/msg/vim_dev/9tggyPAX7sY/Hcz0TSkZpPIJ), I
can't stop myself from mentioning that with atomic commits of runtime
changes (like you do for source code patches), there would be a much
better chance of determining what this change was about. (Assuming you
had written a suitable commit message.)

Come on, you could just give it a try and do slightly more fine-grained
commits of runtime updates in the future. If it's too much effort, just
revert back to the bulky updates (occasionally).

> In case of doubt I prefer to leave 'iskeyword' alone.

Alright, so you're going to remove "isk+=:", but keep "isk+=#" (which is
undisputedly beneficial) in ftplugin/vim.vim?! Thanks!

-- regards, ingo
Reply all
Reply to author
Forward
0 new messages