Skip to content

Commit

Permalink
Add neovide specific padding with refactor of width_padding
Browse files Browse the repository at this point in the history
  • Loading branch information
dpi0 committed Sep 27, 2024
1 parent 3e8cef4 commit fd70ef2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/neoterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ local function normalize_position(position)
return position
end

local NEOVIDE_PADDING = 2
local DEFAULT_PADDING = 0

local function is_neovide()
return vim.g.neovide ~= nil
end

-- Opens the terminal window. If it was opened previously, the same terminal buffer will be used
-- Options:
-- position - override the global config position
Expand Down Expand Up @@ -154,7 +161,7 @@ function neoterm.open(opts)
border = "single",
}

local width_padding = 2 -- Add some padding so that terminal fits within the visible area (neovide)
local width_padding = is_neovide() and NEOVIDE_PADDING or DEFAULT_PADDING

if position == 0 then -- fullscreen
winopts.width = ui.width - width_padding
Expand Down

0 comments on commit fd70ef2

Please sign in to comment.