aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-07-04 23:33:23 +0200
committerJustin M. Keyes <justinkz@gmail.com>2023-07-05 00:49:10 +0200
commite644e7ce0b36dd5e75770f3faa0a84f15e2561e8 (patch)
tree32a5501e84a465b5cd1b5c315b7795854ae73d78 /runtime/doc
parent67b2ed1004ae551c9fe1bbd29a86b5a301570800 (diff)
downloadrneovim-e644e7ce0b36dd5e75770f3faa0a84f15e2561e8.tar.gz
rneovim-e644e7ce0b36dd5e75770f3faa0a84f15e2561e8.tar.bz2
rneovim-e644e7ce0b36dd5e75770f3faa0a84f15e2561e8.zip
fix(vim.ui.open): return (don't show) error message
Problem: Showing an error via vim.notify() makes it awkward for callers such as lsp/handlers.lua to avoid showing redundant errors. Solution: Return the message instead of showing it. Let the caller decide whether and when to show the message.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lua.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index b09e308e80..77a89a123d 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2345,7 +2345,8 @@ input({opts}, {on_confirm}) *vim.ui.input()*
open({path}) *vim.ui.open()*
Opens `path` with the system default handler (macOS `open`, Windows
- `explorer.exe`, Linux `xdg-open`, …), or shows a message on failure.
+ `explorer.exe`, Linux `xdg-open`, …), or returns (but does not show) an
+ error message on failure.
Expands "~/" and environment variables in filesystem paths.
@@ -2360,7 +2361,8 @@ open({path}) *vim.ui.open()*
• {path} (string) Path or URL to open
Return: ~
- SystemCompleted|nil result Command result, or nil if not found.
+ SystemCompleted|nil # Command result, or nil if not found.
+ (string|nil) # Error message on failure
See also: ~
• |vim.system()|