Skip to content

Commit

Permalink
'consider_borders' -> 'consider_border'
Browse files Browse the repository at this point in the history
  • Loading branch information
dstein64 committed Oct 15, 2024
1 parent e99422f commit a8f1087
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions autoload/scrollview.vim
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ let g:scrollview_base = get(g:, 'scrollview_base', 'right')
let g:scrollview_byte_limit = get(g:, 'scrollview_byte_limit', 1000000)
let g:scrollview_character = get(g:, 'scrollview_character', '')
let g:scrollview_column = get(g:, 'scrollview_column', 1)
let g:scrollview_consider_borders =
\ get(g:, 'scrollview_consider_borders', v:false)
let g:scrollview_consider_border =
\ get(g:, 'scrollview_consider_border', v:false)
let g:scrollview_current_only = get(g:, 'scrollview_current_only', v:false)
let g:scrollview_excluded_filetypes =
\ get(g:, 'scrollview_excluded_filetypes', [])
Expand Down
2 changes: 1 addition & 1 deletion doc/scrollview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ scrollview_column |Number| specifying the scrollbar column (relative to
|scrollview_base|). Defaults to `1`. Must be an integer
greater than or equal to `1`.

scrollview_consider_borders *scrollview_consider_borders*
scrollview_consider_border *scrollview_consider_border*
(experimental) |Boolean| specifying whether floating window borders are
taken into account for positioning scrollbars and signs.
When set to |v:true|, borders are considered as part of
Expand Down
2 changes: 1 addition & 1 deletion doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ scrollview_conflicts_middle_priority scrollview.txt /*scrollview_conflicts_middl
scrollview_conflicts_middle_symbol scrollview.txt /*scrollview_conflicts_middle_symbol*
scrollview_conflicts_top_priority scrollview.txt /*scrollview_conflicts_top_priority*
scrollview_conflicts_top_symbol scrollview.txt /*scrollview_conflicts_top_symbol*
scrollview_consider_borders scrollview.txt /*scrollview_consider_borders*
scrollview_consider_border scrollview.txt /*scrollview_consider_border*
scrollview_current_only scrollview.txt /*scrollview_current_only*
scrollview_cursor_priority scrollview.txt /*scrollview_cursor_priority*
scrollview_cursor_symbol scrollview.txt /*scrollview_cursor_symbol*
Expand Down
12 changes: 6 additions & 6 deletions lua/scrollview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,8 @@ local get_topline_lookup = function(winid)
return topline_lookup
end

local consider_borders = function(winid)
if vim.g.scrollview_consider_borders
local consider_border = function(winid)
if vim.g.scrollview_consider_border
and vim.g.scrollview_floating_windows
and vim.tbl_contains({'left', 'right'}, vim.g.scrollview_base) then
local config = api.nvim_win_get_config(winid)
Expand Down Expand Up @@ -1095,7 +1095,7 @@ local calculate_scrollbar_column = function(winid)
-- For an unknown base, use the default position (right edge of window).
left = left + winwidth - 1
end
if consider_borders(winid) then
if consider_border(winid) then
local border = api.nvim_win_get_config(winid).border
if base == 'right' then
if border[4] ~= '' then
Expand Down Expand Up @@ -1215,7 +1215,7 @@ local is_valid_column = function(winid, col, width)
local min_valid_col = 1
local max_valid_col = winwidth - width + 1
local base = vim.g.scrollview_base
if consider_borders(winid) then
if consider_border(winid) then
local border = api.nvim_win_get_config(winid).border
if border[4] ~= '' then
-- The floating window has a right border.
Expand Down Expand Up @@ -1503,7 +1503,7 @@ local show_scrollbar = function(winid, bar_winid)
-- specification of EndOfBuffer would be used to color the bottom of the
-- scrollbar.
target = is_float and 'NormalFloat' or 'Normal'
if consider_borders(winid) then
if consider_border(winid) then
local border = api.nvim_win_get_config(winid).border
local winwidth = fn.winwidth(winid)
if border[4] ~= '' -- right border
Expand Down Expand Up @@ -1832,7 +1832,7 @@ local show_signs = function(winid, sign_winids, bar_winid)
target = 'ScrollView'
else
target = is_float and 'NormalFloat' or 'Normal'
if consider_borders(winid) then
if consider_border(winid) then
local border = api.nvim_win_get_config(winid).border
local winwidth = fn.winwidth(winid)
if border[4] ~= '' -- right border
Expand Down

0 comments on commit a8f1087

Please sign in to comment.