Skip to content

Commit 7175e4d

Browse files
authored
fix: assign filetype to background buffer (#91)
## Summary Assigns a filetype (`zenmode-bg`) to the background buffer created by zen-mode. > Why? I use a [utility](https://github.com/ditsuke/nvim-config/blob/main/lua/ditsuke/utils/ui.lua#L21-L45) to close floating windows. This utility interferes with zen-mode's background window so it helps if it has a filetype I can use to filter it out.
1 parent a256eda commit 7175e4d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lua/zen-mode/view.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ function M.create(opts)
156156
M.plugins_on_open()
157157

158158
M.bg_buf = vim.api.nvim_create_buf(false, true)
159+
vim.api.nvim_buf_set_option(M.bg_buf, "filetype", "zenmode-bg")
159160
local ok
160161
ok, M.bg_win = pcall(vim.api.nvim_open_win, M.bg_buf, false, {
161162
relative = "editor",

0 commit comments

Comments
 (0)