Wednesday, September 23, 2015

Re: Bug: Inconsistent result with searchpair()?



On Wed, Sep 23, 2015 at 12:24 PM, Christian Brabandt <cblists@256bit.org> wrote:

On Mi, 23 Sep 2015, David Fishburn wrote:

>
> I am about to run this searchpair() function
>     line 38: let indent_to = searchpair( '(', '', ')', 'W', 'synID(line
> ("."),col("."),1)>0' )
>
> So, I check my line, column, current character and show the full line:
> >echo line('.') col('.') getline('.')[col('.')-1] getline('.')
> 3 15 (     SELECT-@- (
>
...
 
My suspicion is, that syntax highlighting changes slightly and your skip
part catches it. Could you check the synid(line('.'),col('.'),1) for
when it does not move on both parenthesis? Did this perhaps get out of
sync and your (...) is somehow syntax highlighed?

Thanks for the response Christian.

I had run  :echo synID(line("."),col("."),1) at each position and it always comes back as 0, which is correct, there are no syntax elements on the ()s.

But given you comment, if I run:
:syntax off

I do not get the error.

:syntax on
:syntax sync fromstart

Get the error again.

If I choose a different ftplugin (:setlocal ft=javascript) I do not get the error.

Vim's SQL support allows you to set different SQL dialects using :SQLSetType, using <TAB> allows completion through the different types.

:SWhen I choose :SQLSetType plsql.vim instead of :SQLSetType sqlanywhere.vim, the problem also goes away.

I am the author the sqlanywhere.vim syntax file, so it appears I have either done something wrong, or added some additional things in this file that leads to the issue.


Not exactly sure where to start looking to find out what might be the issue here, as :echo synID(line("."),col("."),1) shows there are no syntax elements on these characters.  But I can try to binary commenting of the syntax script to see if I can narrow it down.

David





--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment