Skip to content

Commit 8b7633a

Browse files
committed
fix: markdown spec not having parser installed
1 parent 23656a0 commit 8b7633a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lua/treewalker/swap.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ end
1919
local function is_supported_ft()
2020
local unsupported_filetypes = {
2121
["text"] = true,
22+
["txt"] = true,
23+
2224
["markdown"] = true,
25+
["md"] = true,
2326
}
2427

2528
local bufnr = vim.api.nvim_get_current_buf()

tests/minimal_init.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ require('nvim-treesitter.configs').setup {
3131

3232
-- These are required lest nvim not be able to tell these parsers are installed
3333
vim.treesitter.language.register('ruby', { 'rb' })
34-
-- TODO Why on earth does this break tests. Isn't the md parser supposed to come by default?
35-
-- vim.treesitter.language.register('markdown', { 'md' })
34+
vim.treesitter.language.register('markdown', { 'md' })
3635

3736
dofile("plugin/init.lua") -- get the Treewalker command present

tests/treewalker/markdown_spec.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ describe("Movement in a markdown file", function()
99
load_fixture("/markdown.md")
1010
end)
1111

12-
-- TODO this needs to work
13-
-- h.ensure_has_parser()
12+
h.ensure_has_parser()
1413

1514
-- This is hard, treesitter is showing all java code as a "block_continuation"
1615
-- at the same level.
@@ -32,6 +31,8 @@ describe("Swapping in a markdown file:", function()
3231
load_fixture("/markdown.md")
3332
end)
3433

34+
h.ensure_has_parser()
35+
3536
it("turns off for down in md files", function()
3637
vim.fn.cursor(1, 1)
3738
local lines_before = lines.get_lines(0, -1)

0 commit comments

Comments
 (0)