@@ -111,19 +111,19 @@ function win:get_content_height()
111
111
return vim .api .nvim_win_text_height (self :get_win (), {}).all
112
112
end
113
113
114
- --- @return { vertical : number , horizontal : number }
114
+ --- @return { vertical : number , horizontal : number , left : number , right : number , top : number , bottom : number }
115
115
function win :get_border_size ()
116
- if not self :is_open () then return { vertical = 0 , horizontal = 0 } end
116
+ if not self :is_open () then return { vertical = 0 , horizontal = 0 , left = 0 , right = 0 , top = 0 , bottom = 0 } end
117
117
118
118
local border = self .config .border
119
119
if border == ' none' then
120
- return { vertical = 0 , horizontal = 0 }
120
+ return { vertical = 0 , horizontal = 0 , left = 0 , right = 0 , top = 0 , bottom = 0 }
121
121
elseif border == ' padded' then
122
- return { vertical = 0 , horizontal = 1 }
122
+ return { vertical = 0 , horizontal = 1 , left = 1 , right = 0 , top = 0 , bottom = 0 }
123
123
elseif border == ' shadow' then
124
- return { vertical = 1 , horizontal = 1 }
124
+ return { vertical = 1 , horizontal = 1 , left = 0 , right = 1 , top = 0 , bottom = 1 }
125
125
elseif type (border ) == ' string' then
126
- return { vertical = 2 , horizontal = 2 }
126
+ return { vertical = 2 , horizontal = 2 , left = 1 , right = 1 , top = 1 , bottom = 1 }
127
127
elseif type (border ) == ' table' and border ~= nil then
128
128
-- borders can be a table of strings and act differently with different # of chars
129
129
-- so we normalize it: https://neovim.io/doc/user/api.html#nvim_open_win()
@@ -139,10 +139,10 @@ function win:get_border_size()
139
139
local bottom = resolved_border [6 ] == ' ' and 0 or 1
140
140
local left = resolved_border [8 ] == ' ' and 0 or 1
141
141
local right = resolved_border [4 ] == ' ' and 0 or 1
142
- return { vertical = top + bottom , horizontal = left + right }
142
+ return { vertical = top + bottom , horizontal = left + right , left = left , right = right , top = top , bottom = bottom }
143
143
end
144
144
145
- return { vertical = 0 , horizontal = 0 }
145
+ return { vertical = 0 , horizontal = 0 , left = 0 , right = 0 , top = 0 , bottom = 0 }
146
146
end
147
147
148
148
--- @return number
0 commit comments