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