Skip to content

Commit

Permalink
Set window opt
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Nov 22, 2023
1 parent 11b709f commit 4d6eee6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lua/neogit/lib/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,12 @@ function Buffer.create(config)
buffer:set_option("buftype", config.buftype or "nofile")
buffer:set_option("swapfile", false)

vim.opt_local.foldenable = true
buffer:set_option("foldmethod", "manual")
buffer:set_option("foldlevel", 99)
buffer:set_option("foldminlines", 0)
buffer:set_option("foldtext", "v:lua.NeogitBufferFoldText()")
if win then
vim.api.nvim_set_option_value("foldenable", true, { win = win })
vim.api.nvim_set_option_value("foldlevel", 99, { win = win })
vim.api.nvim_set_option_value("foldminlines", 0, { win = win })
vim.api.nvim_set_option_value("foldtext", "v:lua.NeogitBufferFoldText()", { win = win })
end

if config.filetype then
buffer:set_filetype(config.filetype)
Expand Down

0 comments on commit 4d6eee6

Please sign in to comment.