<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/ui.lua, branch aucmd_textputpost</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>docs: replace &lt;pre&gt; with ``` (#25136)</title>
<updated>2023-09-14T13:23:01+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2023-09-14T13:23:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=2e92065686f62851318150a315591c30b8306a4b'/>
<id>2e92065686f62851318150a315591c30b8306a4b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(vim.system): factor out on_exit handling</title>
<updated>2023-09-05T16:10:04+00:00</updated>
<author>
<name>Lewis Russell</name>
<email>lewis6991@gmail.com</email>
</author>
<published>2023-09-04T11:03:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=80d1333b7317460c562a982ac21f900d9fbd89f6'/>
<id>80d1333b7317460c562a982ac21f900d9fbd89f6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(ui.open): some URLs fail on Windows</title>
<updated>2023-07-21T11:36:57+00:00</updated>
<author>
<name>marshmallow</name>
<email>marshycity@gmail.com</email>
</author>
<published>2023-07-19T00:06:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=519b9929e94c94965b73ac4b04aedb03fd2708ca'/>
<id>519b9929e94c94965b73ac4b04aedb03fd2708ca</id>
<content type='text'>
Problem:
On Windows, `explorer.exe` fails to open some URLs, for example:

    :lua vim.ui.open('https://devdocs.io/#q=lua%20lua_call')

https://github.com/neovim/neovim/pull/23401#issuecomment-1641015704

Solution:
Use rundll32 instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
On Windows, `explorer.exe` fails to open some URLs, for example:

    :lua vim.ui.open('https://devdocs.io/#q=lua%20lua_call')

https://github.com/neovim/neovim/pull/23401#issuecomment-1641015704

Solution:
Use rundll32 instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(vim.ui.open): return (don't show) error message</title>
<updated>2023-07-04T22:49:10+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2023-07-04T21:33:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e644e7ce0b36dd5e75770f3faa0a84f15e2561e8'/>
<id>e644e7ce0b36dd5e75770f3faa0a84f15e2561e8</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(gx): visual selection, expand env vars</title>
<updated>2023-07-04T21:45:35+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2023-07-02T14:51:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=67b2ed1004ae551c9fe1bbd29a86b5a301570800'/>
<id>67b2ed1004ae551c9fe1bbd29a86b5a301570800</id>
<content type='text'>
---
Rejected experiment: move vim.ui.open() to vim.env.open()

Problem:
`vim.ui` is where user-interface "providers" live, which can be
overridden. It would also be useful to have a "providers" namespace for
platform-specific features such as "open", clipboard, python, and the other
providers listed in `:help providers`. We could overload `vim.ui` to
serve that purpose as the single "providers" namespace, but
`vim.ui.nodejs()` for example seems awkward.

Solution:
`vim.env` currently has too narrow of a purpose. Overload it to also be
a namespace for `vim.env.open`.

diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index 913f1fe20348..17d05ff37595 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -37,8 +37,28 @@ local options_info = setmetatable({}, {
   end,
 })

-vim.env = setmetatable({}, {
-  __index = function(_, k)
+vim.env = setmetatable({
+  open = setmetatable({}, {
+      __call = function(_, uri)
+        print('xxxxx'..uri)
+        return true
+      end,
+      __tostring = function()
+        local v = vim.fn.getenv('open')
+        if v == vim.NIL then
+          return nil
+        end
+        return v
+      end,
+    })
+  },
+  {
+  __index = function(t, k, ...)
+    if k == 'open' then
+      error()
+      -- vim.print({...})
+      -- return rawget(t, k)
+    end
     local v = vim.fn.getenv(k)
     if v == vim.NIL then
       return nil
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
---
Rejected experiment: move vim.ui.open() to vim.env.open()

Problem:
`vim.ui` is where user-interface "providers" live, which can be
overridden. It would also be useful to have a "providers" namespace for
platform-specific features such as "open", clipboard, python, and the other
providers listed in `:help providers`. We could overload `vim.ui` to
serve that purpose as the single "providers" namespace, but
`vim.ui.nodejs()` for example seems awkward.

Solution:
`vim.env` currently has too narrow of a purpose. Overload it to also be
a namespace for `vim.env.open`.

diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua
index 913f1fe20348..17d05ff37595 100644
--- a/runtime/lua/vim/_meta.lua
+++ b/runtime/lua/vim/_meta.lua
@@ -37,8 +37,28 @@ local options_info = setmetatable({}, {
   end,
 })

-vim.env = setmetatable({}, {
-  __index = function(_, k)
+vim.env = setmetatable({
+  open = setmetatable({}, {
+      __call = function(_, uri)
+        print('xxxxx'..uri)
+        return true
+      end,
+      __tostring = function()
+        local v = vim.fn.getenv('open')
+        if v == vim.NIL then
+          return nil
+        end
+        return v
+      end,
+    })
+  },
+  {
+  __index = function(t, k, ...)
+    if k == 'open' then
+      error()
+      -- vim.print({...})
+      -- return rawget(t, k)
+    end
     local v = vim.fn.getenv(k)
     if v == vim.NIL then
       return nil
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(vim.ui): vim.ui.open, "gx" without netrw</title>
<updated>2023-07-04T21:45:00+00:00</updated>
<author>
<name>marshmallow</name>
<email>marshycity@gmail.com</email>
</author>
<published>2023-04-30T05:53:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=af6e6ccf3dee815850639ec5613dda3442caa7d6'/>
<id>af6e6ccf3dee815850639ec5613dda3442caa7d6</id>
<content type='text'>
Co-authored-by: Mathias Fußenegger &lt;mfussenegger@users.noreply.github.com&gt;
Co-authored-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;
Co-authored-by: ii14 &lt;59243201+ii14@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Mathias Fußenegger &lt;mfussenegger@users.noreply.github.com&gt;
Co-authored-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;
Co-authored-by: ii14 &lt;59243201+ii14@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: naming conventions, guidelines</title>
<updated>2023-02-22T15:23:49+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2022-12-14T18:58:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=6752f1005d26c93a033d856a60b7b296f3e51634'/>
<id>6752f1005d26c93a033d856a60b7b296f3e51634</id>
<content type='text'>
close #21063
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
close #21063
</pre>
</div>
</content>
</entry>
<entry>
<title>docs(gen): support language annotation in docstrings</title>
<updated>2022-12-02T15:05:00+00:00</updated>
<author>
<name>Christian Clason</name>
<email>c.clason@uni-graz.at</email>
</author>
<published>2022-11-23T11:31:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=0b05bd87c04f9cde5c84a062453619349e370795'/>
<id>0b05bd87c04f9cde5c84a062453619349e370795</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix: vim.ui.input always calls callback #21006</title>
<updated>2022-11-12T14:57:35+00:00</updated>
<author>
<name>Steven Arcangeli</name>
<email>506791+stevearc@users.noreply.github.com</email>
</author>
<published>2022-11-12T14:57:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=b3f781ba912b0d24896d85fc8434faaedfddfeb2'/>
<id>b3f781ba912b0d24896d85fc8434faaedfddfeb2</id>
<content type='text'>
Followup to #20883
Related: #18144

This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `&lt;C-c&gt;`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `&lt;C-c&gt;` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `&lt;Esc&gt;`.
I can think of three good reasons why the behavior should be this way:

1. Easier for the user to understand** It's not intuitive for there to be two
   ways to abort an input dialog that have _different_ outcomes. As a user,
   I would expect any action that cancels the input to leave me in the same
   state. As a plugin author, I see no value in having two possible outcomes for
   aborting the input. I have to handle both cases, but I can't think of
   a situation where I would want to treat one differently than the other.

2. Provides an API that can be overridden by other implementations** The current
   contract of "throw an error upon `&lt;C-c&gt;`" cannot be replicated by async
   implementations of `vim.ui.input`. If the callsite wants to handle the case
   of the user hitting `&lt;C-c&gt;` they need to use `pcall(vim.ui.input, ...)`,
   however an async implementation will instantly return and so there will be no
   way for it to produce the same error-throwing behavior when the user inputs
   `&lt;C-c&gt;`. This makes it impossible to be fully API-compatible with the
   built-in `vim.ui.input`.

3. Provides a useful guarantee to the callsite** As a plugin author, I want the
   guarantee that `on_confirm` will _always_ be called (only catastrophic errors
   should prevent this). If I am in the middle of some async thread of logic,
   I need some way to resume that logic after handing off control to
   `vim.ui.input`. The only way to handle the `&lt;C-c&gt;` case is with `pcall`,
   which as already mentioned, breaks down if you're using an alternative
   implementation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Followup to #20883
Related: #18144

This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `&lt;C-c&gt;`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `&lt;C-c&gt;` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `&lt;Esc&gt;`.
I can think of three good reasons why the behavior should be this way:

1. Easier for the user to understand** It's not intuitive for there to be two
   ways to abort an input dialog that have _different_ outcomes. As a user,
   I would expect any action that cancels the input to leave me in the same
   state. As a plugin author, I see no value in having two possible outcomes for
   aborting the input. I have to handle both cases, but I can't think of
   a situation where I would want to treat one differently than the other.

2. Provides an API that can be overridden by other implementations** The current
   contract of "throw an error upon `&lt;C-c&gt;`" cannot be replicated by async
   implementations of `vim.ui.input`. If the callsite wants to handle the case
   of the user hitting `&lt;C-c&gt;` they need to use `pcall(vim.ui.input, ...)`,
   however an async implementation will instantly return and so there will be no
   way for it to produce the same error-throwing behavior when the user inputs
   `&lt;C-c&gt;`. This makes it impossible to be fully API-compatible with the
   built-in `vim.ui.input`.

3. Provides a useful guarantee to the callsite** As a plugin author, I want the
   guarantee that `on_confirm` will _always_ be called (only catastrophic errors
   should prevent this). If I am in the middle of some async thread of logic,
   I need some way to resume that logic after handing off control to
   `vim.ui.input`. The only way to handle the `&lt;C-c&gt;` case is with `pcall`,
   which as already mentioned, breaks down if you're using an alternative
   implementation.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(vim.ui.input): return empty string when inputs nothing (#20883)</title>
<updated>2022-11-08T00:15:15+00:00</updated>
<author>
<name>Jongwook Choi</name>
<email>wookayin@gmail.com</email>
</author>
<published>2022-11-08T00:15:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=59ff4691f67fc1ddd3d1b7240a2f2eb095e58281'/>
<id>59ff4691f67fc1ddd3d1b7240a2f2eb095e58281</id>
<content type='text'>
fix(vim.ui.input): return empty string when inputs nothing

The previous behavior of `vim.ui.input()` when typing &lt;CR&gt; with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.

Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix(vim.ui.input): return empty string when inputs nothing

The previous behavior of `vim.ui.input()` when typing &lt;CR&gt; with
no text input (with an intention of having the empty string as input)
was to execute `on_confirm(nil)`, conflicting with its documentation.

Inputting an empty string should now correctly execute `on_confirm('')`.
This should be clearly distinguished from cancelling or aborting the
input UI, in which case `on_confirm(nil)` is executed as before.</pre>
</div>
</content>
</entry>
</feed>
