Fix: ml_get errors when using undo with 'virtualedit'.
This commit is contained in:
@ -2591,6 +2591,8 @@ u_undoredo(undo)
|
||||
if (curhead->uh_cursor.lnum + 1 == curwin->w_cursor.lnum
|
||||
&& curwin->w_cursor.lnum > 1)
|
||||
--curwin->w_cursor.lnum;
|
||||
if (curwin->w_cursor.lnum <= curbuf->b_ml.ml_line_count)
|
||||
{
|
||||
if (curhead->uh_cursor.lnum == curwin->w_cursor.lnum)
|
||||
{
|
||||
curwin->w_cursor.col = curhead->uh_cursor.col;
|
||||
@ -2601,8 +2603,9 @@ u_undoredo(undo)
|
||||
curwin->w_cursor.coladd = 0;
|
||||
#endif
|
||||
}
|
||||
else if (curwin->w_cursor.lnum <= curbuf->b_ml.ml_line_count)
|
||||
else
|
||||
beginline(BL_SOL | BL_FIX);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We get here with the current cursor line being past the end (eg
|
||||
|
||||
Reference in New Issue
Block a user