Bracketed paste for terminal vim

2014-07-11 Fir de Conversatie Bruno Sutic
Hello!

I got really excited about one discovery, so I'd like to start a discussion and 
see if there is a possible fit into vim's feature roadmap.

So, apparently all modern terminals have a feature to tell programs when 
something is pasted.
Terminal does this by wrapping the paste content with sequences \e[200~ and 
\e[201~.

Because of this, terminal programs (specifically vim) *could* tell a difference 
when something is typed vs pasted.
This is nicely explained in the blog article here: 
http://cirw.in/blog/bracketed-paste

And this is not just theory - the same guy wrote a small plugin that enables 
this for vim, link: https://github.com/ConradIrwin/vim-bracketed-paste  (it's 
less than 30 lines of viml)

I tried the plugin and it works great! (I'm on OS X, Terminal.app)
The punch line is: as a terminal vim user, I don't have to use `:set paste` 
ever again!

Now, what do you think: does this feature belong in the plugin domain or 
should it eventually be part of vim?

I'm just a user, so I couldn't help with any of that, but I like the feature so 
much - maybe my enthusiasm will infect someone else! :)

Bruno

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


Re: LUA interface giving me trouble with garbage collection patch

2014-07-11 Fir de Conversatie Yukihiro Nakadaira
On Fri, Jul 11, 2014 at 12:49 AM, Ben Fritz fritzophre...@gmail.com wrote:

 On Wednesday, July 9, 2014 11:24:50 PM UTC-5, Yukihiro Nakadaira wrote:
 
  Here is sample code.
 
  [edited]
 
  L = luaL_newstate();
 
  lua_pushcclosure(L, add, 0);
  lua_pushinteger(L, 111);
  lua_pushinteger(L, 222);
  lua_call(L, 2 /* nargs */, 1 /* nresults */);
  r = lua_tointeger(L, -1);
  lua_pop(L, 1);
  lua_close(L);

 Thanks! I'll give this a try later. What's the -1 for in lua_tointeger()?

 Is there a good way to test this when I'm done? E.g. are there LUA tests
 in Vim's test suite that will exercise the garbage collector? Or maybe a
 toy script using the LUA interface I could run myself?


I have no idea.

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

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


[patch] Taskwarrior syntax file update

2014-07-11 Fir de Conversatie lolilolicon
Patch attached.

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff -uNr a/runtime/filetype.vim b/runtime/filetype.vim
--- a/runtime/filetype.vim	2014-07-11 13:17:50.281190717 +
+++ b/runtime/filetype.vim	2014-07-11 13:27:48.472771369 +
@@ -2137,7 +2137,9 @@
 
  Task
 au BufRead,BufNewFile {pending,completed,undo}.data  setf taskdata
-au BufRead,BufNewFile *.task			setf taskedit
+au BufRead,BufNewFile backlog.data setf javascript
+au BufRead,BufNewFile *.task setf taskedit
+au BufRead,BufNewFile .taskrc setf taskrc
 
  Tcl (JACL too)
 au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl	setf tcl
diff -uNr a/runtime/synmenu.vim b/runtime/synmenu.vim
--- a/runtime/synmenu.vim	2014-07-11 13:18:00.801042654 +
+++ b/runtime/synmenu.vim	2014-07-11 13:26:31.613853133 +
@@ -526,6 +526,7 @@
 an 50.130.150 Syntax.T.Tar\ listing :cal SetSyn(tar)CR
 an 50.130.160 Syntax.T.Task\ data :cal SetSyn(taskdata)CR
 an 50.130.170 Syntax.T.Task\ 42\ edit :cal SetSyn(taskedit)CR
+an 50.130.170 Syntax.T.Task\ RC :cal SetSyn(taskrc)CR
 an 50.130.180 Syntax.T.Tcl/Tk :cal SetSyn(tcl)CR
 an 50.130.190 Syntax.T.TealInfo :cal SetSyn(tli)CR
 an 50.130.200 Syntax.T.Telix\ Salt :cal SetSyn(tsalt)CR
diff -uNr a/runtime/syntax/taskdata.vim b/runtime/syntax/taskdata.vim
--- a/runtime/syntax/taskdata.vim	2014-07-11 13:17:18.001645041 +
+++ b/runtime/syntax/taskdata.vim	2014-07-11 13:51:05.286445013 +
@@ -1,7 +1,8 @@
  Vim syntax file
  Language:	task data
  Maintainer:	John Florian jflor...@doubledog.org
- Updated:	Wed Jul  8 19:46:20 EDT 2009
+ Contributors:	lolilolicon loliloli...@gmail.com
+ Updated:	Fri Jul 11 00:00:00 UTC 2014
 
 
  For version 5.x: Clear all syntax items.
@@ -17,6 +18,7 @@
  Key Names for values.
 syn keyword taskdataKey		description due end entry imask mask parent
 syn keyword taskdataKey		priority project recur start status tags uuid
+syn keyword taskdataKey		modified scheduled until wait
 syn match taskdataKey		annotation_\d\+
 syn match taskdataUndo		^time.*$
 syn match taskdataUndo		^\(old \|new \|---\)
@@ -24,7 +26,7 @@
  Values associated with key names.
 
  Strings
-syn region taskdataString	matchgroup=Normal start=++ end=++
+syn region taskdataString	matchgroup=Normal start=++ skip=+\\+ end=++
 			\	contains=taskdataEncoded,taskdataUUID,@Spell
 
  Special Embedded Characters (e.g., comma;)
diff -uNr a/runtime/syntax/taskedit.vim b/runtime/syntax/taskedit.vim
--- a/runtime/syntax/taskedit.vim	2014-07-11 13:17:27.458178611 +
+++ b/runtime/syntax/taskedit.vim	2014-07-11 13:51:05.289778299 +
@@ -1,7 +1,8 @@
  Vim syntax file
  Language:	support for 'task 42 edit'
  Maintainer:	John Florian jflor...@doubledog.org
- Updated:	Wed Jul  8 19:46:32 EDT 2009
+ Contributors:	lolilolicon loliloli...@gmail.com
+ Updated:	Fri Jul 11 00:00:00 UTC 2014
 
 
  For version 5.x: Clear all syntax items.
@@ -19,18 +20,16 @@
 syn match taskeditReadOnly	^\s*#\s*\(UU\)\?ID:.*$ contained
 syn match taskeditReadOnly	^\s*#\s*Status:.*$ contained
 syn match taskeditReadOnly	^\s*#\s*i\?Mask:.*$ contained
-syn match taskeditKey		^ *.\{-}: nextgroup=taskeditString
-syn match taskeditComment	^\s*#.*$
-			\	contains=taskeditReadOnly,taskeditHeading
-syn match taskeditString	.*$ contained contains=@Spell
-
+syn region taskeditKeyValue	matchgroup=taskeditKey start=^  \S.\{-}: skip=^\s*# end=^  \S.\{-}:me=s-1,he=s-1,re=s-1 contains=taskeditKey,taskeditValue,taskeditComment
+syn match taskeditValue	.*$ contained contains=@Spell
+syn match taskeditComment	^\s*#.*$ contains=taskeditReadOnly,taskeditHeading
 
  The default methods for highlighting.  Can be overridden later.
 hi def link taskeditComment	Comment
 hi def link taskeditHeading	Function
-hi def link taskeditKey		Statement
+hi def link taskeditKey	Statement
 hi def link taskeditReadOnly	Special
-hi def link taskeditString	String
+hi def link taskeditValue	String
 
 let b:current_syntax = taskedit
 
diff -uNr a/runtime/syntax/taskrc.vim b/runtime/syntax/taskrc.vim
--- a/runtime/syntax/taskrc.vim	1970-01-01 00:00:00.0 +
+++ b/runtime/syntax/taskrc.vim	2014-07-11 13:51:05.316444590 +
@@ -0,0 +1,164 @@
+ Vim syntax file
+ Language:	taskrc
+ Maintainer:	John Florian jflor...@doubledog.org
+ Contributors:	lolilolicon loliloli...@gmail.com
+ Updated:	Fri Jul 11 00:00:00 UTC 2014
+
+
+ For version 5.x: Clear all syntax items.
+ For version 6.x: Quit when a syntax file was already loaded.
+if version  600
+  syntax clear
+elseif exists(b:current_syntax)
+  finish
+endif
+let s:keepcpo= cpo
+set cpovim
+
+syn match taskrcVal .\{-}$ 

CursorLine highlight invisible in DiffChanged areas

2014-07-11 Fir de Conversatie Benjamin Fritz
I'm not sure if this ever worked, but I noticed today that with
'cursorline' set, there is no highlight on lines that have DiffChange
highlighting.

Moving the cursor to a line without DiffChange highlighting makes the
cursor visible again.

I think this is a bug; it makes cursorline much less useful in diff mode.

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


Re: Patch 7.4.353

2014-07-11 Fir de Conversatie Christian Brabandt
Hi Bram!

On Do, 10 Jul 2014, Bram Moolenaar wrote:

 I do not really like the idea of two versions of the .ok file.  It's a
 new mechanism and will easily confuse me.  Does testing without utf-8
 have a good purpose?  Then I would prefer to split this up in two
 tests, so that when utf-8 is supported the test is also run without
 utf-8.  If testing without utf-8 isn't really useful I would prefer to
 just skip it.

Okay, here we go, test splitted up into two versions.

Best,
Christian
-- 
Meine Made ist so etwas wie ein Wurm, nur etwas kürzer.
-- Heinz Erhard

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -39,6 +39,7 @@ SCRIPTS = test1.out test3.out test4.out 
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_listlbr.out \
+		test_listlbr_utf8.out \
 		test_eval.out \
 		test_options.out
 
@@ -167,5 +168,6 @@ test107.out: test107.in
 test_autoformat_join.out: test_autoformat_join.in
 test_breakindent.out: test_breakindent.in
 test_listlbr.out: test_listlbr.in
+test_listlbr_utf8.out: test_listlbr_utf8.in
 test_eval.out: test_eval.in
 test_options.out: test_options.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -38,6 +38,7 @@ SCRIPTS =	test3.out test4.out test5.out 
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_listlbr \
+		test_listlbr_utf8.out \
 		test_eval.out \
 		test_options.out
 
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -58,6 +58,7 @@ SCRIPTS =	test3.out test4.out test5.out 
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_listlbr.out \
+		test_listlbr_utf8.out \
 		test_eval.out \
 		test_options.out
 
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test3.out test4.out 
 		test_autoformat_join.out \
 		test_eval.out \
 		test_breakindent.out \
+		test_listlbr_utf8.out \
 		test_listlbr.out \
 		test_options.out
 
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -99,6 +99,7 @@ SCRIPT = test1.out  test2.out  test3.out
 	 test_autoformat_join.out \
 	 test_breakindent.out \
 	 test_listlbr.out \
+	 test_listlbr_utf8.out \
 	 test_eval.out \
 	 test_options.out
 
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -36,6 +36,7 @@ SCRIPTS = test1.out test2.out test3.out 
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_listlbr.out \
+		test_listlbr_utf8.out \
 		test_eval.out \
 		test_options.out
 
diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -1,10 +1,10 @@
-Test for linebreak and list option
+Test for linebreak and list option (non-utf8)
 
 STARTTEST
 :so small.vim
 :if !exists(+linebreak) | e! test.ok | w! test.out | qa! | endif
 :10new|:vsp|:vert resize 20
-:put =\\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \
+:put =\\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \
 :norm! zt
 :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
 :fu! ScreenChar(width)
@@ -32,22 +32,12 @@ STARTTEST
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
-:let g:test =Test 3: set linebreak + set list + fancy listchars
-:exe set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6
-:redraw!
-:let line=ScreenChar(winwidth(0))
-:call DoRecordScreen()
-:let g:test =Test 4: set linebreak nolist
+:let g:test =Test 3: set linebreak nolist
 :set nolist linebreak
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
-:let g:test =Test 5: set nolinebreak list
-:set list nolinebreak
-:redraw!
-:let line=ScreenChar(winwidth(0))
-:call DoRecordScreen()
-:let g:test =Test 6: set linebreak with tab and 1 line as long as screen: should break!
+:let g:test =Test 4: set linebreak with tab and 1 line as long as screen: should break!
 :set nolist linebreak ts=8
 :let line=1\t.repeat('a', winwidth(0)-2)
 :$put =line
diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok
--- a/src/testdir/test_listlbr.ok
+++ b/src/testdir/test_listlbr.ok
@@ -1,38 +1,26 @@
 
-	abcdef hijklmn	pqrstuvwxyz 1060ABCDEFGHIJKLMNOP 
+	abcdef 

Re: Bracketed paste for terminal vim

2014-07-11 Fir de Conversatie Bram Moolenaar

Bruno Sutic wrote:

 I got really excited about one discovery, so I'd like to start a
 discussion and see if there is a possible fit into vim's feature
 roadmap.
 
 So, apparently all modern terminals have a feature to tell programs
 when something is pasted.
 Terminal does this by wrapping the paste content with sequences
 \e[200~ and \e[201~.
 
 Because of this, terminal programs (specifically vim) *could* tell a
 difference when something is typed vs pasted.  This is nicely
 explained in the blog article here:
 http://cirw.in/blog/bracketed-paste
 
 And this is not just theory - the same guy wrote a small plugin that
 enables this for vim, link:
 https://github.com/ConradIrwin/vim-bracketed-paste  (it's less than 30
 lines of viml)
 
 I tried the plugin and it works great! (I'm on OS X, Terminal.app)
 The punch line is: as a terminal vim user, I don't have to use `:set
 paste` ever again!
 
 Now, what do you think: does this feature belong in the plugin
 domain or should it eventually be part of vim?
 
 I'm just a user, so I couldn't help with any of that, but I like the
 feature so much - maybe my enthusiasm will infect someone else! :)

Sounds useful.

Since what version of xterm and screen is this supported?  I suspect
older versions do not support it.

-- 
BEDEVERE: Look!  It's the old man from scene 24 - what's he Doing here?
ARTHUR:   He is the keeper of the Bridge.  He asks each traveler five
  questions ...
GALAHAD:  Three questions.
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

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


Re: Bracketed paste for terminal vim

2014-07-11 Fir de Conversatie Bruno Sutic
On Friday, July 11, 2014 11:35:24 PM UTC+2, Bram Moolenaar wrote:
 Bruno Sutic wrote:
 
 
 
  I got really excited about one discovery, so I'd like to start a
 
  discussion and see if there is a possible fit into vim's feature
 
  roadmap.
 
  
 
  So, apparently all modern terminals have a feature to tell programs
 
  when something is pasted.
 
  Terminal does this by wrapping the paste content with sequences
 
  \e[200~ and \e[201~.
 
  
 
  Because of this, terminal programs (specifically vim) *could* tell a
 
  difference when something is typed vs pasted.  This is nicely
 
  explained in the blog article here:
 
  http://cirw.in/blog/bracketed-paste
 
  
 
  And this is not just theory - the same guy wrote a small plugin that
 
  enables this for vim, link:
 
  https://github.com/ConradIrwin/vim-bracketed-paste  (it's less than 30
 
  lines of viml)
 
  
 
  I tried the plugin and it works great! (I'm on OS X, Terminal.app)
 
  The punch line is: as a terminal vim user, I don't have to use `:set
 
  paste` ever again!
 
  
 
  Now, what do you think: does this feature belong in the plugin
 
  domain or should it eventually be part of vim?
 
  
 
  I'm just a user, so I couldn't help with any of that, but I like the
 
  feature so much - maybe my enthusiasm will infect someone else! :)
 
 
 
 Sounds useful.
 
 
 
 Since what version of xterm and screen is this supported?  I suspect
 
 older versions do not support it.
 
 
 
 -- 
 
 BEDEVERE: Look!  It's the old man from scene 24 - what's he Doing here?
 
 ARTHUR:   He is the keeper of the Bridge.  He asks each traveler five
 
   questions ...
 
 GALAHAD:  Three questions.
 
  Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD
 
 
 
  /// 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///

Hi Bram,
glad you think it's useful.

So I just googled it:
it turns out this is available in xterm for years. Here's the blog post from 
2009 showing how to make it work with vim and xterm:
http://help.lockergnome.com/linux/Bug-504244-Vim-script-turn-xterm-bracketed-paste-mode--ftopict511918.html
I found other online resources mentioning this in 2010, 2011. But the above 
link is the earliest.

About screen - here's the patch from March 2013, so I guess it's been added 
there just recently:
https://lists.gnu.org/archive/html/screen-devel/2013-03/msg0.html

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


Re: Patch 7.4.362

2014-07-11 Fir de Conversatie Akio Ito
On Thursday, July 10, 2014 6:56:32 PM UTC+9, Bram Moolenaar wrote:
 Hmm, I would not expect any slow down because of this patch.  Are you
 sure it's not something else?  Ideally you would reverse this specific
 patch and check if the excessive CPU still happens.

Bram, apologies for sending private message by mistake.

Scroll text like a crazy with trackpad (iMac with 4 Cores)
Patched   version: aprox. max 70% CPU usage
Unpatched version: aprox. max 35% CPU usage

I find a reasonable work around for sluggishness in normal scrolling changing 
my .vimrc: 
 let g:syntax = '???'
 let g:currentTag = '???'
 autocmd CursorHold * let g:syntax = SyntaxItem()
 autocmd CursorHold * let g:currentTag = tagbar#currenttag('%s','','s')
 
---
  
271c266
 set statusline+=%3*\ %{g:currentTag}\ 
---
 set statusline+=%3*\ %{tagbar#currenttag('%s','','s')}\ 
273c268
 set statusline+=%5*\ %=%{g:syntax}
---
 set statusline+=%5*\ %=%{SyntaxItem()}

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


[patch] matchparen: Fix detection of special syntax groups

2014-07-11 Fir de Conversatie James McCoy
MatchParen uses knowledge of how the character under the cursor is
highlighted to help guide its matching.  However, it is only looking at
the top-most item in the syntax stack, which may not match the patterns
being checked.

The behavior of matchparen in the following zsh script demonstrates the
problem.

  $ cat foo.zsh
  #! /bin/zsh
  Data_Path_Saved=${HOME}/some/valid/path/
  SavedFilesList=(${(f@)$(ls ${Data_Path_Saved}**/*(.))})
  print Found ${#SavedFilesList} files.

In this case, the problematic line is

  SavedFilesList=(${(f@)$(ls ${Data_Path_Saved}**/*(.))})
 //\
  cursorexpected  actual
 match match

The syntax of the ) to the left of the expected match is zshString.
This causes searchpairpos() to skip over it when trying to match the (
under the cursor because it isn't also a string syntax item.  However,
the entire syntax stack for the cursor's position is ['zshParentheses',
'zshString', 'zshSubst', 'zshSubst', 'zshSubstDelim'].

The attached patch changes matchparen to check the whole syntax stack.
I also added some more comments about exactly how this part works
because it took me a few reads to grok what was going on.  Hopefully the
comments make it a little clearer for the next reader.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy james...@jamessan.com

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim
--- a/runtime/plugin/matchparen.vim
+++ b/runtime/plugin/matchparen.vim
@@ -92,10 +92,17 @@
 call cursor(c_lnum, c_col - before)
   endif
 
-   When not in a string or comment ignore matches inside them.
+   Build an expression that detects whether the current cursor position is in
+   certain syntax types (string, comment, etc.), for use as searchpairpos()'s
+   skip argument.
We match escape for special items, such as lispEscapeSpecial.
-  let s_skip ='synIDattr(synID(line(.), col(.), 0), name) ' .
-	\ '=~?  string\\|character\\|singlequote\\|escape\\|comment'
+  let s_skip = '!empty(filter(map(synstack(line(.), col(.)), ''synIDattr(v:val, name)''), ' .
+	\ '''v:val =~? string\\|character\\|singlequote\\|escape\\|comment''))'
+   If executing the expression determines that the cursor is currently in
+   one of the syntax types, then we want searchpairpos() to find the pair
+   within those syntax types (i.e., not skip).  Otherwise, the cursor is
+   outside of the syntax types and s_skip should keep its value so we skip any
+   matching pair inside the syntax types.
   execute 'if' s_skip '| let s_skip = 0 | endif'
 
Limit the search to lines visible in the window.


Re: Bug: bad interaction between ui and preview window for omnifunc with extra info

2014-07-11 Fir de Conversatie Carlos Pita
What do you think about supressing events in the specific way I described 
above? Is it possible without a lot of work? Could it be problematic for some 
reasonable use case? 

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