<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/test/functional/insert/insert_spec.lua, branch stable</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>edit.c: Ensure undo sync when emulating &lt;Esc&gt;x #11706</title>
<updated>2020-01-13T01:09:39+00:00</updated>
<author>
<name>Matthew Malcomson</name>
<email>hardenedapple@gmail.com</email>
</author>
<published>2020-01-13T01:09:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=dfb676fe0d64c708c0c334b09c947db1bae4736d'/>
<id>dfb676fe0d64c708c0c334b09c947db1bae4736d</id>
<content type='text'>
After PR #8226 an unmapped META key in insert mode behaves like
ESC-&lt;key&gt; (:help i_META).

The behaviour does not fully match, since if &lt;Esc&gt;-&lt;key&gt; is pressed
manually then since it were pressed manually `gotchars` would be called
on the second &lt;key&gt; after insert-mode had already been left.

This would mean that `may_sync_undo` (called from `gotchars`) would
call `u_sync(FALSE)` on the second key (since we would be in normal
mode).

This overall means that &lt;Meta-[something]&gt; behaves differently with
respect to undo than &lt;Esc&gt;[something] when the [something] makes a
change.

As an example, under `nvim -u NONE`:
ihello&lt;M-.&gt;u

leaves the buffer empty, while
ihello&lt;Esc&gt;.u

leaves the buffer with one instance of `hello`.

- Fix by calling u_sync() manually in the new clause under
  `normalchar:` in `insert_handle_key`.
- Update test in tui_spec.lua that accidentally relied on the old behaviour.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After PR #8226 an unmapped META key in insert mode behaves like
ESC-&lt;key&gt; (:help i_META).

The behaviour does not fully match, since if &lt;Esc&gt;-&lt;key&gt; is pressed
manually then since it were pressed manually `gotchars` would be called
on the second &lt;key&gt; after insert-mode had already been left.

This would mean that `may_sync_undo` (called from `gotchars`) would
call `u_sync(FALSE)` on the second key (since we would be in normal
mode).

This overall means that &lt;Meta-[something]&gt; behaves differently with
respect to undo than &lt;Esc&gt;[something] when the [something] makes a
change.

As an example, under `nvim -u NONE`:
ihello&lt;M-.&gt;u

leaves the buffer empty, while
ihello&lt;Esc&gt;.u

leaves the buffer with one instance of `hello`.

- Fix by calling u_sync() manually in the new clause under
  `normalchar:` in `insert_handle_key`.
- Update test in tui_spec.lua that accidentally relied on the old behaviour.</pre>
</div>
</content>
</entry>
<entry>
<title>insert-mode: interpret unmapped META as ESC</title>
<updated>2018-04-04T01:23:15+00:00</updated>
<author>
<name>Justin M. Keyes</name>
<email>justinkz@gmail.com</email>
</author>
<published>2018-04-03T23:08:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=224ebc0078f29ac3189d7fbd9a59b386ae2ee303'/>
<id>224ebc0078f29ac3189d7fbd9a59b386ae2ee303</id>
<content type='text'>
closes #2454
closes #8213
ref #7972
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes #2454
closes #8213
ref #7972
</pre>
</div>
</content>
</entry>
</feed>
