summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 13:34:47 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 13:34:47 +0200
commitd03647b4f814782bb720f14523802856f638caca (patch)
tree3b68c12a62931b35e5318f166e55f73de6e61fe5
parentd4298233fe294e34c011be7caf318a5fe7046a26 (diff)
Verify nested fold opening
-rw-r--r--tests/run.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 345f146..1906c6d 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -7129,6 +7129,30 @@ test("Primary preflight opens folds for horizontal and all policies", function()
same(2, host:read_fold_state().closed_levels)
end)
+test("Primary preflight repeats fold opening until the line is visible", function()
+ local host = MemoryHost.new({
+ fold_open_policy = { "horizontal" },
+ closed_fold_levels = 3,
+ })
+ sequence_coordinator.new({ host = host }):primary("t")
+
+ local fold_operations = {}
+ for _, operation in ipairs(host:operations()) do
+ if operation.operation == "read_fold_state"
+ or operation.operation == "open_fold"
+ then
+ fold_operations[#fold_operations + 1] = operation.operation
+ end
+ end
+ list_same({
+ "read_fold_state",
+ "open_fold", "read_fold_state",
+ "open_fold", "read_fold_state",
+ "open_fold", "read_fold_state",
+ }, fold_operations)
+ same(0, host:read_fold_state().closed_levels)
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then