Comments (6)
Checked a vim version 8.0.197 from 2017 and there the bug wasn't present, so this has apparently not been around forever.
from vim.
Seems it got introduced here (#7527):
commit 032a2d050b82b146d70d6ff714838ee62c07d8ad
Author: Bram Moolenaar <[email protected]>
Date: Tue Dec 22 17:59:35 2020 +0100
patch 8.2.2189: cannot repeat a command that uses the small delete register
Problem: Cannot repeat a command that uses the small delete register.
Solution: Store the register name instead of the contents. (Christian
Brabandt, closes #7527)
src/ops.c | 2 +-
src/register.c | 9 ++++++++-
src/testdir/test_registers.vim | 11 +++++++++++
src/version.c | 2 ++
4 files changed, 22 insertions(+), 2 deletions(-)
from vim.
intersting that it wasn't noticed earlier. It also seems to affect i_Ctrl-R_Ctrl-O
and i_Ctrl-R_Ctrl-P
from vim.
Is it okay, if we allow this only for actual insert mode?
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 8696e912f..31abe7d94 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt* For Vim version 9.0. Last change: 2022 Sep 30
+*insert.txt* For Vim version 9.0. Last change: 2022 Dec 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -131,7 +131,8 @@ CTRL-R {register} *i_CTRL-R*
'-' the last small (less than a line) delete
register. This is repeatable using |.| since
it remembers the register to put instead of
- the literal text to insert.
+ the literal text to insert. (not repeatable
+ in |Replace-mode|)
*i_CTRL-R_=*
'=' the expression register: you are prompted to
enter an expression (see |expression|)
@@ -162,6 +163,7 @@ CTRL-R CTRL-R {register} *i_CTRL-R_CTRL-R*
typed.
After this command, the '.' register contains the text from
the register as if it was inserted by typing it.
+ Not supported in |Replace-mode|.
CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
Insert the contents of a register literally and don't
@@ -173,7 +175,7 @@ CTRL-R CTRL-O {register} *i_CTRL-R_CTRL-O*
typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^O" and not the
- text from the register.
+ text from the register. Not supported in |Replace-mode|.
CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
Insert the contents of a register literally and fix the
@@ -183,7 +185,7 @@ CTRL-R CTRL-P {register} *i_CTRL-R_CTRL-P*
typed.
After this command, the '.' register contains the command
typed and not the text. I.e., the literals "^R^P" and not the
- text from the register.
+ text from the register. Not supported in |Replace-mode|.
*i_CTRL-T*
CTRL-T Insert one shiftwidth of indent at the start of the current
diff --git a/src/edit.c b/src/edit.c
index 9435fd6fc..4087aba93 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3436,7 +3436,8 @@ ins_reg(void)
else
{
#endif
- if (literally == Ctrl_O || literally == Ctrl_P)
+ if ((literally == Ctrl_O || literally == Ctrl_P)
+ && !(State & REPLACE_FLAG))
{
// Append the command to the redo buffer.
AppendCharToRedobuff(Ctrl_R);
diff --git a/src/register.c b/src/register.c
index 1d0e46bd0..0f92b0084 100644
--- a/src/register.c
+++ b/src/register.c
@@ -826,7 +826,7 @@ insert_reg(
{
for (i = 0; i < y_current->y_size; ++i)
{
- if (regname == '-')
+ if (regname == '-' && !(State & REPLACE_FLAG))
{
AppendCharToRedobuff(Ctrl_R);
AppendCharToRedobuff(regname);
from vim.
Is it okay, if we allow this only for actual insert mode?
You could have always said "... at least for now?" But it's nice to see the honesty;-)
from vim.
yeah 🙈, But seriously it seems tricky to get number of characters right, that need to be deleted, for the small delete register this seems doable, but for i_Ctrl-R_Ctrl-P
(which needs to re-indent, this will be harder).
And I don't remember for how long we have i_Ctrl-R_Ctrl-P
(it's longer than the mentioned small delete change) and still nobody has noticed and complained about it until now.
from vim.
Related Issues (20)
- Remove/modify filetype indent for asm files HOT 4
- Add commentstring for dart filetypes HOT 2
- select breaks syntax highlighting in bash HOT 7
- [vim9]Memory Leak when assigning a lambda function decorated in a HigherOrder function to a variable
- Escaped `,` and `:` in patterns in `b:match_words` is not correctly unescaped
- listchars: trailmultispace to easily identify the number of trailing spaces HOT 6
- Msys vim's executable() can't find programs despite them being add in the PATH HOT 10
- Minor syntax highlighting issue with swayconfig files HOT 3
- no help for comment.txt for the newly introduced comment.vim plugin HOT 3
- search() vs ignorecase vs smartcase HOT 4
- A correction to the docs HOT 2
- New compiler warnings in 9.1.444 HOT 4
- HighlightedYank feature HOT 10
- No indentation of HTML tags in PHP files HOT 2
- Update defaults.vim HOT 9
- Update syntax/markdown.vim: Don't allow space between link text and URL HOT 1
- [''] and [{}] behave differently as repeat function parameter HOT 2
- Vim syntax bug HOT 4
- how to use Vim
- :echo works incorrectly in gVim HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim.