aboutsummaryrefslogtreecommitdiff
path: root/test/test.lua
diff options
context:
space:
mode:
authormitchell <70453897+orbitalquark@users.noreply.github.com>2021-01-24 10:56:02 -0500
committermitchell <70453897+orbitalquark@users.noreply.github.com>2021-01-24 10:56:02 -0500
commit0ef954ca2030ada323dacf35c41c2d17d3d9731e (patch)
treea0c963d9a5b5c7e42d0414308c39dc9e417d4390 /test/test.lua
parenteec43aaccb3222c838091ac4eb8f8780d921d4cc (diff)
downloadtextadept-0ef954ca2030ada323dacf35c41c2d17d3d9731e.tar.gz
textadept-0ef954ca2030ada323dacf35c41c2d17d3d9731e.zip
Fixed bug restoring view state in an intermediate buffer after closing one.
Diffstat (limited to 'test/test.lua')
-rw-r--r--test/test.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index e3fb296b..91365563 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -3670,6 +3670,24 @@ function test_ui_maximized()
end
expected_failure(test_ui_maximized)
+function test_ui_restore_view_state()
+ buffer.new() -- 1
+ view.view_ws = view.WS_VISIBLEALWAYS
+ buffer.new() -- 2
+ assert(view.view_ws ~= view.WS_VISIBLEALWAYS, 'view whitespace settings not reset')
+ view:goto_buffer(-1) -- go back to 1
+ assert_equal(view.view_ws, view.WS_VISIBLEALWAYS)
+ view.view_ws = view.WS_INVISIBLE -- reset
+ buffer.new() -- 3
+ view.view_ws = view.WS_VISIBLEALWAYS
+ buffer:close() -- switches back to 1 (after briefly switching to 2)
+ assert_equal(view.view_ws, view.WS_INVISIBLE)
+ view:goto_buffer(1) -- go back to 2
+ assert_equal(view.view_ws, view.WS_INVISIBLE)
+ buffer:close()
+ buffer:close()
+end
+
function test_reset()
local _persist
_G.foo = 'bar'