feat: added scrollbar option to window.completition ( #1087) (#1308)

* #1087 added hide_scrollbar option to window.completition

* Renamed hide_scrollbar to scrollbar, changed default value (#1087)

* doc description update (#1087)

* determining info.scrollbar value considering config scrollbar (#1087)

* window.bordered scrollbar default value fix (#1087)
This commit is contained in:
pure-bliss
2022-11-18 09:31:06 +01:00
committed by GitHub
parent a188be8559
commit 8a9e8a89ee
5 changed files with 11 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
local misc = require('cmp.utils.misc')
local buffer = require('cmp.utils.buffer')
local api = require('cmp.utils.api')
local config = require('cmp.config')
---@class cmp.WindowStyle
---@field public relative string
@@ -213,6 +214,7 @@ end
---Return win info.
window.info = function(self)
local border_info = self:get_border_info()
local scrollbar = config.get().window.completion.scrollbar
local info = {
row = self.style.row,
col = self.style.col,
@@ -225,7 +227,7 @@ window.info = function(self)
scrollbar_offset = 0,
}
if self:get_content_height() > info.inner_height then
if self:get_content_height() > info.inner_height and scrollbar then
info.scrollable = true
if not border_info.visible then
info.scrollbar_offset = 1