Commit 0f8b5ef4 authored by Thorben Kroeger's avatar Thorben Kroeger Committed by hjk

FakeVim: fix black hole register

This fixes the following:

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

Change-Id: If66d80660c1bef5be1466883db30a87254065f00
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 0023eafc
......@@ -4566,7 +4566,7 @@ bool FakeVimHandler::Private::handleRegisterSubMode(const Input &input)
bool handled = false;
QChar reg = input.asChar();
if (QString::fromLatin1("*+.%#:-\"").contains(reg) || reg.isLetterOrNumber()) {
if (QString::fromLatin1("*+.%#:-\"_").contains(reg) || reg.isLetterOrNumber()) {
m_register = reg.unicode();
handled = true;
}
......@@ -6946,8 +6946,8 @@ void FakeVimHandler::Private::yankText(const Range &range, int reg)
// copy to yank register 0 too
setRegister('0', text, range.rangemode);
}
} else {
// Always copy to " register too.
} else if (m_register != '_') {
// Always copy to " register too (except black hole register).
setRegister('"', text, range.rangemode);
}
......
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