mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-29 10:02:57 +03:00
parent
f87dbe410f
commit
7d9ec52bf2
@ -1298,7 +1298,7 @@ void save_selections(Context& context, NormalParams)
|
|||||||
{
|
{
|
||||||
on_next_key_with_autoinfo(context, KeymapMode::None,
|
on_next_key_with_autoinfo(context, KeymapMode::None,
|
||||||
[](Key key, Context& context) {
|
[](Key key, Context& context) {
|
||||||
if (key.modifiers != Key::Modifiers::None)
|
if (key.modifiers != Key::Modifiers::None or key == Key::Escape)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const char reg = key.key;
|
const char reg = key.key;
|
||||||
@ -1317,7 +1317,7 @@ void restore_selections(Context& context, NormalParams)
|
|||||||
{
|
{
|
||||||
on_next_key_with_autoinfo(context, KeymapMode::None,
|
on_next_key_with_autoinfo(context, KeymapMode::None,
|
||||||
[](Key key, Context& context) {
|
[](Key key, Context& context) {
|
||||||
if (key.modifiers != Key::Modifiers::None)
|
if (key.modifiers != Key::Modifiers::None or key == Key::Escape)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const char reg = key.key;
|
const char reg = key.key;
|
||||||
|
@ -74,6 +74,10 @@ Register& RegisterManager::operator[](StringView reg)
|
|||||||
|
|
||||||
Register& RegisterManager::operator[](Codepoint c)
|
Register& RegisterManager::operator[](Codepoint c)
|
||||||
{
|
{
|
||||||
|
c = tolower(c);
|
||||||
|
if (c < 32 or c > 127)
|
||||||
|
throw runtime_error(format("invalid register name: '{}'", c));
|
||||||
|
|
||||||
auto& reg_ptr = m_registers[c];
|
auto& reg_ptr = m_registers[c];
|
||||||
if (not reg_ptr)
|
if (not reg_ptr)
|
||||||
reg_ptr.reset(new StaticRegister());
|
reg_ptr.reset(new StaticRegister());
|
||||||
|
Loading…
Reference in New Issue
Block a user