aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vim.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-07-07 21:35:55 +0200
committerGitHub <noreply@github.com>2019-07-07 21:35:55 +0200
commit524fe6205d01d8ced45bc4b00ed397add01a41bf (patch)
tree8fd4cb84d1149da6f636b5bd5bbb114df86b982b /src/nvim/api/vim.c
parent28a86608a84672b3b64981c3b47b80b051cb5177 (diff)
parentef3e32d57ee0ebe3f425998216d8bf61ffdc28bb (diff)
downloadrneovim-524fe6205d01d8ced45bc4b00ed397add01a41bf.tar.gz
rneovim-524fe6205d01d8ced45bc4b00ed397add01a41bf.tar.bz2
rneovim-524fe6205d01d8ced45bc4b00ed397add01a41bf.zip
Merge pull request #10090 from bfredl/floatpopup
api/window: add style="minimal" flag to disable unwanted UI features for simple floats
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r--src/nvim/api/vim.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index 8e5650633a..dbe3b66fd5 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1064,6 +1064,19 @@ fail:
/// - `external`: GUI should display the window as an external
/// top-level window. Currently accepts no other positioning
/// configuration together with this.
+/// - `style`: Configure the apparance of the window. Currently only takes
+/// one non-empty value:
+/// - "minimal" Nvim will display the window with many UI options
+/// disabled. This is useful when displaing a temporary
+/// float where the text should not be edited. Disables
+/// 'number', 'relativenumber', 'cursorline', 'cursorcolumn',
+/// 'spell' and 'list' options. 'signcolumn' is changed to
+/// `auto`. The end-of-buffer region is hidden by setting
+/// `eob` flag of 'fillchars' to a space char, and clearing
+/// the |EndOfBuffer| region in 'winhighlight'.
+///
+/// top-level window. Currently accepts no other positioning
+/// configuration together with this.
/// @param[out] err Error details, if any
///
/// @return Window handle, or 0 on error
@@ -1085,6 +1098,11 @@ Window nvim_open_win(Buffer buffer, Boolean enter, Dictionary config,
if (buffer > 0) {
nvim_win_set_buf(wp->handle, buffer, err);
}
+
+ if (fconfig.style == kWinStyleMinimal) {
+ win_set_minimal_style(wp);
+ didset_window_options(wp);
+ }
return wp->handle;
}