Hi Bram and list,

How to reproduce:
1. start Vim on linux.
  $ vim -N -u NONE

2. Input below.
  $
  :echo getcurpos()

Expected behavior:
  Display below at command line.
  [0, 1, 1, 0, 2147483647]

Actual behavior:
  Display this.
  [0, 1, 1, 0, -2147483648]


The 5th item "curswant" is not MAXCOL(2147483647).
(2147483647 is in case of sizeof(int)>=4 system)

I wrote a patch.
Please include this.

Thank you.

Best regards,
Hirohito Higashi (a.k.a h_east)

-- 
-- 
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 -r 8cae3b61ce9e src/eval.c
--- a/src/eval.c	Mon Dec 08 04:16:45 2014 +0100
+++ b/src/eval.c	Mon Dec 08 23:23:22 2014 +0900
@@ -11937,7 +11937,8 @@
 #endif
 							      (varnumber_T)0);
 	if (getcurpos)
-	    list_append_number(l, (varnumber_T)curwin->w_curswant + 1);
+	    list_append_number(l, (curwin->w_curswant == MAXCOL) ?
+		    (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1);
     }
     else
 	rettv->vval.v_number = FALSE;

Raspunde prin e-mail lui