Fix macro playback inseting/removing characters randomly.

Fix macro playback inseting/removing characters randomly due to
auto-insert interfering during macro recording and playing back. (fixes
#649, fixes #970, fixes #304, fixes #992)
This commit is contained in:
Don Ho 2015-10-07 17:55:29 +02:00
parent 35adb1910b
commit 981ee5ed72
3 changed files with 17 additions and 10 deletions

View File

@ -369,6 +369,7 @@ private:
// Keystroke macro recording and playback
Macro _macro;
bool _recordingMacro = false;
bool _playingBackMacro = false;
RunMacroDlg _runMacroDlg;
// For hotspot

View File

@ -637,7 +637,11 @@ void Notepad_plus::command(int id)
case IDM_MACRO_PLAYBACKRECORDEDMACRO:
if (!_recordingMacro) // if we're not currently recording, then playback the recorded keystrokes
{
_playingBackMacro = true;
macroPlayback(_macro);
_playingBackMacro = false;
}
break;
case IDM_MACRO_RUNMULTIMACRODLG :

View File

@ -515,17 +515,19 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_CHARADDED:
{
const NppGUI & nppGui = NppParameters::getInstance()->getNppGUI();
bool indentMaintain = nppGui._maitainIndent;
if (indentMaintain)
maintainIndentation(static_cast<TCHAR>(notification->ch));
AutoCompletion * autoC = isFromPrimary?&_autoCompleteMain:&_autoCompleteSub;
bool isColumnMode = _pEditView->execute(SCI_GETSELECTIONS) > 1; // Multi-Selection || Column mode)
if (nppGui._matchedPairConf.hasAnyPairsPair() && !isColumnMode)
autoC->insertMatchedChars(notification->ch, nppGui._matchedPairConf);
autoC->update(notification->ch);
if (!_recordingMacro && !_playingBackMacro) // No macro recording or playing back
{
const NppGUI & nppGui = NppParameters::getInstance()->getNppGUI();
bool indentMaintain = nppGui._maitainIndent;
if (indentMaintain)
maintainIndentation(static_cast<TCHAR>(notification->ch));
AutoCompletion * autoC = isFromPrimary ? &_autoCompleteMain : &_autoCompleteSub;
bool isColumnMode = _pEditView->execute(SCI_GETSELECTIONS) > 1; // Multi-Selection || Column mode)
if (nppGui._matchedPairConf.hasAnyPairsPair() && !isColumnMode)
autoC->insertMatchedChars(notification->ch, nppGui._matchedPairConf);
autoC->update(notification->ch);
}
break;
}