mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 19:11:52 +00:00
fix(float): prevent truncation of title that fits exactly #36880
Problem: The `over_flow` parameter in `grid_draw_bordertext` always added 1 for the '<' character. As a result, titles that fit exactly were still truncated with an unnecessary '<'. Solution: Adjust `over_flow` only when the actual overflow is greater than 0. Fix #36872
This commit is contained in:
@@ -2059,6 +2059,7 @@ describe('float window', function()
|
||||
border = 'double',
|
||||
title = 'abcdefghijklmnopqrstuvwxyz',
|
||||
title_pos = 'center',
|
||||
footer = 'abcdefghi', -- exactly fits window width #36872
|
||||
}
|
||||
local win = api.nvim_open_win(buf, false, config)
|
||||
if multigrid then
|
||||
@@ -2076,7 +2077,7 @@ describe('float window', function()
|
||||
{5:╔}{11:<stuvwxyz}{5:╗}|
|
||||
{5:║}{1: halloj! }{5:║}|
|
||||
{5:║}{1: BORDAA }{5:║}|
|
||||
{5:╚═════════╝}|
|
||||
{5:╚}{11:abcdefghi}{5:╝}|
|
||||
]],
|
||||
float_pos = { [4] = { 1001, 'NW', 1, 2, 5, true, 50, 1, 2, 5 } },
|
||||
win_viewport = {
|
||||
@@ -2092,7 +2093,7 @@ describe('float window', function()
|
||||
{0:~ }{5:╔}{11:<stuvwxyz}{5:╗}{0: }|
|
||||
{0:~ }{5:║}{1: halloj! }{5:║}{0: }|
|
||||
{0:~ }{5:║}{1: BORDAA }{5:║}{0: }|
|
||||
{0:~ }{5:╚═════════╝}{0: }|
|
||||
{0:~ }{5:╚}{11:abcdefghi}{5:╝}{0: }|
|
||||
|
|
||||
]],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user