Bram Moolenaar | 23 Nov 15:58 2014
Picon
Picon

Patch 7.4.527


Patch 7.4.527
Problem:    Still confusing regexp failure and NFA_TOO_EXPENSIVE.
Solution:   NFA changes equivalent of 7.4.526.
Files:	    src/regexp_nfa.c

*** ../vim-7.4.526/src/regexp_nfa.c	2014-11-05 14:26:30.764758363 +0100
--- src/regexp_nfa.c	2014-11-23 15:50:57.980625347 +0100
***************
*** 6767,6773 ****

  /*
   * Try match of "prog" with at regline["col"].
!  * Returns 0 for failure, number of lines contained in the match otherwise.
   */
      static long
  nfa_regtry(prog, col)
--- 6767,6773 ----

  /*
   * Try match of "prog" with at regline["col"].
!  * Returns <= 0 for failure, number of lines contained in the match otherwise.
   */
      static long
  nfa_regtry(prog, col)
***************
*** 6897,6903 ****
   * Match a regexp against a string ("line" points to the string) or multiple
   * lines ("line" is NULL, use reg_getline()).
   *
(Continue reading)

Michael Henry | 23 Nov 13:50 2014

Minor getpos() documentation patch

Here is a small patch to the getpos() documentation.

diff -r 8bb4ca7fba40 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt      Wed Oct 22 22:09:01 2014 +0200
+++ b/runtime/doc/eval.txt      Sun Nov 23 07:48:21 2014 -0500
 <at>  <at>  -3514,7 +3514,7  <at>  <at> 
                This can be used to save and restore the position of a
mark: >
                        let save_a_mark = getpos("'a")
                        ...
-                       call setpos(''a', save_a_mark
+                       call setpos("'a", save_a_mark
 <              Also see |getcurpos()| and |setpos()|.

Michael Henry

-- 
--

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

Elias Diem | 23 Nov 10:26 2014
Picon

[comment patch] Tiny typo

Hi there

A tiny typo in os_unix.c. See attached patch.

-- 
Greetings
Elias

-- 
-- 
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff -r 03a813f2cf51 src/os_unix.c
--- a/src/os_unix.c	Thu Nov 20 23:07:05 2014 +0100
+++ b/src/os_unix.c	Sun Nov 23 10:25:08 2014 +0100
 <at>  <at>  -1609,7 +1609,7  <at>  <at> 
 /*
  * If the X11 connection was lost try to restore it.
  * Helps when the X11 server was stopped and restarted while Vim was inactive
- * (e.g. though tmux).
+ * (e.g. through tmux).
  */
(Continue reading)

vim | 23 Nov 00:27 2014

Issue 286 in vim: Please add breakindent to the vim.vim syntax file

Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 286 by sanja... <at> gmail.com: Please add breakindent to the vim.vim  
syntax file
https://code.google.com/p/vim/issues/detail?id=286

What steps will reproduce the problem?
1. Put 'set breakindent' in your .vimrc
2. Observe that the word 'breakindent' is not properly syntax highlighted
3.

What is the expected output? What do you see instead?
The word 'breakindent' should be properly syntax highlighted.

What version of the product are you using? On what operating system?
I'm using 7.4.383 of MacVim on OS X 10.9.5.

Please provide any additional information below.
Please add the keyword 'breakindent' to the vim.vim syntax file.

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

-- 
--

-- 
(Continue reading)

ZyX | 22 Nov 18:55 2014
Picon

[RFC] Remove e_invarg, e_invarg2 and e_invexpr2

While working on VimL parser I have seen *very* large number of these cryptic error messages. I.e. consider
the following line:

    sort no/some long regex/

. This will give you `E474: Invalid argument` with no further explanation or an exact position where error
is located. I.e. it is indicating that you have a error somewhere, but where? Maybe it is an error in regex
(one needs to know that Vim is written in a way that regexes never throw E474 to say this is false), maybe one
should not have omitted space or whatever. One needs to read documentation thoroughly to determine what
is wrong, but even this does not always help: I cannot find any information about the fact that `n`, `o` and
`x` cannot be used together anywhere in `:sort` documentation.

In my parser I change all of these errors to something like “E474: Can only specify one kind of numeric
sort” (and always assigning a position, but this part cannot be changed so easily), never using
“E47(4|5): Invalid argument” or “E15: Invalid expression”.

More or less full list of such changes to these messages (and not only to messages, but this is irrelevant) is
located at https://gist.github.com//4af839e000e7eada347d (it is supposed to be full, but I started
writing it some time after I started writing the parser). I am posting this message to vim-dev to hear Bram
opinion about this and also as a notification in case somebody will want to port these changes.

Note: in order not to break backwards compatibility all new messages look like “E474: …”, no new
number is assigned. Since the following message text is supposed to be localized and theoretically is a
subject to typo corrections it must not be relied on and changing it is not going to break compatibility.

-- 
--

-- 
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
(Continue reading)

lilydjwg | 22 Nov 18:24 2014
Picon

crash with regex

Starting with 7.4.497 (found by git bisect), I get the following crash:

1. put the attached files in current directory
2. run vim -u vimrc --noplugin
3. vim crashes, backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5141434 in __memmove_ssse3_back () from /usr/lib/libc.so.6
(gdb) bt
#0  0x00007ffff5141434 in __memmove_ssse3_back () from /usr/lib/libc.so.6
#1  0x0000000000475203 in memmove (__len=18446744073700127088, __src=0x8f9790, __dest=<optimized
out>) at /usr/include/bits/string3.h:57
#2  do_string_sub (
    str=str <at> entry=0x8f9790 "contained role oncontextmenu onchange onmousewheel onselect onsubmit
