Hi Ryan!

On Mi, 02 Okt 2013, Ryan Carney wrote:

> I think I may have found a bug, I have list the steps to reproduce it. 
> 
> 1. open a new buffer :tabe or :e test
> 2. put two single digits on different lines 
> 3. search using the regex '\d' (without quotes)  
> 4. put your cursor before or on the first digit then press gn
> 
> I've tested this on vim 7.4 and 7.3.
> 
> What happens on my end is both numbers, anything (newlins and characters) in 
> between the two numbers are visually selected. 
> 
> What I think should happen is just the first number should be visually 
> selected. 

That should go to vim_dev, since its a bug. This patch fixes it:


diff --git a/src/search.c b/src/search.c
--- a/src/search.c
+++ b/src/search.c
@@ -4680,7 +4680,7 @@
                && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
                && regmatch.startpos[0].col == regmatch.endpos[0].col);
 
-       if (!result && incl(&pos) == 0 && pos.col == regmatch.endpos[0].col)
+       if (!result && inc(&pos) >= 0 && pos.col == regmatch.endpos[0].col)
            result  = TRUE;
     }


Best,
Christian
-- 
Denn niemand ist so alt, daß er nicht glaubte, noch ein Jahr leben zu
können.
                -- Marcus Tullius Cicero (Über das Greisenalter)

-- 
-- 
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/groups/opt_out.

Raspunde prin e-mail lui