diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-08-26 19:41:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-26 19:41:52 +0200 |
commit | a6d0535c15374599e0dd9ca891d9fbc7b5774403 (patch) | |
tree | d0915f863f81409785b2f51ac91741b3e14258e9 /runtime | |
parent | afd0c648a89ff88c9bff1b24c37e139813ec13c9 (diff) | |
parent | 986bf7e78d09286e198b696630254eb097ad0875 (diff) | |
download | rneovim-a6d0535c15374599e0dd9ca891d9fbc7b5774403.tar.gz rneovim-a6d0535c15374599e0dd9ca891d9fbc7b5774403.tar.bz2 rneovim-a6d0535c15374599e0dd9ca891d9fbc7b5774403.zip |
Merge pull request #24739 from echasnovski/win-footer
feature: add floating window footer text
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/api.txt | 18 | ||||
-rw-r--r-- | runtime/doc/news.txt | 3 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 2 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/api.lua | 17 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/api_keysets.lua | 2 |
6 files changed, 33 insertions, 10 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 343c63f4b0..e68aafe051 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -479,6 +479,7 @@ to disable various visual features such as the 'number' column. Other highlight groups specific to floating windows: - |hl-FloatBorder| for window's border - |hl-FloatTitle| for window's title +- |hl-FloatFooter| for window's footer Currently, floating windows don't support some widgets like scrollbar. @@ -3138,11 +3139,18 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()* specified by character: [ ["+", "MyCorner"], ["x", "MyBorder"] ]. - • title: Title (optional) in window border, String or list. - List is [text, highlight] tuples. if is string the default - highlight group is `FloatTitle`. - • title_pos: Title position must set with title option. - value can be of `left` `center` `right` default is left. + • title: Title (optional) in window border, string or list. + List should consist of `[text, highlight]` tuples. If + string, the default highlight group is `FloatTitle`. + • title_pos: Title position. Must be set with `title` + option. Value can be one of "left", "center", or "right". + Default is `"left"`. + • footer: Footer (optional) in window border, string or + list. List should consist of `[text, highlight]` tuples. + If string, the default highlight group is `FloatFooter`. + • footer_pos: Footer position. Must be set with `footer` + option. Value can be one of "left", "center", or "right". + Default is `"left"`. • noautocmd: If true then no buffer-related autocommand events such as |BufEnter|, |BufLeave| or |BufWinEnter| may fire from calling this function. diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 56bdd07171..4f9f362b1e 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -155,6 +155,9 @@ The following new APIs and features were added. • New RPC client type `msgpack-rpc` is added for `nvim_set_client_info` to support fully MessagePack-RPC compliant clients. +• Floating windows can now show footer with new `footer` and `footer_pos` + config fields. Uses |hl-FloatFooter| by default. + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 59f8235ad2..6c0c542737 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -5273,6 +5273,8 @@ NormalFloat Normal text in floating windows. FloatBorder Border of floating windows. *hl-FloatTitle* FloatTitle Title of floating windows. + *hl-FloatFooter* +FloatFooter Footer of floating windows. *hl-NormalNC* NormalNC Normal text in non-current windows. *hl-Pmenu* diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 29a7c50585..ab5e795c16 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -258,6 +258,7 @@ Highlight groups: |hl-NormalFloat| highlights floating window |hl-FloatBorder| highlights border of a floating window |hl-FloatTitle| highlights title of a floating window + |hl-FloatFooter| highlights footer of a floating window |hl-NormalNC| highlights non-current windows |hl-MsgArea| highlights messages/cmdline area |hl-MsgSeparator| highlights separator for scrolled messages diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua index fdf5016b68..dd67fdb38b 100644 --- a/runtime/lua/vim/_meta/api.lua +++ b/runtime/lua/vim/_meta/api.lua @@ -1551,11 +1551,18 @@ function vim.api.nvim_open_term(buffer, opts) end --- specified by character: [ ["+", "MyCorner"], ["x", --- "MyBorder"] ]. --- ---- • title: Title (optional) in window border, String or list. ---- List is [text, highlight] tuples. if is string the default ---- highlight group is `FloatTitle`. ---- • title_pos: Title position must set with title option. ---- value can be of `left` `center` `right` default is left. +--- • title: Title (optional) in window border, string or list. +--- List should consist of `[text, highlight]` tuples. If +--- string, the default highlight group is `FloatTitle`. +--- • title_pos: Title position. Must be set with `title` +--- option. Value can be one of "left", "center", or "right". +--- Default is `"left"`. +--- • footer: Footer (optional) in window border, string or +--- list. List should consist of `[text, highlight]` tuples. +--- If string, the default highlight group is `FloatFooter`. +--- • footer_pos: Footer position. Must be set with `footer` +--- option. Value can be one of "left", "center", or "right". +--- Default is `"left"`. --- • noautocmd: If true then no buffer-related autocommand --- events such as `BufEnter`, `BufLeave` or `BufWinEnter` may --- fire from calling this function. diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua index 941780202e..08c29ebe7a 100644 --- a/runtime/lua/vim/_meta/api_keysets.lua +++ b/runtime/lua/vim/_meta/api_keysets.lua @@ -108,6 +108,8 @@ error('Cannot require a meta file') --- @field border? any --- @field title? any --- @field title_pos? string +--- @field footer? any +--- @field footer_pos? string --- @field style? string --- @field noautocmd? boolean |