onkeydown onloadeddata contextmenu ondragenter onvolumechange\n", ' ' <repeats 19 times>,
"contained onemptied onended onmousedown onseeking "..., 
    pat=pat <at> entry=0x8b5080 "\\%(\\<match
\\/[^/]\\{-}\\)\\ <at> <=\\<\\w\\{1,2}\\>\\ze.\\{-}\\\\\\ <at> <!\\/\\%(\\%(ms\\|me\\|hs\\|he\\|rs\\|re\\|lc\\)\\S\\+\\)\\?\\s\\+",
sub=sub <at> entry=0x8b21d0 "", flags=<optimized out>) at eval.c:25145
#3  0x00000000004753f6 in f_substitute (argvars=0x7fffffffc8d0, rettv=0x7fffffffcdc0) at eval.c:18357
#4  0x0000000000468880 in call_func (funcname=0x10 <error: Cannot access memory at address 0x10>, 
    funcname <at> entry=0x8b4c01 "substitute( syn_list, '\\%(\\<match
\\/[^/]\\{-}\\)\\ <at> <=\\<\\w\\{1,2}\\>\\ze.\\{-}\\\\\\ <at> <!\\/\\%(\\%(ms\\|me\\|hs\\|he\\|rs\\|re\\|lc\\)\\S\\+\\)\\?\\s\\+',
'', 'g' )", len=9410464, len <at> entry=10, rettv=0x1, argcount=0, argcount <at> entry=4, argvars=0x0, 
    argvars <at> entry=0x7fffffffc8d0, firstline=72057594028466577, firstline <at> entry=1, lastline=1,
doesrange=0x7fffffffcaa8, evaluate=1, selfdict=0x0)
    at eval.c:8626
#5  0x000000000046c813 in get_func_tv (
    name=0x8b4c01 "substitute( syn_list, '\\%(\\<match
\\/[^/]\\{-}\\)\\ <at> <=\\<\\w\\{1,2}\\>\\ze.\\{-}\\\\\\ <at> <!\\/\\%(\\%(ms\\|me\\|hs\\|he\\|rs\\|re\\|lc\\)\\S\\+\\)\\?\\s\\+',
(Continue reading)

Gary Johnson | 22 Nov 09:13 2014

vimdiff screen not redrawn properly when using 'diffexpr'

I noticed recently when using vimdiff and a 'diffexpr' that the
screen is no longer redrawn properly after certain commands such as
:diffu.  Sometimes the screen is left completely blank; at other
times only a few scattered characters are redrawn.  Typing Ctrl-L
fixes the display.

This can be demonstrated as follows.  Create a vimrc file with these
contents.

---------------------------- vimrc.test ----------------------------
set diffexpr=MyDiff()

function MyDiff()
    silent execute "!diff" v:fname_in v:fname_new ">" v:fname_out
endfunction
--------------------------------------------------------------------

The MyDiff() function was copied from ":help diff-diffexpr" and
simplified.  (I normally use a MyDiff() function that differs
slightly from the example.)

Then execute this command, where file1 and file2 are two text files.
Their contents don't matter.

    vimdiff -N -u vimrc.test --noplugin file1 file2

Then execute

    :diffu

(Continue reading)

Bram Moolenaar | 20 Nov 23:07 2014
Picon
Picon

Patch 7.4.526


Patch 7.4.526
Problem:    matchstr() fails on long text. Daniel Hahler)
Solution:   Return NFA_TOO_EXPENSIVE from regexec_nl(). (Christian Brabandt)
Files:	    src/regexp.c, src/regexec_nfa.c

*** ../vim-7.4.525/src/regexp.c	2014-11-19 16:38:01.508680012 +0100
--- src/regexp.c	2014-11-20 22:59:03.865027911 +0100
***************
*** 3739,3745 ****
   * Uses curbuf for line count and 'iskeyword'.
   * if "line_lbr" is TRUE  consider a "\n" in "line" to be a line break.
   *
