<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/ui.lua, branch usermarks</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(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>
<entry>
<title>fix(vim.ui.input): accept nil or empty "opts"  #19109</title>
<updated>2022-06-28T09:53:15+00:00</updated>
<author>
<name>0x74696d6d79</name>
<email>34635512+tzx@users.noreply.github.com</email>
</author>
<published>2022-06-28T09:53:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=ee6b21e8430ea810ba2e3e9163b941386a2e1d65'/>
<id>ee6b21e8430ea810ba2e3e9163b941386a2e1d65</id>
<content type='text'>
Fix #18143</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix #18143</pre>
</div>
</content>
</entry>
<entry>
<title>chore: format runtime with stylua</title>
<updated>2022-05-09T14:31:55+00:00</updated>
<author>
<name>Christian Clason</name>
<email>c.clason@uni-graz.at</email>
</author>
<published>2022-05-09T09:23:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=aefdc6783cb77f09786542c90901a9e7120bea42'/>
<id>aefdc6783cb77f09786542c90901a9e7120bea42</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: typo fixes (#17859)</title>
<updated>2022-04-15T10:35:06+00:00</updated>
<author>
<name>dundargoc</name>
<email>33953936+dundargoc@users.noreply.github.com</email>
</author>
<published>2022-04-15T10:35:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e63e5d1dbd3dd4711efa0ecf9e844ff308b370a6'/>
<id>e63e5d1dbd3dd4711efa0ecf9e844ff308b370a6</id>
<content type='text'>
Co-authored-by: Elias Alves Moura &lt;eliamoura.alves@gmail.com&gt;
Co-authored-by: venkatesh &lt;shariharanvenkatesh@gmail.com&gt;
Co-authored-by: zeertzjq &lt;zeertzjq@outlook.com&gt;
Co-authored-by: Vikas Raj &lt;24727447+numToStr@users.noreply.github.com&gt;
Co-authored-by: Steve Vermeulen &lt;sfvermeulen@gmail.com&gt;
Co-authored-by: Evgeni Chasnovski &lt;evgeni.chasnovski@gmail.com&gt;
Co-authored-by: rwxd &lt;rwxd@pm.me&gt;
Co-authored-by: casswedson &lt;58050969+casswedson@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Elias Alves Moura &lt;eliamoura.alves@gmail.com&gt;
Co-authored-by: venkatesh &lt;shariharanvenkatesh@gmail.com&gt;
Co-authored-by: zeertzjq &lt;zeertzjq@outlook.com&gt;
Co-authored-by: Vikas Raj &lt;24727447+numToStr@users.noreply.github.com&gt;
Co-authored-by: Steve Vermeulen &lt;sfvermeulen@gmail.com&gt;
Co-authored-by: Evgeni Chasnovski &lt;evgeni.chasnovski@gmail.com&gt;
Co-authored-by: rwxd &lt;rwxd@pm.me&gt;
Co-authored-by: casswedson &lt;58050969+casswedson@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>chore: fix typos (#17250)</title>
<updated>2022-02-08T00:19:06+00:00</updated>
<author>
<name>dundargoc</name>
<email>33953936+dundargoc@users.noreply.github.com</email>
</author>
<published>2022-02-08T00:19:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=64116d78502e0ca611e13adf9323ef2d3fe708c2'/>
<id>64116d78502e0ca611e13adf9323ef2d3fe708c2</id>
<content type='text'>
Co-authored-by: zeertzjq &lt;zeertzjq@outlook.com&gt;
Co-authored-by: Dani Dickstein &lt;daniel.dickstein@gmail.com&gt;
Co-authored-by: Axel Dahlberg &lt;git@valleymnt.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: zeertzjq &lt;zeertzjq@outlook.com&gt;
Co-authored-by: Dani Dickstein &lt;daniel.dickstein@gmail.com&gt;
Co-authored-by: Axel Dahlberg &lt;git@valleymnt.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>docs: add example to vim.ui.select (#17241)</title>
<updated>2022-01-30T12:32:55+00:00</updated>
<author>
<name>dundargoc</name>
<email>33953936+dundargoc@users.noreply.github.com</email>
</author>
<published>2022-01-30T12:32:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=abde91ecaf338da4a0b88e383583624b5cab7b30'/>
<id>abde91ecaf338da4a0b88e383583624b5cab7b30</id>
<content type='text'>
Closes https://github.com/neovim/neovim/issues/17137</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes https://github.com/neovim/neovim/issues/17137</pre>
</div>
</content>
</entry>
<entry>
<title>feat(ui): add vim.ui.input and use in lsp rename (#15959)</title>
<updated>2021-11-07T15:13:53+00:00</updated>
<author>
<name>Sebastian Lyng Johansen</name>
<email>seblyng98@gmail.com</email>
</author>
<published>2021-11-07T15:13:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=16d4af6d2f549709aa55510f5ae52238c5cadb9c'/>
<id>16d4af6d2f549709aa55510f5ae52238c5cadb9c</id>
<content type='text'>
* vim.ui.input is an overridable function that prompts for user input
* take an opts table and the `on_confirm` callback, see `:help vim.ui.input` for more details
* defaults to a wrapper around vim.fn.input(opts)
* switches the built-in client's rename handler to use vim.ui.input by default</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* vim.ui.input is an overridable function that prompts for user input
* take an opts table and the `on_confirm` callback, see `:help vim.ui.input` for more details
* defaults to a wrapper around vim.fn.input(opts)
* switches the built-in client's rename handler to use vim.ui.input by default</pre>
</div>
</content>
</entry>
<entry>
<title>feat(ui): add `opt.kind` to `vim.ui.select` (#15838)</title>
<updated>2021-11-01T00:15:09+00:00</updated>
<author>
<name>Zachary Churchill</name>
<email>zacharyachurchill@gmail.com</email>
</author>
<published>2021-11-01T00:15:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=7ae86c1d4caffec57e2d4d44e40a9feba91d96dd'/>
<id>7ae86c1d4caffec57e2d4d44e40a9feba91d96dd</id>
<content type='text'>
Co-authored-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: Justin M. Keyes &lt;justinkz@gmail.com&gt;</pre>
</div>
</content>
</entry>
</feed>
