Skip to content

Commit

Permalink
test(setup): keymaps in presentation mode can be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonleelunn committed Jan 10, 2025
1 parent 14a1bc4 commit 617a378
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/setup_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,23 @@ describe("present.setup", function()
eq(vim.o[option], value)
end
end)

it("should allow overriding the default keymaps", function()
local user_config = {
keymaps = {
next_slide = "l",
},
}

setup(user_config)

start_presentation({ filepath = "tests/test_slides.md" })

-- should advance to the next slide
vim.api.nvim_feedkeys("l", "x", true)

eq(state.current_slide, 2)

end_presentation()
end)
end)
9 changes: 9 additions & 0 deletions tests/test_slides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Test Markdown File

Body text
Body text
Body text

# Lorem ipsum odor amet, consectetuer adipiscing elit.

Lorem ipsum odor amet, consectetuer adipiscing elit. Malesuada blandit condimentum curae sodales aliquam. Lectus commodo viverra dui eget; vestibulum phasellus. Vestibulum mollis parturient curabitur fringilla euismod placerat phasellus. Neque magna sollicitudin auctor molestie viverra duis habitasse libero pulvinar.

0 comments on commit 617a378

Please sign in to comment.