On 05:00 Fri 28 Nov     , Matteo Cavalleri wrote:
> > This patch made a big change in how ranges are handled, thus it's
> > possible that it introduced a bug.
> > 
> > Can you reproduce it without any plugins?
> > With a simple user command perhaps?
> 
> create and source this file
> 
> ------------------------
> function! Test(f,l)
>         echom a:f." - ".a:l
> endfunction
> command! -range=% RangeTest call Test(<line1>, <line2>)
> ------------------------
> 
> then select a couple of lines and do:
> 
> :'<,'>RangeTest
> 
> and you can see the error I reported, plus the result is always "1 - 5"

I cannot reproduce it with `vim -u NONE`.  If I select a few lines and
yank them then
:'<,'>RangeTest
always shows the correct range.  I also tested that the :'[,']RangeTest
works fine.

But I think we should apply the attached patch.  Matteo can you please
check if this solves the issue for you.

Best regards,
Marcin

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 4ce9e92..69396ec 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2113,7 +2113,7 @@ do_one_cmd(cmdlinep, sourcing,
  * is equal to the lower.
  */
 
-    if (ea.cmdidx != CMD_SIZE)
+    if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_SIZE)
 	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
     else
 	ea.addr_type = ADDR_LINES;

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui