aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/api.txt1
-rw-r--r--runtime/doc/lsp.txt1
-rw-r--r--runtime/doc/map.txt4
-rw-r--r--runtime/doc/news.txt4
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/userfunc.txt11
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--runtime/lua/vim/lsp/handlers.lua4
-rw-r--r--runtime/lua/vim/lsp/util.lua10
9 files changed, 31 insertions, 7 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index c827da4554..d74657dc8e 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -2995,6 +2995,7 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
• "win" Window given by the `win` field, or current
window.
• "cursor" Cursor position in current window.
+ • "mouse" Mouse position
• win: |window-ID| for relative="win".
• anchor: Decides which corner of the float to place at
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index cf82cbf204..aff0f9a793 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1612,6 +1612,7 @@ make_floating_popup_options({width}, {height}, {opts})
• border (string or table) override `border`
• focusable (string or table) override `focusable`
• zindex (string or table) override `zindex`, defaults to 50
+ • relative ("mouse"|"cursor") defaults to "cursor"
Return: ~
(table) Options
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index e262b7b82a..ccd48a8959 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -698,8 +698,8 @@ To avoid mapping of the characters you type in insert or Command-line mode,
type a CTRL-V first. The mapping in Insert mode is disabled if the 'paste'
option is on.
*map-error*
-Note that when an error is encountered (that causes an error message or beep)
-the rest of the mapping is not executed. This is Vi-compatible.
+Note that when an error is encountered (that causes an error message or might
+cause a beep) the rest of the mapping is not executed. This is Vi-compatible.
Note that the second character (argument) of the commands @zZtTfF[]rm'`"v
and CTRL-X is not mapped. This was done to be able to use all the named
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 88bad1b7df..7dceaa3318 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -50,6 +50,10 @@ NEW FEATURES *news-features*
The following new APIs or features were added.
+• |nvim_open_win()| now accepts a relative `mouse` option to open a floating win
+ relative to the mouse. Note that the mouse doesn't update frequently without
+ setting `vim.o.mousemoveevent = true`
+
• EditorConfig support is now builtin. This is enabled by default and happens
automatically. To disable it, users should add >lua
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index aa2f528d1b..4498dda300 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6071,6 +6071,8 @@ A jump table for the options with a short description can be found at |Q_op|.
When there is error while evaluating the option then it will be made
empty to avoid further errors. Otherwise screen updating would loop.
+ When the result contains unprintable characters the result is
+ unpredictable.
Note that the only effect of 'ruler' when this option is set (and
'laststatus' is 2 or 3) is controlling the output of |CTRL-G|.
diff --git a/runtime/doc/userfunc.txt b/runtime/doc/userfunc.txt
index 4d000efc1e..9c428175bb 100644
--- a/runtime/doc/userfunc.txt
+++ b/runtime/doc/userfunc.txt
@@ -180,7 +180,16 @@ See |:verbose-cmd| for more information.
the number 0 is returned.
Note that there is no check for unreachable lines,
thus there is no warning if commands follow ":return".
-
+ Also, there is no check if the following
+ line contains a valid command. Forgetting the line
+ continuation backslash may go unnoticed: >
+ return 'some text'
+ .. ' some more text'
+< Will happily return "some text" without an error. It
+ should have been: >
+ return 'some text'
+ \ .. ' some more text'
+<
If the ":return" is used after a |:try| but before the
matching |:finally| (if present), the commands
following the ":finally" up to the matching |:endtry|
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index c3ab39a1a3..7a1b79bba2 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -949,6 +949,7 @@ local extension = {
ice = 'slice',
score = 'slrnsc',
sol = 'solidity',
+ smali = 'smali',
tpl = 'smarty',
ihlp = 'smcl',
smcl = 'smcl',
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua
index 80df83732e..b383ca1c35 100644
--- a/runtime/lua/vim/lsp/handlers.lua
+++ b/runtime/lua/vim/lsp/handlers.lua
@@ -335,7 +335,9 @@ function M.hover(_, result, ctx, config)
return
end
if not (result and result.contents) then
- vim.notify('No information available')
+ if config.silent ~= true then
+ vim.notify('No information available')
+ end
return
end
local markdown_lines = util.convert_input_to_markdown_lines(result.contents)
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 2c6ba823db..26f0e180f5 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -1015,6 +1015,7 @@ end
--- - border (string or table) override `border`
--- - focusable (string or table) override `focusable`
--- - zindex (string or table) override `zindex`, defaults to 50
+--- - relative ("mouse"|"cursor") defaults to "cursor"
---@returns (table) Options
function M.make_floating_popup_options(width, height, opts)
validate({
@@ -1029,7 +1030,8 @@ function M.make_floating_popup_options(width, height, opts)
local anchor = ''
local row, col
- local lines_above = vim.fn.winline() - 1
+ local lines_above = opts.relative == 'mouse' and vim.fn.getmousepos().line - 1
+ or vim.fn.winline() - 1
local lines_below = vim.fn.winheight(0) - lines_above
if lines_above < lines_below then
@@ -1042,7 +1044,9 @@ function M.make_floating_popup_options(width, height, opts)
row = 0
end
- if vim.fn.wincol() + width + (opts.offset_x or 0) <= api.nvim_get_option('columns') then
+ local wincol = opts.relative == 'mouse' and vim.fn.getmousepos().column or vim.fn.wincol()
+
+ if wincol + width + (opts.offset_x or 0) <= api.nvim_get_option('columns') then
anchor = anchor .. 'W'
col = 0
else
@@ -1062,7 +1066,7 @@ function M.make_floating_popup_options(width, height, opts)
col = col + (opts.offset_x or 0),
height = height,
focusable = opts.focusable,
- relative = 'cursor',
+ relative = opts.relative == 'mouse' and 'mouse' or 'cursor',
row = row + (opts.offset_y or 0),
style = 'minimal',
width = width,