Skip to content

Commit

Permalink
feat(border): add border to main window (#80)
Browse files Browse the repository at this point in the history
This adds support for window border

Features:
* Add window border on vertical side of the window

Preview:
![Screenshot
(58)](https://user-images.githubusercontent.com/38243998/214766890-43155a64-3a96-42d6-ac54-3672601afbde.png)
  • Loading branch information
hasansujon786 committed Jul 6, 2024
1 parent 3ff1ca3 commit a256eda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/zen-mode/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local M = {}

---@class ZenOptions
local defaults = {
border = "none",
zindex = 40, -- zindex of the zen window. Should be less than 50, which is the float default
window = {
backdrop = 0.95, -- shade the backdrop of the zen window. Set to 1 to keep the same as Normal
Expand Down
3 changes: 2 additions & 1 deletion lua/zen-mode/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ function M.create(opts)
local win_opts = vim.tbl_extend("keep", {
relative = "editor",
zindex = opts.zindex,
border = opts.border,
}, M.layout(opts))

local buf = vim.api.nvim_get_current_buf()
Expand Down Expand Up @@ -219,7 +220,7 @@ function M.fix_hl(win, normal)
vim.api.nvim_set_current_win(win)
end
normal = normal or "Normal"
vim.cmd("setlocal winhl=NormalFloat:" .. normal)
vim.cmd("setlocal winhl=NormalFloat:" .. normal .. ",FloatBorder:ZenBorder")
vim.cmd("setlocal winblend=0")
vim.cmd([[setlocal fcs=eob:\ ,fold:\ ,vert:\]])
-- vim.api.nvim_win_set_option(win, "winhighlight", "NormalFloat:" .. normal)
Expand Down

0 comments on commit a256eda

Please sign in to comment.