src/Notepad3.c
inline static LRESULT _MsgNotifyLean(const LPNMHDR pnmh, const SCNotification* const scn)
{
  // --- check only mandatory events (must be fast !!!) ---
  if (pnmh->idFrom == IDC_EDIT) {
    if (pnmh->code == SCN_MODIFIED) {
      bool bModified = true;
      int const iModType = scn->modificationType;
      if ((iModType & SC_MOD_BEFOREINSERT) || ((iModType & SC_MOD_BEFOREDELETE))) {
        if (!((iModType & SC_PERFORMED_UNDO) || (iModType & SC_PERFORMED_REDO))) {
          if ((!_InUndoRedoTransaction() && !SciCall_IsSelectionEmpty()) || Sci_IsMultiOrRectangleSelection()) {
            _SaveRedoSelection(_SaveUndoSelection());
          }
        }
        bModified = false; // not yet
      }
      // check for ADDUNDOACTION step
      if (iModType & SC_MOD_CONTAINER)
      {
        if (iModType & SC_PERFORMED_UNDO) {
          RestoreAction(scn->token, UNDO);
        }
        else if (iModType & SC_PERFORMED_REDO) {
          RestoreAction(scn->token, REDO);
        }
      }
      if (bModified) {
        DWORD const timeout = Settings2.UndoTransactionTimeout;
        if (timeout != 0UL) {
          if (timeout > _MQ_IMMEDIATE) {
            _DelaySplitUndoTransaction(timeout, iModType);
          }
          else {
            _SplitUndoTransaction(iModType);
          }
        }
        SetSaveNeeded(true);
      }
    }
    else if (pnmh->code == SCN_SAVEPOINTREACHED) {
      SetSaveNeeded(false);
    }
    else if (pnmh->code == SCN_SAVEPOINTLEFT) {
      SetSaveNeeded(true);
    }
    else if (pnmh->code == SCN_MODIFYATTEMPTRO) {
      if (FocusedView.HideNonMatchedLines) { EditToggleView(Globals.hwndEdit); }
    }
  }
  return TRUE;
}
//=============================================================================
//
//  MsgNotifyLean() - Handles WM_NOTIFY (only absolute neccessary events)
//
//  !!! Set correct SCI_SETMODEVENTMASK in _InitializeSciEditCtrl()
//

Handles WM_NOTIFY (only absolute neccessary events)
Set correct SCI_SETMODEVENTMASK in _InitializeSciEditCtrl()
Handles WM_NOTIFY ( only absolute neccessary events ) Set correct SCI_SETMODEVENTMASK in _InitializeSciEditCtrl ()
inline static LRESULT _MsgNotifyLean(const LPNMHDR pnmh, const SCNotification* const scn)
{
  if (pnmh->idFrom == IDC_EDIT) {
    if (pnmh->code == SCN_MODIFIED) {
      bool bModified = true;
      int const iModType = scn->modificationType;
      if ((iModType & SC_MOD_BEFOREINSERT) || ((iModType & SC_MOD_BEFOREDELETE))) {
        if (!((iModType & SC_PERFORMED_UNDO) || (iModType & SC_PERFORMED_REDO))) {
          if ((!_InUndoRedoTransaction() && !SciCall_IsSelectionEmpty()) || Sci_IsMultiOrRectangleSelection()) {
            _SaveRedoSelection(_SaveUndoSelection());
          }
        }
        bModified = false; 
      }
      if (iModType & SC_MOD_CONTAINER)
      {
        if (iModType & SC_PERFORMED_UNDO) {
          RestoreAction(scn->token, UNDO);
        }
        else if (iModType & SC_PERFORMED_REDO) {
          RestoreAction(scn->token, REDO);
        }
      }
      if (bModified) {
        DWORD const timeout = Settings2.UndoTransactionTimeout;
        if (timeout != 0UL) {
          if (timeout > _MQ_IMMEDIATE) {
            _DelaySplitUndoTransaction(timeout, iModType);
          }
          else {
            _SplitUndoTransaction(iModType);
          }
        }
        SetSaveNeeded(true);
      }
    }
    else if (pnmh->code == SCN_SAVEPOINTREACHED) {
      SetSaveNeeded(false);
    }
    else if (pnmh->code == SCN_SAVEPOINTLEFT) {
      SetSaveNeeded(true);
    }
    else if (pnmh->code == SCN_MODIFYATTEMPTRO) {
      if (FocusedView.HideNonMatchedLines) { EditToggleView(Globals.hwndEdit); }
    }
  }
  return TRUE;
}
inline static LRESULT _MsgNotifyLean ( const LPNMHDR pnmh , const SCNotification * const scn ) { if ( pnmh -> idFrom == IDC_EDIT ) { if ( pnmh -> code == SCN_MODIFIED ) { bool bModified = true ; int const iModType = scn -> modificationType ; if ( ( iModType & SC_MOD_BEFOREINSERT ) || ( ( iModType & SC_MOD_BEFOREDELETE ) ) ) { if ( ! ( ( iModType & SC_PERFORMED_UNDO ) || ( iModType & SC_PERFORMED_REDO ) ) ) { if ( ( ! _InUndoRedoTransaction ( ) && ! SciCall_IsSelectionEmpty ( ) ) || Sci_IsMultiOrRectangleSelection ( ) ) { _SaveRedoSelection ( _SaveUndoSelection ( ) ) ; } } bModified = false ; } if ( iModType & SC_MOD_CONTAINER ) { if ( iModType & SC_PERFORMED_UNDO ) { RestoreAction ( scn -> token , UNDO ) ; } else if ( iModType & SC_PERFORMED_REDO ) { RestoreAction ( scn -> token , REDO ) ; } } if ( bModified ) { DWORD const timeout = Settings2 . UndoTransactionTimeout ; if ( timeout != 0UL ) { if ( timeout > _MQ_IMMEDIATE ) { _DelaySplitUndoTransaction ( timeout , iModType ) ; } else { _SplitUndoTransaction ( iModType ) ; } } SetSaveNeeded ( true ) ; } } else if ( pnmh -> code == SCN_SAVEPOINTREACHED ) { SetSaveNeeded ( false ) ; } else if ( pnmh -> code == SCN_SAVEPOINTLEFT ) { SetSaveNeeded ( true ) ; } else if ( pnmh -> code == SCN_MODIFYATTEMPTRO ) { if ( FocusedView . HideNonMatchedLines ) { EditToggleView ( Globals . hwndEdit ) ; } } } return TRUE ; }
MsgNotifyLean() - Handles WM_NOTIFY (only absolute neccessary events)
 Set correct SCI_SETMODEVENTMASK in _InitializeSciEditCtrl()
MsgNotifyLean () - Handles WM_NOTIFY ( only absolute neccessary events ) Set correct SCI_SETMODEVENTMASK in _InitializeSciEditCtrl ()
// --- check only mandatory events (must be fast !!!) ---
 // not yet
 // check for ADDUNDOACTION step
