diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index e90622722..2dd1b640b 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -2192,12 +2192,12 @@ void Notepad_plus::command(int id) case IDM_VIEW_UNFOLD_CURRENT: { bool isToggleEnabled = NppParameters::getInstance().getNppGUI()._enableFoldCmdToggable; - bool mode = id == IDM_VIEW_FOLD_CURRENT ? fold_collapse : fold_uncollapse; + bool mode = id == IDM_VIEW_FOLD_CURRENT ? fold_collapse : fold_expand; if (isToggleEnabled) { bool isFolded = _pEditView->isCurrentLineFolded(); - mode = isFolded ? fold_uncollapse : fold_collapse; + mode = isFolded ? fold_expand : fold_collapse; } _pEditView->foldCurrentPos(mode); @@ -2208,7 +2208,7 @@ void Notepad_plus::command(int id) case IDM_VIEW_UNFOLDALL: { _isFolding = true; // So we can ignore events while folding is taking place - bool doCollapse = (id==IDM_VIEW_FOLDALL)?fold_collapse:fold_uncollapse; + bool doCollapse = (id == IDM_VIEW_FOLDALL) ? fold_collapse : fold_expand; _pEditView->foldAll(doCollapse); if (_pDocMap) { @@ -2240,7 +2240,7 @@ void Notepad_plus::command(int id) case IDM_VIEW_UNFOLD_7: case IDM_VIEW_UNFOLD_8: _isFolding = true; // So we can ignore events while folding is taking place - _pEditView->collapse(id - IDM_VIEW_UNFOLD - 1, fold_uncollapse); + _pEditView->collapse(id - IDM_VIEW_UNFOLD - 1, fold_expand); _isFolding = false; break; diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 0caf3dfa4..3d3f0dc10 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -5726,7 +5726,7 @@ intptr_t CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam case NPPM_INTERNAL_SCINTILLAFINDERUNCOLLAPSE : { - _scintView.foldAll(fold_uncollapse); + _scintView.foldAll(fold_expand); return TRUE; } diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index a2d89eacb..152fe07e2 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -546,14 +546,15 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa MultiCaretInfo(int len, size_t n) : _len2remove(len), _selIndex(n) {}; }; - SHORT ctrl = GetKeyState(VK_CONTROL); - SHORT alt = GetKeyState(VK_MENU); - SHORT shift = GetKeyState(VK_SHIFT); bool isColumnSelection = (execute(SCI_GETSELECTIONMODE) == SC_SEL_RECTANGLE) || (execute(SCI_GETSELECTIONMODE) == SC_SEL_THIN); bool column2MultSelect = (NppParameters::getInstance()).getSVP()._columnSel2MultiEdit; if (wParam == VK_DELETE) { + SHORT ctrl = GetKeyState(VK_CONTROL); + SHORT alt = GetKeyState(VK_MENU); + SHORT shift = GetKeyState(VK_SHIFT); + if (!(shift & 0x8000) && !(ctrl & 0x8000) && !(alt & 0x8000)) // DEL & Multi-edit { size_t nbSelections = execute(SCI_GETSELECTIONS); @@ -574,8 +575,8 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa { size_t docLen = getCurrentDocLen(); - char eolStr[3]; - Sci_TextRangeFull tr; + char eolStr[3] = { '\0' }; + Sci_TextRangeFull tr {}; tr.chrg.cpMin = posStart; tr.chrg.cpMax = posEnd + 2; if (tr.chrg.cpMax > static_cast(docLen)) @@ -2464,7 +2465,7 @@ void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask) if (mask & BufferChangeLanguage) { defineDocType(buffer->getLangType()); - foldAll(fold_uncollapse); + foldAll(fold_expand); } if (mask & BufferChangeLexing) diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.h b/PowerEditor/src/ScintillaComponent/ScintillaEditView.h index 0b64c6eee..8e675413b 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.h @@ -89,7 +89,7 @@ const int CP_GREEK = 1253; #define LIST_7 128 #define LIST_8 256 -const bool fold_uncollapse = true; +const bool fold_expand = true; const bool fold_collapse = false; #define MAX_FOLD_COLLAPSE_LEVEL 8