Mercurial > vim
comparison src/normal.c @ 32049:717a1a8dc751 v9.0.1356
patch 9.0.1356: cannot cancel "gr" with Esc
Commit: https://github.com/vim/vim/commit/4f026ea9f1ad9db262f0dba522768c84e5ae37b4
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Feb 26 14:47:24 2023 +0000
patch 9.0.1356: cannot cancel "gr" with Esc
Problem: Cannot cancel "gr" with Esc.
Solution: Make "gr<Esc>" do nothing. (closes https://github.com/vim/vim/issues/12064)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Feb 2023 16:00:05 +0100 |
parents | 55926b4f2246 |
children | cbf0ed5c83d0 |
comparison
equal
deleted
inserted
replaced
32048:0c1c18056343 | 32049:717a1a8dc751 |
---|---|
513 { | 513 { |
514 cap->cmdchar = Ctrl_BSL; | 514 cap->cmdchar = Ctrl_BSL; |
515 cap->nchar = cap->extra_char; | 515 cap->nchar = cap->extra_char; |
516 idx = find_command(cap->cmdchar); | 516 idx = find_command(cap->cmdchar); |
517 } | 517 } |
518 else if ((cap->nchar == 'n' || cap->nchar == 'N') && cap->cmdchar == 'g') | 518 else if ((cap->nchar == 'n' || cap->nchar == 'N') |
519 && cap->cmdchar == 'g') | |
519 cap->oap->op_type = get_op_type(*cp, NUL); | 520 cap->oap->op_type = get_op_type(*cp, NUL); |
520 else if (*cp == Ctrl_BSL) | 521 else if (*cp == Ctrl_BSL) |
521 { | 522 { |
522 long towait = (p_ttm >= 0 ? p_ttm : p_tm); | 523 long towait = (p_ttm >= 0 ? p_ttm : p_tm); |
523 | 524 |
5022 cap->nchar = cap->extra_char; | 5023 cap->nchar = cap->extra_char; |
5023 nv_replace(cap); // Do same as "r" in Visual mode for now | 5024 nv_replace(cap); // Do same as "r" in Visual mode for now |
5024 return; | 5025 return; |
5025 } | 5026 } |
5026 | 5027 |
5027 if (checkclearopq(cap->oap)) | 5028 if (checkclearopq(cap->oap) || cap->extra_char == ESC) |
5028 return; | 5029 return; |
5029 | 5030 |
5030 if (!curbuf->b_p_ma) | 5031 if (!curbuf->b_p_ma) |
5031 emsg(_(e_cannot_make_changes_modifiable_is_off)); | 5032 emsg(_(e_cannot_make_changes_modifiable_is_off)); |
5032 else | 5033 else |