Commit 0023eafc authored by Thorben Kroeger's avatar Thorben Kroeger Committed by hjk

FakeVim: fix yank register

The yank register "0 is only used when using y{motion} commands.
This fixes the following:

In normal mode:
input:  |aaa bbb ccc
keys:   yiw w diw "0P
result: aaa aaa ccc

Change-Id: I7fb8a62aed29b753ff8b129b5a8aa5f8e965026e
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 4f4de637
......@@ -6935,9 +6935,6 @@ void FakeVimHandler::Private::yankText(const Range &range, int reg)
// If register is not specified or " ...
if (m_register == '"') {
// copy to yank register 0 too
setRegister('0', text, range.rangemode);
// with delete and change commands set register 1 (if text contains more lines) or
// small delete register -
if (g.submode == DeleteSubMode || g.submode == ChangeSubMode) {
......@@ -6945,6 +6942,9 @@ void FakeVimHandler::Private::yankText(const Range &range, int reg)
setRegister('1', text, range.rangemode);
else
setRegister('-', text, range.rangemode);
} else {
// copy to yank register 0 too
setRegister('0', text, range.rangemode);
}
} else {
// Always copy to " register too.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment