mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #1929 from RaiKoHoff/DevNewFeatures
Change/Fix Find/Replace Dialog behavior
This commit is contained in:
commit
ea849e606d
@ -1 +1 @@
|
||||
2717
|
||||
2718
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.20.129.2717"
|
||||
version="5.20.130.2718"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 BETA</description>
|
||||
|
||||
121
src/Edit.c
121
src/Edit.c
@ -2416,30 +2416,30 @@ void EditMoveDown(HWND hwnd)
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// EditJumpToSelectionStart()
|
||||
// EditSetCaretToSelectionStart()
|
||||
//
|
||||
void EditJumpToSelectionStart(HWND hwnd)
|
||||
DocPos EditSetCaretToSelectionStart()
|
||||
{
|
||||
UNUSED(hwnd);
|
||||
if (!Sci_IsMultiSelection()) {
|
||||
if (SciCall_GetCurrentPos() != SciCall_GetSelectionStart()) {
|
||||
SciCall_SwapMainAnchorCaret();
|
||||
}
|
||||
}
|
||||
return SciCall_GetSelectionStart();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// EditJumpToSelectionEnd()
|
||||
// EditSetCaretToSelectionEnd()
|
||||
//
|
||||
void EditJumpToSelectionEnd(HWND hwnd)
|
||||
DocPos EditSetCaretToSelectionEnd()
|
||||
{
|
||||
UNUSED(hwnd);
|
||||
if (!Sci_IsMultiSelection()) {
|
||||
if (SciCall_GetCurrentPos() != SciCall_GetSelectionEnd()) {
|
||||
SciCall_SwapMainAnchorCaret();
|
||||
}
|
||||
}
|
||||
return SciCall_GetSelectionEnd();
|
||||
}
|
||||
|
||||
|
||||
@ -4666,13 +4666,13 @@ void EditSetSelectionEx(HWND hwnd, DocPos iAnchorPos, DocPos iCurrentPos, DocPos
|
||||
iCurrentPos = Sci_GetDocEndPosition();
|
||||
}
|
||||
|
||||
DocLn const iNewLine = SciCall_LineFromPosition(iCurrentPos);
|
||||
DocLn const iCurrentLine = SciCall_LineFromPosition(iCurrentPos);
|
||||
DocLn const iAnchorLine = SciCall_LineFromPosition(iAnchorPos);
|
||||
|
||||
// Ensure that the first and last lines of a selection are always unfolded
|
||||
// This needs to be done *before* the SCI_SETSEL message
|
||||
SciCall_EnsureVisible(iAnchorLine);
|
||||
if (iAnchorLine != iNewLine) { SciCall_EnsureVisible(iNewLine); }
|
||||
if (iAnchorLine != iCurrentLine) { SciCall_EnsureVisible(iCurrentLine); }
|
||||
|
||||
if ((vSpcAnchor >= 0) && (vSpcCurrent >= 0)) {
|
||||
SciCall_SetRectangularSelectionAnchor(iAnchorPos);
|
||||
@ -4683,7 +4683,6 @@ void EditSetSelectionEx(HWND hwnd, DocPos iAnchorPos, DocPos iCurrentPos, DocPos
|
||||
if (vSpcCurrent > 0) {
|
||||
SciCall_SetRectangularSelectionCaretVirtualSpace(vSpcCurrent);
|
||||
}
|
||||
SciCall_ScrollRange(iAnchorPos, iCurrentPos);
|
||||
}
|
||||
else {
|
||||
SciCall_SetSel(iAnchorPos, iCurrentPos); // scrolls into view
|
||||
@ -4700,31 +4699,18 @@ void EditSetSelectionEx(HWND hwnd, DocPos iAnchorPos, DocPos iCurrentPos, DocPos
|
||||
//
|
||||
// EditEnsureSelectionVisible()
|
||||
//
|
||||
void EditEnsureSelectionVisible(HWND hwnd)
|
||||
void EditEnsureSelectionVisible()
|
||||
{
|
||||
DocPos iAnchorPos = 0;
|
||||
DocPos iCurrentPos = 0;
|
||||
DocPos iAnchorPosVS = -1;
|
||||
DocPos iCurPosVS = -1;
|
||||
DocLn const iCurrentLine = SciCall_LineFromPosition(SciCall_GetCurrentPos());
|
||||
DocLn const iAnchorLine = SciCall_LineFromPosition(SciCall_GetAnchor());
|
||||
|
||||
if (SciCall_IsSelectionRectangle())
|
||||
{
|
||||
iAnchorPos = SciCall_GetRectangularSelectionAnchor();
|
||||
iCurrentPos = SciCall_GetRectangularSelectionCaret();
|
||||
iAnchorPosVS = SciCall_GetRectangularSelectionAnchorVirtualSpace();
|
||||
iCurPosVS = SciCall_GetRectangularSelectionCaretVirtualSpace();
|
||||
}
|
||||
else if (Sci_IsMultiSelection()) {
|
||||
iAnchorPos = SciCall_GetSelectionNAnchor(0);
|
||||
iCurrentPos = SciCall_GetSelectionNCaret(0);
|
||||
iAnchorPosVS = SciCall_GetSelectionNAnchorVirtualSpace(0);
|
||||
iCurPosVS = SciCall_GetSelectionNCaretVirtualSpace(0);
|
||||
}
|
||||
else {
|
||||
iAnchorPos = SciCall_GetAnchor();
|
||||
iCurrentPos = SciCall_GetCurrentPos();
|
||||
}
|
||||
EditSetSelectionEx(hwnd, iAnchorPos, iCurrentPos, iAnchorPosVS, iCurPosVS);
|
||||
// Ensure that the first and last lines of a selection are always unfolded
|
||||
// This needs to be done *before* the SCI_SETSEL message
|
||||
SciCall_EnsureVisible(iAnchorLine);
|
||||
if (iAnchorLine != iCurrentLine) { SciCall_EnsureVisible(iCurrentLine); }
|
||||
|
||||
//SciCall_ScrollRange(SciCall_GetAnchor(), SciCall_GetCurrentPos());
|
||||
EditScrollTo(iCurrentLine, Settings2.CurrentLineVerticalSlop);
|
||||
}
|
||||
|
||||
|
||||
@ -5406,6 +5392,9 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
// the global static Find/Replace data structure
|
||||
SetWindowLongPtr(hwnd, DWLP_USER, (LONG_PTR)lParam);
|
||||
if (Globals.hDlgIcon) { SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hDlgIcon); }
|
||||
|
||||
EditSetCaretToSelectionStart(); // avoid search text selection jumps to next match (before ResizeDlg_InitX())
|
||||
|
||||
ResizeDlg_InitX(hwnd, Settings.FindReplaceDlgSizeX, IDC_RESIZEGRIP);
|
||||
|
||||
sg_pefrData = (LPEDITFINDREPLACE)GetWindowLongPtr(hwnd, DWLP_USER);
|
||||
@ -5558,19 +5547,15 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
hBrushGreen = CreateSolidBrush(rgbGreenColorRef);
|
||||
hBrushBlue = CreateSolidBrush(rgbBlueColorRef);
|
||||
|
||||
s_InitialSearchStart = SciCall_GetSelectionStart();
|
||||
s_InitialAnchorPos = SciCall_GetAnchor();
|
||||
s_InitialCaretPos = SciCall_GetCurrentPos();
|
||||
s_InitialTopLine = SciCall_GetFirstVisibleLine();
|
||||
|
||||
// find first occurrence of clip-board text
|
||||
//if (!Sci_IsMultiOrRectangleSelection() && SciCall_IsSelectionEmpty()) {
|
||||
// PostWMCommand(hwnd, IDOK);
|
||||
//}
|
||||
|
||||
SetTimer(hwnd, IDT_TIMER_MRKALL, USER_TIMER_MINIMUM, MQ_ExecuteNext);
|
||||
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -5623,7 +5608,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
EditSetSelectionEx(sg_pefrData->hwnd, s_InitialAnchorPos, s_InitialCaretPos, -1, -1);
|
||||
}
|
||||
else {
|
||||
EditEnsureSelectionVisible(sg_pefrData->hwnd);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
}
|
||||
|
||||
@ -5688,17 +5673,17 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
case WA_ACTIVE:
|
||||
SetWindowTransparentMode(hwnd, false, 100);
|
||||
|
||||
s_fwrdMatch = NO_MATCH;
|
||||
s_InitialSearchStart = SciCall_GetSelectionStart();
|
||||
|
||||
// selection changed ?
|
||||
if (s_InitialTopLine < 0) {
|
||||
s_InitialAnchorPos = SciCall_GetAnchor();
|
||||
s_InitialCaretPos = SciCall_GetCurrentPos();
|
||||
s_InitialTopLine = SciCall_GetFirstVisibleLine();
|
||||
s_InitialSearchStart = s_InitialCaretPos;
|
||||
s_fwrdMatch = NO_MATCH;
|
||||
}
|
||||
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
|
||||
bool const bEnableReplInSel = !(SciCall_IsSelectionEmpty() || Sci_IsMultiOrRectangleSelection());
|
||||
@ -5764,7 +5749,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
}
|
||||
// no recent find pattern: copy content clipboard to find box
|
||||
if (s_tchBuf[0] == L'\0') {
|
||||
char* pClip = EditGetClipboardText(Globals.hwndEdit, false, NULL, NULL);
|
||||
char* const pClip = EditGetClipboardText(Globals.hwndEdit, false, NULL, NULL);
|
||||
if (pClip) {
|
||||
size_t const len = StringCchLenA(pClip, 0);
|
||||
if (len) {
|
||||
@ -5799,9 +5784,11 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
SetDlgItemText(hwnd, IDC_FINDTEXT, s_tchBuf);
|
||||
GetDlgItemTextW2MB(hwnd, IDC_FINDTEXT, szFind, COUNTOF(szFind));
|
||||
}
|
||||
Globals.bFindReplCopySelOrClip = false;
|
||||
|
||||
s_anyMatch = s_fwrdMatch = NO_MATCH;
|
||||
}
|
||||
Globals.bFindReplCopySelOrClip = false;
|
||||
|
||||
} // Globals.bFindReplCopySelOrClip
|
||||
|
||||
GetDlgItemTextW2MB(hwnd, IDC_FINDTEXT, szCmpBuf, COUNTOF(szCmpBuf));
|
||||
if ((StringCchCompareXA(szCmpBuf, szFind) != 0)) {
|
||||
@ -5834,7 +5821,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
|
||||
if (HIWORD(wParam) == CBN_EDITCHANGE) {
|
||||
if ((HIWORD(wParam) == CBN_EDITCHANGE)) {
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
}
|
||||
}
|
||||
@ -5895,7 +5882,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
if (IsButtonChecked(hwnd, IDC_ALL_OCCURRENCES))
|
||||
{
|
||||
DialogEnableControl(hwnd, IDC_TOGGLE_VISIBILITY, true);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
}
|
||||
else { // switched OFF
|
||||
DialogEnableControl(hwnd, IDC_TOGGLE_VISIBILITY, false);
|
||||
@ -5919,7 +5906,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
}
|
||||
s_InitialTopLine = -1; // reset
|
||||
EditClearAllOccurrenceMarkers(sg_pefrData->hwnd);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -5939,13 +5926,13 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, SetBtn(s_SaveTFBackSlashes));
|
||||
}
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_DOT_MATCH_ALL:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_WILDCARDSEARCH:
|
||||
@ -5963,7 +5950,7 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
CheckDlgButton(hwnd, IDC_FINDTRANSFORMBS, SetBtn(s_SaveTFBackSlashes));
|
||||
}
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_FINDTRANSFORMBS:
|
||||
@ -5990,26 +5977,26 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
}
|
||||
}
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_FINDCASE:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_FINDWORD:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_FINDSTART:
|
||||
if (!sg_pefrData) { break; }
|
||||
_SetSearchFlags(hwnd, sg_pefrData);
|
||||
_DelayMarkAll(hwnd, 0, s_InitialSearchStart);
|
||||
_DelayMarkAll(hwnd, 50, s_InitialSearchStart);
|
||||
break;
|
||||
|
||||
case IDC_TRANSPARENT:
|
||||
@ -6101,7 +6088,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
case IDOK: // find next
|
||||
case IDACC_SELTONEXT:
|
||||
if (!bIsFindDlg) { Globals.bReplaceInitialized = true; }
|
||||
if (!SciCall_IsSelectionEmpty()) { EditJumpToSelectionEnd(sg_pefrData->hwnd); }
|
||||
EditFindNext(sg_pefrData->hwnd, sg_pefrData, (LOWORD(wParam) == IDACC_SELTONEXT), IsKeyDown(VK_F3));
|
||||
s_InitialSearchStart = SciCall_GetSelectionStart();
|
||||
s_InitialAnchorPos = SciCall_GetAnchor();
|
||||
@ -6112,9 +6098,8 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
case IDC_FINDPREV: // find previous
|
||||
case IDACC_SELTOPREV:
|
||||
if (!bIsFindDlg) { Globals.bReplaceInitialized = true; }
|
||||
if (!SciCall_IsSelectionEmpty()) { EditJumpToSelectionStart(sg_pefrData->hwnd); }
|
||||
EditFindPrev(sg_pefrData->hwnd, sg_pefrData, (LOWORD(wParam) == IDACC_SELTOPREV), IsKeyDown(VK_F3));
|
||||
s_InitialSearchStart = SciCall_GetSelectionEnd();
|
||||
s_InitialSearchStart = SciCall_GetSelectionStart();
|
||||
s_InitialAnchorPos = SciCall_GetAnchor();
|
||||
s_InitialCaretPos = SciCall_GetCurrentPos();
|
||||
s_InitialTopLine = -1; // reset
|
||||
@ -6186,8 +6171,6 @@ static INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wPara
|
||||
break;
|
||||
|
||||
case IDACC_FINDNEXT:
|
||||
//SetFocus(Globals.hwndMain);
|
||||
//SetForegroundWindow(Globals.hwndMain);
|
||||
PostWMCommand(hwnd, IDOK);
|
||||
break;
|
||||
|
||||
@ -6358,11 +6341,11 @@ bool EditFindNext(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bExtendSelection, bo
|
||||
if (slen <= 0) { return false; }
|
||||
int const sFlags = (int)(lpefr->fuFlags);
|
||||
|
||||
if (bFocusWnd)
|
||||
if (bFocusWnd) {
|
||||
SetFocus(hwnd);
|
||||
|
||||
}
|
||||
DocPos const iDocEndPos = Sci_GetDocEndPosition();
|
||||
DocPos start = SciCall_IsSelectionEmpty() ? SciCall_GetCurrentPos() : SciCall_GetSelectionEnd();
|
||||
DocPos start = EditSetCaretToSelectionEnd();
|
||||
DocPos end = iDocEndPos;
|
||||
|
||||
if (start >= end) {
|
||||
@ -6436,15 +6419,15 @@ bool EditFindPrev(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bExtendSelection, bo
|
||||
char szFind[FNDRPL_BUFFER];
|
||||
bool bSuppressNotFound = false;
|
||||
|
||||
if (bFocusWnd)
|
||||
if (bFocusWnd) {
|
||||
SetFocus(hwnd);
|
||||
|
||||
}
|
||||
DocPos const slen = _EditGetFindStrg(hwnd, lpefr, szFind, COUNTOF(szFind));
|
||||
if (slen <= 0) { return false; }
|
||||
int const sFlags = (int)(lpefr->fuFlags);
|
||||
|
||||
DocPos const iDocEndPos = Sci_GetDocEndPosition();
|
||||
DocPos start = SciCall_IsSelectionEmpty() ? SciCall_GetCurrentPos() : SciCall_GetSelectionStart();
|
||||
DocPos start = EditSetCaretToSelectionStart();
|
||||
DocPos end = 0;
|
||||
|
||||
if (start <= end) {
|
||||
@ -8555,7 +8538,7 @@ void EditToggleFolds(FOLD_ACTION action, bool bForceAll)
|
||||
fToggled |= _FoldToggleNode(ln, action);
|
||||
}
|
||||
}
|
||||
if (fToggled) { EditEnsureSelectionVisible(Globals.hwndEdit); }
|
||||
if (fToggled) { EditEnsureSelectionVisible(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,8 +59,8 @@ void EditSpacesToTabs(HWND hwnd,int nTabWidth,bool);
|
||||
|
||||
void EditMoveUp(HWND hwnd);
|
||||
void EditMoveDown(HWND hwnd);
|
||||
void EditJumpToSelectionEnd(HWND hwnd);
|
||||
void EditJumpToSelectionStart(HWND hwnd);
|
||||
DocPos EditSetCaretToSelectionStart();
|
||||
DocPos EditSetCaretToSelectionEnd();
|
||||
void EditModifyLines(HWND hwnd,LPCWSTR pwszPrefix,LPCWSTR pwszAppend);
|
||||
void EditIndentBlock(HWND hwnd,int cmd, bool bFormatIndentation, bool bForceAll);
|
||||
void EditAlignText(HWND hwnd,int nMode);
|
||||
@ -85,7 +85,7 @@ const DOCVIEWPOS_T EditGetCurrentDocView(HWND hwnd);
|
||||
void EditSetDocView(HWND hwnd, const DOCVIEWPOS_T docView);
|
||||
void EditSetSelectionEx(HWND hwnd, DocPos iAnchorPos, DocPos iCurrentPos, DocPos vSpcAnchor, DocPos vSpcCurrent);
|
||||
void EditFixPositions(HWND hwnd);
|
||||
void EditEnsureSelectionVisible(HWND hwnd);
|
||||
void EditEnsureSelectionVisible();
|
||||
void EditEnsureConsistentLineEndings(HWND hwnd);
|
||||
void EditGetExcerpt(HWND hwnd,LPWSTR lpszExcerpt,DWORD cchExcerpt);
|
||||
|
||||
|
||||
@ -1379,7 +1379,7 @@ HWND InitInstance(HINSTANCE hInstance,LPCWSTR pszCmdLine,int nCmdShow)
|
||||
if (s_flagJumpTo)
|
||||
EditJumpTo(Globals.hwndEdit, s_iInitialLine, s_iInitialColumn);
|
||||
else
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1408,14 +1408,14 @@ HWND InitInstance(HINSTANCE hInstance,LPCWSTR pszCmdLine,int nCmdShow)
|
||||
Settings.EFR_Data.bTransformBS = true;
|
||||
|
||||
if (s_flagMatchText & 2) {
|
||||
if (!s_flagJumpTo) { SendMessage(Globals.hwndEdit, SCI_DOCUMENTEND, 0, 0); }
|
||||
if (!s_flagJumpTo) { SciCall_DocumentEnd(); }
|
||||
EditFindPrev(Globals.hwndEdit,&Settings.EFR_Data,false,false);
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
else {
|
||||
if (!s_flagJumpTo) { SendMessage(Globals.hwndEdit, SCI_DOCUMENTSTART, 0, 0); }
|
||||
if (!s_flagJumpTo) { SciCall_DocumentStart(); }
|
||||
EditFindNext(Globals.hwndEdit,&Settings.EFR_Data,false,false);
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
}
|
||||
LocalFree(s_lpMatchArg); // StrDup()
|
||||
@ -4945,16 +4945,10 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
switch (iLoWParam) {
|
||||
|
||||
case IDM_EDIT_FINDNEXT:
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditJumpToSelectionEnd(Globals.hwndEdit);
|
||||
}
|
||||
EditFindNext(Globals.hwndEdit,&Settings.EFR_Data,false,false);
|
||||
break;
|
||||
|
||||
case IDM_EDIT_FINDPREV:
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditJumpToSelectionStart(Globals.hwndEdit);
|
||||
}
|
||||
EditFindPrev(Globals.hwndEdit,&Settings.EFR_Data,false,false);
|
||||
break;
|
||||
|
||||
@ -4968,16 +4962,10 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case IDM_EDIT_SELTONEXT:
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditJumpToSelectionEnd(Globals.hwndEdit);
|
||||
}
|
||||
EditFindNext(Globals.hwndEdit,&Settings.EFR_Data,true,false);
|
||||
break;
|
||||
|
||||
case IDM_EDIT_SELTOPREV:
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditJumpToSelectionStart(Globals.hwndEdit);
|
||||
}
|
||||
EditFindPrev(Globals.hwndEdit,&Settings.EFR_Data,true,false);
|
||||
break;
|
||||
}
|
||||
@ -5022,16 +5010,10 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
case CMD_FINDNEXTSEL:
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditJumpToSelectionEnd(Globals.hwndEdit);
|
||||
}
|
||||
EditFindNext(Globals.hwndEdit, &Settings.EFR_Data, false, false);
|
||||
break;
|
||||
|
||||
case CMD_FINDPREVSEL:
|
||||
if (!SciCall_IsSelectionEmpty()) {
|
||||
EditJumpToSelectionStart(Globals.hwndEdit);
|
||||
}
|
||||
EditFindPrev(Globals.hwndEdit, &Settings.EFR_Data, false, false);
|
||||
break;
|
||||
}
|
||||
@ -5099,7 +5081,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
Globals.fvCurFile.bWordWrap = !Globals.fvCurFile.bWordWrap;
|
||||
Settings.WordWrap = Globals.fvCurFile.bWordWrap;
|
||||
_SetWrapIndentMode(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
UpdateToolbar();
|
||||
break;
|
||||
|
||||
@ -6171,12 +6153,12 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
|
||||
case CMD_JUMP2SELSTART:
|
||||
EditJumpToSelectionStart(Globals.hwndEdit);
|
||||
EditSetCaretToSelectionStart();
|
||||
SciCall_ChooseCaretX();
|
||||
break;
|
||||
|
||||
case CMD_JUMP2SELEND:
|
||||
EditJumpToSelectionEnd(Globals.hwndEdit);
|
||||
EditSetCaretToSelectionEnd();
|
||||
SciCall_ChooseCaretX();
|
||||
break;
|
||||
|
||||
@ -9694,7 +9676,7 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
|
||||
SciCall_NewLine();
|
||||
_END_UNDO_ACTION_
|
||||
SciCall_DocumentEnd();
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
// set historic caret/selection pos
|
||||
else if ((iCaretPos >= 0) && (iAnchorPos >= 0))
|
||||
@ -9819,7 +9801,7 @@ bool FileRevert(LPCWSTR szFileName, bool bIgnoreCmdLnEnc)
|
||||
SciCall_ClearSelections();
|
||||
bPreserveView = false;
|
||||
SciCall_DocumentEnd();
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
}
|
||||
}
|
||||
|
||||
@ -10948,7 +10930,7 @@ void CALLBACK PasteBoardTimer(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
|
||||
SendMessage(Globals.hwndEdit,SCI_PASTE,0,0);
|
||||
SendMessage(Globals.hwndEdit,SCI_NEWLINE,0,0);
|
||||
_END_UNDO_ACTION_
|
||||
EditEnsureSelectionVisible(Globals.hwndEdit);
|
||||
EditEnsureSelectionVisible();
|
||||
Settings.AutoIndent = bAutoIndent2;
|
||||
}
|
||||
s_dwLastCopyTime = 0;
|
||||
|
||||
@ -268,6 +268,7 @@ DeclareSciCallV1(SetMultiPaste, SETMULTIPASTE, int, option)
|
||||
|
||||
DeclareSciCallV1(GotoPos, GOTOPOS, DocPos, position)
|
||||
DeclareSciCallV1(GotoLine, GOTOLINE, DocLn, line)
|
||||
DeclareSciCallV0(DocumentStart, DOCUMENTSTART)
|
||||
DeclareSciCallV0(DocumentEnd, DOCUMENTEND)
|
||||
DeclareSciCallR1(PositionBefore, POSITIONBEFORE, DocPos, DocPos, position)
|
||||
DeclareSciCallR1(PositionAfter, POSITIONAFTER, DocPos, DocPos, position)
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
#define SAPPNAME "Notepad3"
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 20
|
||||
#define VERSION_REV 129
|
||||
#define VERSION_BUILD 2717
|
||||
#define VERSION_REV 130
|
||||
#define VERSION_BUILD 2718
|
||||
#define SCINTILLA_VER 430
|
||||
#define ONIGURUMA_REGEX_VER 6.9.4
|
||||
#define UCHARDET_VER 2018.09.27
|
||||
|
||||
Loading…
Reference in New Issue
Block a user