Skip to content

Commit

Permalink
fix(entireBuffer): always unpausing folds (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Nov 14, 2024
1 parent d472e55 commit 7390871
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/various-textobjs/linewise-textobjs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ end
---Textobject for the entire buffer content
function M.entireBuffer()
-- FIX folds at the first or last line cause lines being left out
vim.opt_local.foldenable = false
local foldWasEnabled = vim.opt_local.foldenable:get() ---@diagnostic disable-line: undefined-field
if foldWasEnabled then vim.opt_local.foldenable = false end

local lastLine = vim.api.nvim_buf_line_count(0)
setLinewiseSelection(1, lastLine)

vim.opt_local.foldenable = true
if foldWasEnabled then vim.opt_local.foldenable = true end
end

---rest of paragraph (linewise)
Expand Down

0 comments on commit 7390871

Please sign in to comment.