Looks like a breakindent bug, but also isn't ;)
you can also trigger the bug in a 80 column terminal with something like
this:
:let &sbr=repeat('>', 49)
Here is a patch:
diff --git a/src/normal.c b/src/normal.c
--- a/src/normal.c
+++ b/src/normal.c
@@ -4515,7 +4515,8 @@ nv_screengo(oap, dir, dist)
* screenline or move two screenlines.
*/
validate_virtcol();
- if (curwin->w_virtcol > curwin->w_curswant
+ if ((curwin->w_virtcol - (*p_sbr != NUL ? vim_strsize(p_sbr) : 0))
+ > curwin->w_curswant
&& (curwin->w_curswant < (colnr_T)width1
? (curwin->w_curswant > (colnr_T)width1 / 2)
: ((curwin->w_curswant - width1) % width2
I have to admit, I do not understand the comment right above it:
,----
| * Check for landing on a character that got split at the end of the
| * last line. We want to advance a screenline, not end up in the same
| * screenline or move two screenlines.
| */
`----
I am not sure, what kind of characters can be split at the end of a line
(screen line I guess)?
BTW: I just noticed, there is a similar bug in gj/gk and listmode
In this window:
,----------------------------------------
| 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
| --bbb
`----------------------------------------
And the cursor on the second a of line 1, pressing gj will move the
cursor the <Tab> at the last screen column in that window.
(To reproduce, in a 75 column terminal: vim -u NONE -N -c 'call
setline(1, repeat("a",73)."\tBBB")' -c ':set list listchars=tab:>-' -c
':norm! gj'
Ah, I just noticed this happens, because when listmode is off, the
cursor is always displayed at the end of a tab char, while when list
mode is on and there is a 'tab:' lcs-setting, the cursor will always be
drawn at the start of the tab. I didn't know that, so this should at
least be documented.
Best,
Christian
--
Man errät die Menschen am besten, wenn man sie bei Erzählungen um ihre
Vermutungen der unerzählten Zukunft fragt.
-- Jean Paul