Hi Nazri!

On Sa, 15 Nov 2014, Nazri Ramliy wrote:

> Hi,
> 
> :ver
> VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 15 2014 11:30:19)
> Included patches: 1-516
> 
> Attached zip file (bug.zip) contains two files - bug.vim and a.txt.
> 
> Run vim like this to see the bug (I'm running vim in an 120x65 terminal):
> 
> $ echo $COLUMNS $LINES
> 10 65
> $ vim -u bug.vim a.txt
> 
> Vim opens and the cursor is at column 1, row 1 on the word "needle" in
> the file a.txt.
> Now hit "*" to jump to the next occurrence of the word "needle" and
> notice that the cursor
> is not exactly where the word is - it's on line 101 instead of line
> 105 where it should be.
> 
> $ cat bug.vim
> set nocp
> set breakindent
> set linebreak
> set nu
> " Setting rnu also triggers the bug
> 
> The bug does not seem to be triggered if any  one of the options above
> is commented out.

Can you check, if this patch works for you?

diff --git a/src/screen.c b/src/screen.c
--- a/src/screen.c
+++ b/src/screen.c
@@ -4456,6 +4456,9 @@ win_line(wp, lnum, startrow, endrow, noc
                    /* TODO: is passing p for start of the line OK? */
                    n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
                                                                    NULL) - 1;
+                   if (c == TAB && n_extra + col > W_WIDTH(wp))
+                       n_extra = (int)wp->w_buffer->b_p_ts
+                                       - vcol % (int)wp->w_buffer->b_p_ts - 1;
                    c_extra = ' ';
                    if (vim_iswhite(c))
                    {


This seems to fix the problem for me. If this works also ok for you, 
I'll try to come up with a test case. The win_line function is ugly and 
too complex, it is hard to prevent introducing new bugs when messing 
with that.

Mit freundlichen Grüßen
Christian
-- 
Der liebe Gott hat das Gras nicht wachsen lassen, damit man in
dasselbe beißt.
                -- Heinz Erhardt

-- 
-- 
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.

Raspunde prin e-mail lui