From 25dfed6e0148771cdb659df8c616df3860583c47 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 6 Apr 2023 03:33:57 +0200 Subject: feat(api): set statuscolumn line number in nvim_eval_statusline() Having the user set `v:lnum` before calling `nvim_eval_statusline()` is unnecesarily fragile. Redraws inbetween setting `v:lnum` and the `nvim_eval_statusline()` call will overwrite `v:lnum`. --- runtime/doc/api.txt | 4 ++-- runtime/doc/news.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 52c3f7fa97..09d260e0cd 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -773,8 +773,8 @@ nvim_eval_statusline({str}, {*opts}) *nvim_eval_statusline()* • use_tabline: (boolean) Evaluate tabline instead of statusline. When true, {winid} is ignored. Mutually exclusive with {use_winbar}. - • use_statuscol: (boolean) Evaluate statuscolumn instead of - statusline. + • use_statuscol_lnum: (number) Evaluate statuscolumn for this + line number instead of statusline. Return: ~ Dictionary containing statusline information, with these keys: diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 98f3f3f398..12dc4674af 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -74,7 +74,7 @@ NEW FEATURES *news-features* The following new APIs or features were added. • |nvim_eval_statusline()| supports evaluating the |'statuscolumn'| through a - new `opts` field: `use_statuscol`. + new `opts` field: `use_statuscol_lnum`. • |nvim_buf_get_extmarks()| now accepts a -1 `ns_id` to request extmarks from all namespaces and adds the namespace id to the details array. -- cgit