Skip to content

Commit 3796370

Browse files
committed
Added a call to pLayout->ClearAutoInsertionsHighlighting() back to the CPhraseBox::JumpForward() handler. It appears that BEW had accidentally removed this call which functioned to remove auto-insert highlighting when Enter/Tab is pressed, and that dated back to 2012. The call appears to have been accidentally removed when removing other surrounding code that was added temporarily in attempts to fix the issue of not being able to move the Phrasebox forward after the merger of a phrase.
1 parent b4651ed commit 3796370

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

source/PhraseBox.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -3644,6 +3644,24 @@ void CPhraseBox::JumpForward(CAdapt_ItView* pView)
36443644
wxLogDebug(_T("10. JumpForward() line %d , pApp->m_bAutoInsert = TRUE has just been set"), __LINE__);
36453645
#endif
36463646

3647+
// whm 25Aug2024 addition of pLayout->ClearAutoInsertionsHighlighting() back to this else block.
3648+
// In BEW's commit of 18Mar2024 (bd2539f2) he accidentally removed the pLayout->ClearAutoInsertionsHighlighting()
3649+
// call that previously existed in the code dating back to 2012. That call functioned to remove previously
3650+
// highlighted auto-insertions when an Enter key presss was subsequently made by the user.
3651+
// I think that in BEW's efforts to get his app to respond to an Enter/Tab key press after and merger, he
3652+
// accidentally removed this call which - not being called at this point - allows the auto-insert background
3653+
// purple color to persist even when Enter/Tab is pressed. To fix this issue I've added the call of
3654+
// pLayout->ClearAutoInsertionsHighlighting() back here below - along with BEW's original preceding comment.
3655+
//
3656+
// [BEW's original comment] User has pressed the Enter key (OnChar() calls JumpForward())
3657+
// BEW changed 9Apr12, to support discontinuous highlighting
3658+
// spans for auto-insertions...
3659+
// Since OnIdle() will call OnePass() and the latter will call
3660+
// MoveToNextPile(), and it is in MoveToNextPile() that CCell's
3661+
// m_bAutoInserted flag can get set TRUE, we only here need to ensure that the
3662+
// current location is a kick-off one, which we can do by clearing any earlier
3663+
// highlighting currently in effect
3664+
pLayout->ClearAutoInsertionsHighlighting();
36473665
} // end of else block for test for m_bSingleStep == TRUE, i.e. autoinserting
36483666

36493667
// save the phrase box's text, in case user hits SHIFT+End to unmerge a

0 commit comments

Comments
 (0)