Re: syntax match bug: 'keepend' not officially supported, but required in some cases

2016-09-29 Thread Brett Stahlman
On Thu, Sep 29, 2016 at 12:09 PM, Bram Moolenaar  wrote:
>
> Brett Stahlman wrote:
>
>> The syntax documentation suggests that the 'keepend' argument applies
>> only to syntax regions, not syntax matches. But if I highlight a
>> buffer containing only the following line...
>>
>> ABCDE
>>
>> ...with the following syntax definitions...
>>
>> syn match A /A/
>> syn match Inside /[A-Z]\+/ transparent contained containedin=A
>> hi A guifg=blue
>>
>> ...the match group "A" extends (apparently incorrectly) from A through
>> E, though its pattern matches only the "A". Stranger still, one
>> additional nested "Inside" group is recognized in each successive
>> letter. I.e., "Inside" is contained within "Inside", in spite of the
>> `containedin=A'. Thus, running synstack on successive characters, I
>> see...
>>
>> -- cursor on A --
>> A
>> Inside
>> -- cursor on B --
>> A
>> Inside
>> Inside
>> -- cursor on C --
>> A
>> Inside
>> Inside
>> Inside
>>
>>
>> I can fix the problem by adding the 'keepend' argument to the
>> definition for match group "A", but the "keepend" is highlighted as an
>> error by the vim syntax, and the help on :syn-match gives me no reason
>> to believe the argument should be supported.
>
> Yes, the "keepend" actually works, although it's not documented.  I'll
> add a note in the documentation.

Thanks.

>
>> Here are the results of synstack() with the following, "fixed" definition 
>> for A:
>> syn match A /A/ keepend
>>
>> -- cursor on A --
>> A
>> Inside
>> -- cursor on B --
>> -- cursor on C --
>>
>> Is 'keepend' meant to be supported for syn-match? The purpose of
>> 'keepend' is to prevent a nested group from obscuring a match with a
>> containing group's "end pattern". Although a match group has no
>> explicit end pattern, the principle of checking for the end of the
>> match pattern certainly still applies, so I suppose it makes sense
>> that 'keepend' would be accepted for both syn-match and syn-region. If
>> that is the intent, then the documentation needs fixing.
>>
>> As for the infinitely nested "Inside" groups, I can't account for
>> that, and suspect it's a bug, but perhaps I'm misunderstanding
>> something about contained and containedin?
>
> This is actually working as intended.  When using a transparent item,
> checking for contained items ignores that transparent item.  So the
> "containedin=A" applies every time.
>
> This can be avoided by add "contains=NONE to the Inside item:
>
>  syn match Inside /[A-Z]\+/ transparent contained containedin=A contains=NONE

Hmm... I see it now:
"The "contains=" argument is also inherited from the item it is contained in..."

Excluding the transparent item itself from the inherited list might
have produced less surprising behavior, but I guess this is sort of an
uncommon corner case, and I agree that Vim's behavior is consistent
with the documentation.

Thanks for looking into it.
Brett Stahlman

>
> --
> A mathematician is a device for turning coffee into theorems.
> Paul Erdos
> A computer programmer is a device for turning coffee into bugs.
> Bram Moolenaar
>
>  /// Bram Moolenaar -- b...@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///

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to anable lua for vim?

2016-09-29 Thread Dominique Pellé
AM,   wrote:

> Hi,
>
> To enable lua for vim I run configure as follows:
>
> ./configure --prefix=/usr/local --sysconfdir=/etc/vim --with-features=huge 
> --with-luainterp=dynamic --with-lua-prefix=/usr/bin --enable-luainterp=yes 
> --enable-pythoninterp
>
> . Vim compiles fine. But doing 'vim --version' produces (besides other
> output '-lua' instead of the exspected '+lua'.
>
> What did I wrong ?
>
> Thank you very much for any help in advance! :)
>
> Cheers,
> Meino

Probably you're missing the liblua dev package. Not sure which
OS or distribution you use, but on Ubuntu something like this
should install it:

$ sudo apt-get install liblua5.3-dev

Try "apt-cache search liblua" if you use Ubuntu to see what
versions of liblua are available.

Then:

$ cd vim
$ rm src/auto/config.cache
$ configure --enable-luainterp=yes --with-features=huge
$ make -j4
$ sudo make install

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to anable lua for vim?

2016-09-29 Thread Meino . Cramer
Ben Fritz  [16-09-29 19:24]:
> On Wednesday, September 28, 2016 at 9:16:34 PM UTC-5, meino.cra...@gmx.de 
> wrote:
> > Hi,
> > 
> > To enable lua for vim I run configure as follows:
> > 
> > ./configure --prefix=/usr/local --sysconfdir=/etc/vim --with-features=huge 
> > --with-luainterp=dynamic --with-lua-prefix=/usr/bin --enable-luainterp=yes 
> > --enable-pythoninterp
> > 
> > . Vim compiles fine. But doing 'vim --version' produces (besides other
> > output '-lua' instead of the exspected '+lua'.
> > 
> > What did I wrong ?
> > 
> > Thank you very much for any help in advance! :)
> > 
> > Cheers,
> > Meino
> 
> What's the output from that configure command?
> 
> -- 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Hi Ben,

I found the problem myself -- thank you to point me to the output:
The problem is, that lua is switched on with --enable-lua instead
of --with-* as many other options to configure.

Cheers
Meino


-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to anable lua for vim?

2016-09-29 Thread Ben Fritz
On Wednesday, September 28, 2016 at 9:16:34 PM UTC-5, meino.cra...@gmx.de wrote:
> Hi,
> 
> To enable lua for vim I run configure as follows:
> 
> ./configure --prefix=/usr/local --sysconfdir=/etc/vim --with-features=huge 
> --with-luainterp=dynamic --with-lua-prefix=/usr/bin --enable-luainterp=yes 
> --enable-pythoninterp
> 
> . Vim compiles fine. But doing 'vim --version' produces (besides other
> output '-lua' instead of the exspected '+lua'.
> 
> What did I wrong ?
> 
> Thank you very much for any help in advance! :)
> 
> Cheers,
> Meino

What's the output from that configure command?

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: syntax match bug: 'keepend' not officially supported, but required in some cases

2016-09-29 Thread Bram Moolenaar

Brett Stahlman wrote:

> The syntax documentation suggests that the 'keepend' argument applies
> only to syntax regions, not syntax matches. But if I highlight a
> buffer containing only the following line...
> 
> ABCDE
> 
> ...with the following syntax definitions...
> 
> syn match A /A/
> syn match Inside /[A-Z]\+/ transparent contained containedin=A
> hi A guifg=blue
> 
> ...the match group "A" extends (apparently incorrectly) from A through
> E, though its pattern matches only the "A". Stranger still, one
> additional nested "Inside" group is recognized in each successive
> letter. I.e., "Inside" is contained within "Inside", in spite of the
> `containedin=A'. Thus, running synstack on successive characters, I
> see...
> 
> -- cursor on A --
> A
> Inside
> -- cursor on B --
> A
> Inside
> Inside
> -- cursor on C --
> A
> Inside
> Inside
> Inside
> 
> 
> I can fix the problem by adding the 'keepend' argument to the
> definition for match group "A", but the "keepend" is highlighted as an
> error by the vim syntax, and the help on :syn-match gives me no reason
> to believe the argument should be supported.