!  * Return TRUE if there is a match, FALSE if not.
   */
      static int
  bt_regexec_nl(rmp, line, col, line_lbr)
--- 3739,3745 ----
   * Uses curbuf for line count and 'iskeyword'.
   * if "line_lbr" is TRUE  consider a "\n" in "line" to be a line break.
   *
!  * Returns 0 for failure, number of lines contained in the match otherwise.
   */
      static int
  bt_regexec_nl(rmp, line, col, line_lbr)
***************
*** 3759,3765 ****
      ireg_icombine = FALSE;
  #endif
      ireg_maxcol = 0;
(Continue reading)

Elias Diem | 20 Nov 18:26 2014
Picon

[patch] Indent correctly

Hi there

Here's a small patch to correctly indent macro code.

-- 
Greetings
Elias

-- 
-- 
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff -r bbfaabde42b6 src/gui.h
--- a/src/gui.h	Wed Nov 19 20:04:48 2014 +0100
+++ b/src/gui.h	Thu Nov 20 18:25:11 2014 +0100
 <at>  <at>  -41,7 +41,7  <at>  <at> 
 # include <Events.h>
 # include <Menus.h>
 # if !(defined (TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
-#   include <Windows.h>
+#  include <Windows.h>
 # endif
(Continue reading)

Daniel Hahler | 20 Nov 15:03 2014
Picon

Unsilently sourcing a file, but ignore E122, E174, E227 etc

Is it possible to source a file (without using `:silent!`), but ignore any of the following errors:

  - E122: Function Foo already exists, add ! to replace it
  - E174: Command already exists: add ! to replace it
  - E227: mapping already exists for ...

Using "silent!" also suppresses any output.

I've tried to remove the "silent!" by using a try/catch block, but that aborts the sourcing -
https://github.com/Shougo/neobundle.vim/pull/342/files (the revert).

`:source!` (with a bang) has a different meaning already, and it would be nice to use an already existing mechanism.

-- 
--

-- 
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniel Hahler | 20 Nov 00:40 2014
Picon

Segfault with surround.vim on long lines (450 chars), via matchstr()

When using `yss<p` (from vim-surround, used to surround the current line) on a
long line (~450 chars), Vim segfaults:

#0  0x00007f7067041ea7 in kill () at ../sysdeps/unix/syscall-template.S:81
#1  0x0000000000563a98 in may_core_dump () at os_unix.c:3376
#2  0x0000000000563a3c in mch_exit (r=1) at os_unix.c:3342
#3  0x000000000064bacd in getout (exitval=1) at main.c:1521
#4  0x000000000051ebe1 in preserve_exit () at misc1.c:9405
#5  0x0000000000561a01 in deathtrap (sigarg=11) at os_unix.c:1121
#6  <signal handler called>
#7  __strncpy_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:296
#8  0x00000000005227b4 in vim_strnsave (string=0x0, len=1732028256) at misc2.c:1268
#9  0x00000000004816cf in find_some_match (argvars=0x7fff7bd98bd0, rettv=0x7fff7bd99250, type=2)
at eval.c:14349
#10 0x0000000000481c42 in f_matchstr (argvars=0x7fff7bd98bd0, rettv=0x7fff7bd99250) at eval.c:14549
#11 0x0000000000478eac in call_func (funcname=0x262ea21 "matchstr(keeper,'\\_s\\ <at> <!\\s*$')",
len=8, rettv=0x7fff7bd99250, argcount=2, argvars=0x7fff7bd98bd0, 
    firstline=255, lastline=255, doesrange=0x7fff7bd98d64, evaluate=1, selfdict=0x0) at eval.c:8626
#12 0x00000000004788e4 in get_func_tv (name=0x262ea21 "matchstr(keeper,'\\_s\\ <at> <!\\s*$')",
len=8, rettv=0x7fff7bd99250, arg=0x7fff7bd991f8, firstline=255, 
    lastline=255, doesrange=0x7fff7bd98d64, evaluate=1, selfdict=0x0) at eval.c:8433
#13 0x0000000000474082 in eval7 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1,
want_string=0) at eval.c:5210
#14 0x0000000000473932 in eval6 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1,
want_string=0) at eval.c:4861
#15 0x0000000000473466 in eval5 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4677
#16 0x000000000047277a in eval4 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4370
#17 0x00000000004725bd in eval3 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4282
#18 0x000000000047243c in eval2 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4211
#19 0x000000000047227b in eval1 (arg=0x7fff7bd991f8, rettv=0x7fff7bd99250, evaluate=1) at eval.c:4136
(Continue reading)


Gmane