aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/textadept/history.lua2
-rw-r--r--test/test.lua12
2 files changed, 13 insertions, 1 deletions
diff --git a/modules/textadept/history.lua b/modules/textadept/history.lua
index d619363f..db23c4a4 100644
--- a/modules/textadept/history.lua
+++ b/modules/textadept/history.lua
@@ -83,7 +83,7 @@ function M.back()
if #history == 0 then return end -- nothing to do
local record = history[history.pos]
local line = buffer:line_from_position(buffer.current_pos)
- if buffer.filename ~= record.filename or
+ if buffer.filename ~= record.filename and buffer._type ~= record.filename or
math.abs(record.line - line) > M.minimum_line_distance then
-- When navigated away from the most recent record, and if that record is
-- not a soft record, jump back to it first, then navigate backwards.
diff --git a/test/test.lua b/test/test.lua
index 91365563..14811e65 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -2847,6 +2847,18 @@ function test_history_per_view()
buffer:close(true)
end
+function test_history_print_buffer()
+ local tabs = ui.tabs
+ ui.tabs = true
+ ui.print('hi')
+ textadept.history.back()
+ assert(buffer._type ~= _L['[Message Buffer]'])
+ textadept.history.forward()
+ assert_equal(buffer._type, _L['[Message Buffer]'])
+ buffer:close()
+ ui.tabs = tabs -- restore
+end
+
function test_macro_record_play_save_load()
textadept.macros.save() -- should not do anything
textadept.macros.play() -- should not do anything