mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 10:40:20 +03:00
• Fixed the keybinding merge bug. The helper was restoring missing default commands
by overwriting an occupied default shortcut, which treated user bindings like mod+d=duplicate-line-or-selection as stale because that command is not in the default keybinding table. Now it only adds a default when the default shortcut is actually free. Added a regression test in src/tests/unit_tests/uicodeeditor_tests.cpp:108 covering the reported case: mod+d reassigned, then an extra mod+e=show-markdown-preview binding exists. This was reported in SpartanJ/ecode#914. • Implemented the splitter-level focus state cache, it will remember closed documents cursor state when reopened and it will restore cursor state per-code editor and not per-document (SpartanJ/ecode#893).
This commit is contained in:
@@ -58,22 +58,6 @@ void KeybindingsHelper::updateKeybindings(
|
||||
invertedKeybindings[key.second] = shortcutStr;
|
||||
ini.setValue( group, shortcutStr, key.second );
|
||||
added = true;
|
||||
} else if ( foundCmd == invertedKeybindings.end() ) {
|
||||
// Override the shortcut if the command that holds that
|
||||
// shortcut does not exists anymore
|
||||
auto kb = keybindings.find( shortcutStr );
|
||||
if ( kb != keybindings.end() ) {
|
||||
bool found = false;
|
||||
for ( const auto& val : defKeybindings )
|
||||
if ( val.second == kb->second )
|
||||
found = true;
|
||||
if ( !found ) {
|
||||
keybindings[shortcutStr] = key.second;
|
||||
invertedKeybindings[key.second] = shortcutStr;
|
||||
ini.setValue( group, shortcutStr, key.second );
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,22 +131,6 @@ void KeybindingsHelper::updateKeybindings(
|
||||
invertedKeybindings[key.second] = shortcutStr;
|
||||
ini.setValue( group, shortcutStr, key.second );
|
||||
added = true;
|
||||
} else if ( foundCmd == invertedKeybindings.end() ) {
|
||||
// Override the shortcut if the command that holds that
|
||||
// shortcut does not exists anymore
|
||||
auto kb = keybindings.find( shortcutStr );
|
||||
if ( kb != keybindings.end() ) {
|
||||
bool found = false;
|
||||
for ( const auto& val : defKeybindings )
|
||||
if ( val.second == kb->second )
|
||||
found = true;
|
||||
if ( !found ) {
|
||||
keybindings[shortcutStr] = key.second;
|
||||
invertedKeybindings[key.second] = shortcutStr;
|
||||
ini.setValue( group, shortcutStr, key.second );
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -235,22 +203,6 @@ void KeybindingsHelper::updateKeybindings(
|
||||
invertedKeybindings[key.second] = shortcutStr;
|
||||
ini.setValue( group, shortcutStr, key.second );
|
||||
added = true;
|
||||
} else if ( foundCmd == invertedKeybindings.end() ) {
|
||||
// Override the shortcut if the command that holds that
|
||||
// shortcut does not exists anymore
|
||||
auto kb = keybindings.find( shortcutStr );
|
||||
if ( kb != keybindings.end() ) {
|
||||
bool found = false;
|
||||
for ( const auto& val : defKeybindings )
|
||||
if ( val.second == kb->second )
|
||||
found = true;
|
||||
if ( !found ) {
|
||||
keybindings[shortcutStr] = key.second;
|
||||
invertedKeybindings[key.second] = shortcutStr;
|
||||
ini.setValue( group, shortcutStr, key.second );
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user