Fix shortcut conflict detection error in shortcut mapper

https://github.com/notepad-plus-plus/notepad-plus-plus/issues/5374#issuecomment-891879420

Fix #5374
This commit is contained in:
Don Ho 2021-08-03 20:56:29 +02:00
parent a7ede53c26
commit 14a104ad46
1 changed files with 4 additions and 1 deletions

View File

@ -552,7 +552,10 @@ INT_PTR CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARAM
generic_string conflictInfo;
const bool isConflict = findKeyConflicts(&conflictInfo, *reinterpret_cast<KeyCombo*>(wParam), _babygrid.getSelectedRow() - 1);
// In case of using filter will make the filtered items change index, so here we get its real index
size_t realIndexOfSelectedItem = _shortcutIndex[_babygrid.getSelectedRow() - 1];
const bool isConflict = findKeyConflicts(&conflictInfo, *reinterpret_cast<KeyCombo*>(wParam), realIndexOfSelectedItem);
*reinterpret_cast<bool*>(lParam) = isConflict;
if (isConflict)