Hi cs86661 and Christian,

2015/5/17(Sun) 18:51:36 UTC+9 cs86661:
> Hi all:
> 
> I found one problem when cursor is placed on virtual character, then call 
> 'cnext' will jump to the right line number, but wrong column position?!
> 
> problem commands
> ======
> 'cc'
> 'cnext'
> 'cprevious'
> 
> 'll'
> 'lnext'
> 'lprevious'
> =====

I can reproduce it.

How to reproduce:
- Start Vim on local vim own src dir.
  $ vim -N -u NONE -c "set ve=all" screen.c
- grep "Output" and open quickfix window.
  :vimgrep Output **/*.c | cw
- Jump to fileio.c buffer. cursor on 'O' of 'Output'
  <CR>
- Cursor move to left.
  l
- Exec cc ex-cmd. 
  :cc

Expected behavior:
- Move to cursor to 'O' of 'Output'.

Actual behavior:
- Move to cursor to 'f' of 'Output file'. It is wrong.


I wrote a patch.
Please check this.

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 --git a/src/quickfix.c b/src/quickfix.c
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -1841,6 +1841,9 @@
 	    if (qf_ptr->qf_col > 0)
 	    {
 		curwin->w_cursor.col = qf_ptr->qf_col - 1;
+#ifdef FEAT_VIRTUALEDIT
+		curwin->w_cursor.coladd = 0;
+#endif
 		if (qf_ptr->qf_viscol == TRUE)
 		{
 		    /*
@@ -1876,6 +1879,9 @@
 	    /* Move the cursor to the first line in the buffer */
 	    save_cursor = curwin->w_cursor;
 	    curwin->w_cursor.lnum = 0;
+#ifdef FEAT_VIRTUALEDIT
+	    curwin->w_cursor.coladd = 0;
+#endif
 	    if (!do_search(NULL, '/', qf_ptr->qf_pattern, (long)1,
 							   SEARCH_KEEP, NULL))
 		curwin->w_cursor = save_cursor;

Raspunde prin e-mail lui