Skip to content

Commit

Permalink
fix(jump): only open folds containing match. Fixes #224. Fixes #225
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 28, 2023
1 parent 87db9bb commit a74d31f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/flash/jump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ end
---@param match Flash.Match
function M.open_folds(match)
local cursor = vim.api.nvim_win_get_cursor(match.win)
local from = math.min(match.pos[1], cursor[1])
local to = math.max(match.end_pos[1], cursor[1])
local from = match.pos[1]
local to = match.end_pos[1]
local is_visual = vim.fn.mode(true):find("v")
local opened = false
for line = from, to do
Expand Down

0 comments on commit a74d31f

Please sign in to comment.