File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1175,6 +1175,9 @@ curs_columns(
11751175 redraw_later (SOME_VALID );
11761176#endif
11771177
1178+ // now w_leftcol is valid, avoid check_cursor_moved() thinking otherwise
1179+ curwin -> w_valid_leftcol = curwin -> w_leftcol ;
1180+
11781181 curwin -> w_valid |= VALID_WCOL |VALID_WROW |VALID_VIRTCOL ;
11791182}
11801183
Original file line number Diff line number Diff line change @@ -316,3 +316,31 @@ func Test_cursor_column_in_concealed_line_after_window_scroll()
316316 call StopVimInTerminal (buf )
317317 call delete (' Xcolesearch' )
318318endfunc
319+
320+ func Test_cursor_column_in_concealed_line_after_leftcol_change ()
321+ CheckRunVimInTerminal
322+
323+ " Test for issue #5214 fix.
324+ let lines = << trim END
325+ 0 put = ' ab' .. repeat (' -' , &columns ) .. ' c'
326+ call matchadd (' Conceal' , ' -' )
327+ set nowrap ss = 0 cole = 3 cocu = n
328+ END
329+ call writefile (lines , ' Xcurs-columns' )
330+ let buf = RunVimInTerminal (' -S Xcurs-columns' , {})
331+
332+ " Go to the end of the line (3 columns beyond the end of the screen).
333+ " Horizontal scroll would center the cursor in the screen line, but conceal
334+ " makes it go to screen column 1.
335+ call term_sendkeys (buf , " $" )
336+ call term_wait (buf )
337+
338+ " Are the concealed parts of the current line really hidden?
339+ call assert_equal (' c' , term_getline (buf , ' .' ))
340+
341+ " BugFix check: Is the window's cursor column properly updated for conceal?
342+ call assert_equal (1 , term_getcursor (buf )[1 ])
343+
344+ call StopVimInTerminal (buf )
345+ call delete (' Xcurs-columns' )
346+ endfunc
Original file line number Diff line number Diff line change @@ -741,6 +741,8 @@ static char *(features[]) =
741741
742742static int included_patches [] =
743743{ /* Add new patch number below this line */
744+ /**/
745+ 2303 ,
744746/**/
745747 2302 ,
746748/**/
You can’t perform that action at this time.
0 commit comments