Skip to content

Commit

Permalink
fix(chat): navigate between H2 headers in buffer only (#781)
Browse files Browse the repository at this point in the history
Co-authored-by: Oli Morris <[email protected]>
  • Loading branch information
olimorris and olimorris authored Jan 30, 2025
1 parent 7a6680d commit 391aeae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/codecompanion/utils/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function M.goto_heading(direction, count)

local root_tree = parser:parse()[1]:root()

local query = vim.treesitter.query.parse("markdown", [[(atx_heading) @heading]])
local query = vim.treesitter.query.parse("markdown", [[(atx_heading (atx_h2_marker) @heading)]])

local from_row, to_row, found_headings
if direction == "next" then
Expand Down

0 comments on commit 391aeae

Please sign in to comment.