aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawscreen.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-01-18 10:03:13 +0800
committerGitHub <noreply@github.com>2025-01-18 02:03:13 +0000
commitc9000a6b13fd6695f6e28a890b82b490a123f25e (patch)
tree8d25376bd57687bdf0463c67bdd93c153ffdb70d /src/nvim/drawscreen.c
parentc6cc937512f59af12fd1b15ca4f7a11288f28ca0 (diff)
downloadrneovim-c9000a6b13fd6695f6e28a890b82b490a123f25e.tar.gz
rneovim-c9000a6b13fd6695f6e28a890b82b490a123f25e.tar.bz2
rneovim-c9000a6b13fd6695f6e28a890b82b490a123f25e.zip
vim-patch:9.1.1028: too many strlen() calls in screen.c (#32083)
Problem: too many strlen() calls in screen.c Solution: refactor screen.c and remove calls to strlen(), verify that leadmultispace != NULL (John Marriott) closes: vim/vim#16460 https://github.com/vim/vim/commit/c15de972e8131def2f506bb9eb6b306ca089629c Co-authored-by: John Marriott <basilisk@internode.on.net>
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r--src/nvim/drawscreen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index 7f4de9eab8..b1ea38e280 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -2580,9 +2580,9 @@ int compute_foldcolumn(win_T *wp, int col)
{
int fdc = win_fdccol_count(wp);
int wmw = wp == curwin && p_wmw == 0 ? 1 : (int)p_wmw;
- int wwidth = wp->w_grid.cols;
+ int n = wp->w_grid.cols - (col + wmw);
- return MIN(fdc, wwidth - (col + wmw));
+ return MIN(fdc, n);
}
/// Return the width of the 'number' and 'relativenumber' column.