undo: :earlier, g-: Set b_u_seq_cur correctly. (#6016)

Previously alternate branches were not accounted for properly, with this
change g- after an undo to a branch point works.

The current sequence number b_u_seq_cur is used in undo_time(), in
u_doit() this was calculated by subtracting one from the curhead
sequence number.

The curhead header entry represents the change that was just undone, so
the sequence number we want is that of the change we have moved to. This
is the sequence number of the undo head that is the uh_next element of
this curhead. That sequence number is not always one less than the
curhead sequence number -- there may have been an alternate branch at
this point.

Instead of subtracting one, we now directly find the sequence number of
curhead->uh_next.
This commit is contained in:
Matthew Malcomson
2017-01-26 10:41:05 +00:00
committed by Justin M. Keyes
parent 39a6f835e7
commit d25649fa01
4 changed files with 75 additions and 6 deletions

View File

@@ -195,7 +195,7 @@ local function dedent(str)
indent = line_indent
end
end
if #indent == 0 then
if indent == nil or #indent == 0 then
-- no minimum common indent
return str
end