Yes, the "keepend" actually works, although it's not documented.  I'll
add a note in the documentation.

> Here are the results of synstack() with the following, "fixed" definition for 
> A:
> syn match A /A/ keepend
> 
> -- cursor on A --
> A
> Inside
> -- cursor on B --
> -- cursor on C --
> 
> Is 'keepend' meant to be supported for syn-match? The purpose of
> 'keepend' is to prevent a nested group from obscuring a match with a
> containing group's "end pattern". Although a match group has no
> explicit end pattern, the principle of checking for the end of the
> match pattern certainly still applies, so I suppose it makes sense
> that 'keepend' would be accepted for both syn-match and syn-region. If
> that is the intent, then the documentation needs fixing.
> 
> As for the infinitely nested "Inside" groups, I can't account for
> that, and suspect it's a bug, but perhaps I'm misunderstanding
> something about contained and containedin?

This is actually working as intended.  When using a transparent item,
checking for contained items ignores that transparent item.  So the
"containedin=A" applies every time.

This can be avoided by add "contains=NONE to the Inside item:

 syn match Inside /[A-Z]\+/ transparent contained containedin=A contains=NONE

-- 
A mathematician is a device for turning coffee into theorems.
Paul Erdos
A computer programmer is a device for turning coffee into bugs.
Bram Moolenaar

 /// Bram Moolenaar -- b...@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///

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


gvim - not finding gtk icons when starting

2016-09-29 Thread Andy Falanga
I have vim 7.4 installed on PC-BSD.  When I start gvim from the command line, I 
see hundreds (at least 1024 because that's my scroll length) of lines like 
these:

/usr/home/afalanga/.config/qtcurve/gtk-icons:911: Unable to locate image file 
in pixmap_path: "16x16/actions/bookmarks-organize.png"
/usr/home/afalanga/.config/qtcurve/gtk-icons:912: Unable to locate image file 
in pixmap_path: "16x16/actions/bookmarks-organize.png"
/usr/home/afalanga/.config/qtcurve/gtk-icons:913: Unable to locate image file 
in pixmap_path: "32x32/actions/bookmarks-organize.png"
/usr/home/afalanga/.config/qtcurve/gtk-icons:914: Unable to locate image file 
in pixmap_path: "16x16/actions/bookmarks-organize.png"
Fontconfig warning: "local.conf", line 1093: saw number, expected matrix

gvim actually does start and function correctly.  These errors, though, are 
highly annoying.  Can anyone here help explain to me what is wrong, and more 
importantly, what I must do to correct?

Thanks,
Andy 

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Determine key binding used to call a mapping

2016-09-29 Thread Wiere Neuer
Is there a way to obtain the mapping used to call a function from within that 
function (like with "v:operator")?

E.g. to reduce this

map vax  :call SFunc(0)
map vix  :call SFunc(1)

function SFunc(inner)
   if a:inner
  ...
   endif
endfunction

to something like this:

function SFunc()
   if  == "i" (or "ix")
  ...
   endif
endfunction

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.