aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorGrace Petryk <gracepetryk99@gmail.com>2023-09-10 01:02:23 -0700
committerGitHub <noreply@github.com>2023-09-10 10:02:23 +0200
commit5e3cf9fb4bc7f236c858f609ca83c57fb1779ab0 (patch)
tree58a9fb5ab1b61d9d2d416636a0bc600b1c9fa484 /runtime/doc
parentbb38c066a96512cf8cb2ef2e733494b5bbdfa3fd (diff)
downloadrneovim-5e3cf9fb4bc7f236c858f609ca83c57fb1779ab0.tar.gz
rneovim-5e3cf9fb4bc7f236c858f609ca83c57fb1779ab0.tar.bz2
rneovim-5e3cf9fb4bc7f236c858f609ca83c57fb1779ab0.zip
feat(lsp): improve control over placement of floating windows (#24494)
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lsp.txt18
-rw-r--r--runtime/doc/news.txt2
2 files changed, 16 insertions, 4 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index d2d7e9faac..1e57b85153 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1580,7 +1580,8 @@ hover({_}, {result}, {ctx}, {config}) *vim.lsp.handlers.hover()*
• {config} (table) Configuration table.
• border: (default=nil)
• Add borders to the floating window
- • See |nvim_open_win()|
+ • See |vim.lsp.util.open_floating_preview()| for more
+ options.
*vim.lsp.handlers.signature_help()*
signature_help({_}, {result}, {ctx}, {config})
@@ -1599,7 +1600,8 @@ signature_help({_}, {result}, {ctx}, {config})
• {config} (table) Configuration table.
• border: (default=nil)
• Add borders to the floating window
- • See |nvim_open_win()|
+ • See |vim.lsp.util.open_floating_preview()| for more
+ options
==============================================================================
@@ -1791,6 +1793,13 @@ make_floating_popup_options({width}, {height}, {opts})
• focusable (string or table) override `focusable`
• zindex (string or table) override `zindex`, defaults to 50
• relative ("mouse"|"cursor") defaults to "cursor"
+ • anchor_bias ("auto"|"above"|"below") defaults to "auto"
+ • "auto": place window based on which side of the cursor
+ has more lines
+ • "above": place the window above the cursor unless there
+ are not enough lines to display the full window height.
+ • "below": place the window below the cursor unless there
+ are not enough lines to display the full window height.
Return: ~
(table) Options
@@ -1892,8 +1901,9 @@ open_floating_preview({contents}, {syntax}, {opts})
Parameters: ~
• {contents} (table) of lines to show in window
• {syntax} (string) of syntax to set for opened buffer
- • {opts} (table) with optional fields (additional keys are passed
- on to |nvim_open_win()|)
+ • {opts} (table) with optional fields (additional keys are filtered
+ with |vim.lsp.util.make_floating_popup_options()| before
+ they are passed on to |nvim_open_win()|)
• height: (integer) height of floating window
• width: (integer) width of floating window
• wrap: (boolean, default true) wrap long lines
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 972f37f0e9..cd977a8b5f 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -120,6 +120,8 @@ The following new APIs and features were added.
indicator to see if a server supports a feature. Instead use
`client.supports_method(<method>)`. It considers both the dynamic
capabilities and static `server_capabilities`.
+ • Added a new `anchor_bias` option to |lsp-handlers| to aid in positioning of
+ floating windows.
• Treesitter
• Bundled parsers and queries (highlight, folds) for Markdown, Python, and