aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-01-26 10:41:05 +0000
committerJustin M. Keyes <justinkz@gmail.com>2017-01-31 05:46:55 +0100
commitd25649fa012013b9ee5b048c8272db4dd50191d6 (patch)
treee41f2cfe20b1f50668e5bd36a802411eb2742399 /test/functional/helpers.lua
parent39a6f835e779af56ade69e9eb1b4a1981e7032cd (diff)
downloadrneovim-d25649fa012013b9ee5b048c8272db4dd50191d6.tar.gz
rneovim-d25649fa012013b9ee5b048c8272db4dd50191d6.tar.bz2
rneovim-d25649fa012013b9ee5b048c8272db4dd50191d6.zip
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.
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 7de1d0f2c6..880cb6546c 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -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