-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 30-Oct-2018 07:48 +0100, Christian Brabandt wrote:
> On Mo, 29 Okt 2018, Bok Woon Chua wrote: > >> I have an autocmd that saves the current file on InsertLeave. >> Using C-c in insert mode doesn't trigger this save (as desired), >> but if I use it into an inoremap mapping like so >> >> inoremap <C-a> <C-c>I >> >> ,it triggers InsertLeave whenever I use C-a to jump to the start >> of the line and hence saves the file. >> >> Is this intentional behavior? Is C-c supposed to avoid >> InsertLeave only if used interactively, rather than in a script? > > I believe this is intentionally and expected. <c-c> does not work > as "abort" key if it comes from a mapping (or has been mapped). Yes, that is the current behavior, but I agree with Bok Woon Chua that this is unexpected and inconsistent with how other mappings behave (i.e. they transparently forward the original behavior without changing it). The problem even occurs when mapping <C-c> onto itself (:inoremap <C-c> <C-c>). I know that relying on <C-c> not triggering InsertLeave is bad form, and Vim's Todo list is very long, but especially in light of the recent poll about what plugin writers want, fixing such inconsistencies would be very welcome. In some situations, details like this can make or break a plugin implementation. - -- regards, ingo -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJb2yyoAAoJEA7ziXlAzQ/v5cwH/0gksasIkvlUHudUCtajggyA hbbaHDO3BDm/dTdUt0pvu70LLo+srgW+MBvELcXWpWbIbaA/LmTMwXClUfUB8vgl 5myi2NZHy3n4rC9D5gO+dZ0ugmIt0+8dgVU4i1wZ+fyhSH3au9r8cecj+VaCnsLs UIP+UzJ3vVpCI97xcvWHe4h6oAXPc+MRBAnPLCmTiztRE/vvab4PMHjA75QI1ZRi K+FvOKS4Ixa13GWNuKwLeOtklyNgY3PvyFwI4eDqXT1q367/+g7IbM9y/+bIEpLp 2gg1islAFTvHJxv3INXJPWN2LNQJnHivxqDIhVH6YSStPGJGXjLLfCY7m3Pm+yw= =95xU -----END PGP SIGNATURE----- -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
