mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ fix: cleanup obsolete rectangular pasting helpers
This commit is contained in:
parent
efa7f89272
commit
8405c36b44
205
src/Edit.c
205
src/Edit.c
@ -570,8 +570,8 @@ bool EditIsRecodingNeeded(WCHAR* pszText, int cchLen)
|
||||
//
|
||||
// EditGetClipboardText()
|
||||
//
|
||||
char* EditGetClipboardText(HWND hwnd,bool bCheckEncoding,int* pLineCount,int* pLenLastLn) {
|
||||
|
||||
char* EditGetClipboardText(HWND hwnd, bool bCheckEncoding, int* pLineCount, int* pLenLastLn)
|
||||
{
|
||||
if (!IsClipboardFormatAvailable(CF_UNICODETEXT) || !OpenClipboard(GetParent(hwnd))) {
|
||||
char* pEmpty = StrDupA("");
|
||||
return (pEmpty);
|
||||
@ -613,7 +613,9 @@ char* EditGetClipboardText(HWND hwnd,bool bCheckEncoding,int* pLineCount,int* pL
|
||||
|
||||
int lineCount = 0;
|
||||
int lenLastLine = 0;
|
||||
if ((bool)SendMessage(hwnd,SCI_GETPASTECONVERTENDINGS,0,0)) {
|
||||
|
||||
if ((bool)SendMessage(hwnd,SCI_GETPASTECONVERTENDINGS,0,0))
|
||||
{
|
||||
char* ptmp = LocalAlloc(LPTR,mlen * 2 + 2);
|
||||
if (ptmp) {
|
||||
char *s = pmch;
|
||||
@ -731,178 +733,53 @@ bool EditClearClipboard(HWND hwnd)
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// EditPaste2RectSel()
|
||||
// EditSwapClipboard()
|
||||
//
|
||||
void EditPaste2RectSel(HWND hwnd, char* pText)
|
||||
bool EditSwapClipboard(HWND hwnd, bool bSkipUnicodeCheck)
|
||||
{
|
||||
if (!SciCall_IsSelectionRectangle()) { return; }
|
||||
|
||||
const DocPos length = lstrlenA(pText); // '\0' terminated
|
||||
|
||||
_IGNORE_NOTIFY_CHANGE_;
|
||||
_ENTER_TARGET_TRANSACTION_;
|
||||
|
||||
const DocPosU selCount = (DocPosU)SendMessage(hwnd, SCI_GETSELECTIONS, 0, 0);
|
||||
|
||||
char* pTextLine = pText;
|
||||
// remove line-break from last line
|
||||
if (*pTextLine != '\0') { StrTrimA(pTextLine, "\r\n"); }
|
||||
|
||||
for (DocPosU s = 0; s < selCount; ++s) {
|
||||
// get lines from clip
|
||||
char *ln = pTextLine;
|
||||
int lnLen = 0;
|
||||
while (*ln != '\0') {
|
||||
if (s < (selCount - 1)) {
|
||||
if (*ln == '\n' || *ln == '\r') {
|
||||
if ((*ln == '\r') && (*(ln + 1) == '\n')) { ++ln; }
|
||||
++ln; // next line
|
||||
break;
|
||||
}
|
||||
else { ++ln; ++lnLen; }
|
||||
}
|
||||
else { ++ln; ++lnLen; } // last line
|
||||
}
|
||||
|
||||
const DocPos selCaretPos = SciCall_GetSelectionNCaret(s);
|
||||
const DocPos selAnchorPos = SciCall_GetSelectionNAnchor(s);
|
||||
const DocPos selCaretVspc = SciCall_GetSelectionNCaretVirtualSpace(s);
|
||||
const DocPos selAnchorVspc = SciCall_GetSelectionNAnchorVirtualSpace(s);
|
||||
|
||||
DocPos virtualSpaceLen = 0;
|
||||
DocPos selTargetStart = 0;
|
||||
DocPos selTargetEnd = 0;
|
||||
if (selCaretPos < selAnchorPos) {
|
||||
selTargetStart = selCaretPos;
|
||||
selTargetEnd = selAnchorPos;
|
||||
virtualSpaceLen = selCaretVspc;
|
||||
}
|
||||
else {
|
||||
selTargetStart = selAnchorPos;
|
||||
selTargetEnd = selCaretPos;
|
||||
virtualSpaceLen = selAnchorVspc;
|
||||
}
|
||||
|
||||
if (virtualSpaceLen > 0) {
|
||||
char* pPadStr = LocalAlloc(LPTR, (virtualSpaceLen + length + 1) * sizeof(char));
|
||||
if (pPadStr) {
|
||||
SIZE_T size = LocalSize(pPadStr) - sizeof(char);
|
||||
FillMemory(pPadStr, virtualSpaceLen, ' ');
|
||||
pPadStr[virtualSpaceLen] = '\0';
|
||||
StringCchCatNA(pPadStr, size, pTextLine, lnLen);
|
||||
SciCall_SetTargetRange(selTargetStart, selTargetEnd);
|
||||
SciCall_ReplaceTarget(lstrlenA(pPadStr), pPadStr);
|
||||
LocalFree(pPadStr);
|
||||
}
|
||||
else {
|
||||
SciCall_SetTargetRange(selTargetStart, selTargetEnd);
|
||||
SciCall_ReplaceTarget(lnLen, pTextLine);
|
||||
}
|
||||
}
|
||||
else // no virtual space to pad
|
||||
{
|
||||
SciCall_SetTargetRange(selTargetStart, selTargetEnd);
|
||||
SciCall_ReplaceTarget(lnLen, pTextLine);
|
||||
}
|
||||
|
||||
//SciCall_SetSelectionNAnchor(s, selTargetStart);
|
||||
//SciCall_SetSelectionNCaret(s, selTargetStart);
|
||||
//if (virtualSpaceLen > 0) {
|
||||
// SciCall_SetSelectionNCaretVirtualSpace(s, virtualSpaceLen);
|
||||
// SciCall_SetSelectionNAnchorVirtualSpace(s, virtualSpaceLen);
|
||||
//}
|
||||
|
||||
if (*ln != '\0') {
|
||||
pTextLine = ln; // next clip line
|
||||
}
|
||||
//else: rest of rect single selections are filled with last line
|
||||
|
||||
} // for()
|
||||
|
||||
_LEAVE_TARGET_TRANSACTION_;
|
||||
_OBSERVE_NOTIFY_CHANGE_;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// EditPasteClipboard()
|
||||
//
|
||||
bool EditPasteClipboard(HWND hwnd, bool bSwapClipBoard, bool bSkipUnicodeCheck)
|
||||
{
|
||||
int lineCount = 0;
|
||||
int lenLastLine = 0;
|
||||
|
||||
char* pClip = EditGetClipboardText(hwnd, !bSkipUnicodeCheck, &lineCount, &lenLastLine);
|
||||
char* const pClip = EditGetClipboardText(hwnd, !bSkipUnicodeCheck, &lineCount, &lenLastLine);
|
||||
if (!pClip) {
|
||||
return false; // recoding canceled
|
||||
}
|
||||
const DocPos clipLen = lstrlenA(pClip);
|
||||
DocPos const clipLen = lstrlenA(pClip);
|
||||
|
||||
const DocPos iCurPos = SciCall_GetCurrentPos();
|
||||
const DocPos iAnchorPos = SciCall_GetAnchor();
|
||||
DocPos const iCurPos = SciCall_GetCurrentPos();
|
||||
DocPos const iAnchorPos = SciCall_GetAnchor();
|
||||
bool const bIsRectSel = SciCall_IsSelectionRectangle();
|
||||
|
||||
if (SciCall_IsSelectionEmpty() || (lineCount <= 1))
|
||||
{
|
||||
_IGNORE_NOTIFY_CHANGE_;
|
||||
|
||||
if (SciCall_IsSelectionEmpty()) // SC_SEL_THIN
|
||||
{
|
||||
SciCall_Paste();
|
||||
if (bSwapClipBoard) {
|
||||
EditClearClipboard(hwnd);
|
||||
EditSelectEx(hwnd, iAnchorPos, SciCall_GetCurrentPos(), -1, -1);
|
||||
}
|
||||
//else {
|
||||
// EditSelectEx(hwnd, SciCall_GetCurrentPos(), SciCall_GetCurrentPos(), -1, -1);
|
||||
//}
|
||||
}
|
||||
else {
|
||||
char* pszText = LocalAlloc(LPTR, SciCall_GetSelText(NULL));
|
||||
SciCall_GetSelText(pszText);
|
||||
if (clipLen == 0) { SciCall_Clear(); } else { SciCall_Paste(); }
|
||||
if (bSwapClipBoard) {
|
||||
EditSetClipboardText(hwnd, pszText);
|
||||
if (iCurPos < iAnchorPos)
|
||||
EditSelectEx(hwnd, SciCall_GetCurrentPos(), iCurPos, -1, -1);
|
||||
else
|
||||
EditSelectEx(hwnd, iAnchorPos, SciCall_GetCurrentPos(), -1, -1);
|
||||
}
|
||||
else {
|
||||
if (iCurPos < iAnchorPos)
|
||||
EditSelectEx(hwnd, iCurPos, iCurPos, -1, -1);
|
||||
}
|
||||
LocalFree(pszText);
|
||||
}
|
||||
_OBSERVE_NOTIFY_CHANGE_;
|
||||
char* pszText = NULL;
|
||||
SIZE_T const size = SciCall_GetSelText(NULL);
|
||||
if (size > 0) {
|
||||
pszText = LocalAlloc(LPTR, size);
|
||||
SciCall_GetSelText(pszText);
|
||||
SciCall_Paste(); //~SciCall_ReplaceSel(pClip);
|
||||
EditSetClipboardText(hwnd, pszText);
|
||||
}
|
||||
else {
|
||||
if (SciCall_IsSelectionRectangle())
|
||||
{
|
||||
if (bSwapClipBoard) { SciCall_Copy(); }
|
||||
EditPaste2RectSel(hwnd, pClip);
|
||||
//TODO: restore selection in case of swap clipboard
|
||||
}
|
||||
else // Selection: SC_SEL_STREAM, SC_SEL_LINES
|
||||
{
|
||||
_IGNORE_NOTIFY_CHANGE_;
|
||||
if (bSwapClipBoard) {
|
||||
SciCall_Copy();
|
||||
SciCall_ReplaceSel(pClip);
|
||||
if (iCurPos < iAnchorPos)
|
||||
EditSelectEx(hwnd, iCurPos + clipLen, iCurPos, -1, -1);
|
||||
else
|
||||
EditSelectEx(hwnd, iAnchorPos, iAnchorPos + clipLen, -1, -1);
|
||||
}
|
||||
else {
|
||||
SciCall_ReplaceSel(pClip);
|
||||
if (iCurPos < iAnchorPos)
|
||||
EditSelectEx(hwnd, iCurPos, iCurPos, -1, -1);
|
||||
}
|
||||
_OBSERVE_NOTIFY_CHANGE_;
|
||||
}
|
||||
SciCall_Paste(); //~SciCall_ReplaceSel(pClip);
|
||||
SciCall_Clear();
|
||||
}
|
||||
if (pszText) { LocalFree(pszText); }
|
||||
|
||||
if (!bIsRectSel) {
|
||||
//TODO: check for Rectangular Clipboard and skip selection restore
|
||||
if (iCurPos < iAnchorPos)
|
||||
EditSelectEx(hwnd, iCurPos + clipLen, iCurPos, -1, -1);
|
||||
else
|
||||
EditSelectEx(hwnd, iAnchorPos, iAnchorPos + clipLen, -1, -1);
|
||||
}
|
||||
else {
|
||||
//TODO: restore selection in case of swap clipboard
|
||||
}
|
||||
|
||||
LocalFree(pClip);
|
||||
|
||||
_OBSERVE_NOTIFY_CHANGE_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -3227,7 +3104,7 @@ void EditPadWithSpaces(HWND hwnd, bool bSkipEmpty, bool bNoUndoGroup)
|
||||
{
|
||||
if (SciCall_IsSelectionEmpty() || Sci_IsThinRectangleSelected()) { return; }
|
||||
|
||||
const int token = (!bNoUndoGroup ? BeginUndoAction() : -1);
|
||||
int const token = (!bNoUndoGroup ? BeginUndoAction() : -1);
|
||||
|
||||
if (SciCall_IsSelectionRectangle())
|
||||
{
|
||||
@ -5598,7 +5475,7 @@ INT_PTR CALLBACK EditFindReplaceDlgProcW(HWND hwnd,UINT umsg,WPARAM wParam,LPARA
|
||||
case IDC_REPLACE:
|
||||
{
|
||||
bReplaceInitialized = true;
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditReplace(sg_pefrData->hwnd, sg_pefrData);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -6223,7 +6100,7 @@ bool EditReplaceAll(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowInfo)
|
||||
|
||||
BeginWaitCursor(NULL);
|
||||
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
|
||||
iReplacedOccurrences = EditReplaceAllInRange(hwnd, lpefr, start, end, &enlargement);
|
||||
|
||||
@ -6259,7 +6136,7 @@ bool EditReplaceAllInSelection(HWND hwnd, LPCEDITFINDREPLACE lpefr, bool bShowIn
|
||||
const DocPos anchorPos = SciCall_GetAnchor();
|
||||
DocPos enlargement = 0;
|
||||
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
|
||||
bool const bWaitCursor = ((end - start) > (512 * 512)) ? true : false;
|
||||
if (bWaitCursor) { BeginWaitCursor(NULL); }
|
||||
|
||||
@ -30,8 +30,7 @@ bool EditIsRecodingNeeded(WCHAR*,int);
|
||||
char* EditGetClipboardText(HWND,bool,int*,int*);
|
||||
bool EditSetClipboardText(HWND, const char*);
|
||||
bool EditClearClipboard(HWND);
|
||||
void EditPaste2RectSel(HWND,char*);
|
||||
bool EditPasteClipboard(HWND,bool,bool);
|
||||
bool EditSwapClipboard(HWND,bool);
|
||||
bool EditCopyAppend(HWND,bool);
|
||||
int EditDetectEOLMode(HWND,char*,DWORD);
|
||||
bool EditLoadFile(HWND,LPCWSTR,bool,bool,int*,int*,bool*,bool*,bool*);
|
||||
|
||||
157
src/Notepad3.c
157
src/Notepad3.c
@ -1063,7 +1063,7 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow)
|
||||
bool bAutoIndent2 = bAutoIndent;
|
||||
bAutoIndent = 0;
|
||||
EditJumpTo(g_hwndEdit, -1, 0);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
if (SendMessage(g_hwndEdit, SCI_GETLENGTH, 0, 0) > 0) {
|
||||
SendMessage(g_hwndEdit, SCI_NEWLINE, 0, 0);
|
||||
}
|
||||
@ -3145,7 +3145,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
if (g_flagPasteBoard)
|
||||
bLastCopyFromMe = true;
|
||||
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
if (!SciCall_IsSelectionEmpty())
|
||||
{
|
||||
SciCall_Cut();
|
||||
@ -3192,13 +3192,12 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (g_flagPasteBoard)
|
||||
bLastCopyFromMe = true;
|
||||
int token = BeginUndoAction();
|
||||
EditPasteClipboard(g_hwndEdit, false, bSkipUnicodeDetection);
|
||||
int const token = BeginUndoAction();
|
||||
SciCall_Paste();
|
||||
EndUndoAction(token);
|
||||
// Updates done by EditPasteClipboard():
|
||||
//~UpdateToolbar();
|
||||
//~UpdateStatusbar(false);
|
||||
//~UpdateLineNumberWidth();
|
||||
UpdateToolbar();
|
||||
UpdateStatusbar(false);
|
||||
UpdateLineNumberWidth();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3206,11 +3205,12 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (g_flagPasteBoard)
|
||||
bLastCopyFromMe = true;
|
||||
int token = BeginUndoAction();
|
||||
EditPasteClipboard(g_hwndEdit, true, bSkipUnicodeDetection);
|
||||
int const token = BeginUndoAction();
|
||||
EditSwapClipboard(g_hwndEdit, bSkipUnicodeDetection);
|
||||
EndUndoAction(token);
|
||||
UpdateToolbar();
|
||||
UpdateStatusbar(false);
|
||||
UpdateLineNumberWidth();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -3222,6 +3222,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_SELECTALL:
|
||||
SendMessage(g_hwndEdit,SCI_SELECTALL,0,0);
|
||||
UpdateToolbar();
|
||||
UpdateStatusbar(false);
|
||||
break;
|
||||
|
||||
@ -3280,7 +3281,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_MOVELINEUP:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditMoveUp(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3289,7 +3290,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_MOVELINEDOWN:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditMoveDown(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3305,7 +3306,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (g_flagPasteBoard)
|
||||
bLastCopyFromMe = true;
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_LINECUT,0,0);
|
||||
UpdateToolbar();
|
||||
EndUndoAction(token);
|
||||
@ -3315,7 +3316,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_DELETELINE:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit, SCI_LINEDELETE, 0, 0);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3324,7 +3325,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_DELETELINELEFT:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit, SCI_DELLINELEFT, 0, 0);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3333,7 +3334,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_DELETELINERIGHT:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit, SCI_DELLINERIGHT, 0, 0);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3342,7 +3343,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_INDENT:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditIndentBlock(g_hwndEdit, SCI_TAB, true);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3350,7 +3351,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_UNINDENT:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditIndentBlock(g_hwndEdit, SCI_BACKTAB, true);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3358,7 +3359,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_TAB:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditIndentBlock(g_hwndEdit, SCI_TAB, false);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3366,7 +3367,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_BACKTAB:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditIndentBlock(g_hwndEdit, SCI_BACKTAB, false);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3374,7 +3375,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_CTRLTAB:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit, SCI_SETUSETABS, true, 0);
|
||||
SendMessage(g_hwndEdit, SCI_SETTABINDENTS, false, 0);
|
||||
EditIndentBlock(g_hwndEdit, SCI_TAB, false);
|
||||
@ -3386,7 +3387,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_DELETEBACK:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit, SCI_DELETEBACK, 0, 0);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3400,7 +3401,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_ENCLOSESELECTION:
|
||||
if (EditEncloseSelectionDlg(hwnd,wchPrefixSelection,wchAppendSelection)) {
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit,wchPrefixSelection,wchAppendSelection);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3411,7 +3412,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_SELECTIONDUPLICATE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_SELECTIONDUPLICATE,0,0);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3431,7 +3432,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_STRIP1STCHAR:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditStripFirstCharacter(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3442,7 +3443,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_STRIPLASTCHAR:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditStripLastCharacter(g_hwndEdit, false, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3453,7 +3454,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_TRIMLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditStripLastCharacter(g_hwndEdit, false, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3464,7 +3465,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_COMPRESSWS:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditCompressSpaces(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3475,7 +3476,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_MERGEBLANKLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditRemoveBlankLines(g_hwndEdit, true, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3485,7 +3486,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_MERGEEMPTYLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditRemoveBlankLines(g_hwndEdit, true, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3496,7 +3497,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_REMOVEBLANKLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditRemoveBlankLines(g_hwndEdit, false, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3507,7 +3508,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_REMOVEEMPTYLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditRemoveBlankLines(g_hwndEdit, false, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3518,7 +3519,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_REMOVEDUPLICATELINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditRemoveDuplicateLines(g_hwndEdit, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3530,7 +3531,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (EditModifyLinesDlg(hwnd,wchPrefixLines,wchAppendLines)) {
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditModifyLines(g_hwndEdit,wchPrefixLines,wchAppendLines);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3543,7 +3544,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (EditAlignDlg(hwnd,&iAlignMode)) {
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditAlignText(g_hwndEdit,iAlignMode);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3556,7 +3557,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (EditSortDlg(hwnd,&iSortOptions)) {
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditSortLines(g_hwndEdit,iSortOptions);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3576,7 +3577,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
iWrapCol = (DocPos)max(min(uWrpCol,(UINT)g_iLongLinesLimit),1);
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditWrapToColumn(g_hwndEdit,iWrapCol);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3588,7 +3589,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_SPLITLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditSplitLines(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3599,7 +3600,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_JOINLINES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditJoinLinesEx(g_hwndEdit, false, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3609,7 +3610,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_JOINLN_NOSP:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditJoinLinesEx(g_hwndEdit, false, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3619,7 +3620,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_JOINLINES_PARA:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditJoinLinesEx(g_hwndEdit, true, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3630,7 +3631,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CONVERTUPPERCASE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_UPPERCASE,0,0);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3641,7 +3642,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CONVERTLOWERCASE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_LOWERCASE,0,0);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3652,7 +3653,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_INVERTCASE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditInvertCase(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3663,7 +3664,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_TITLECASE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditTitleCase(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3674,7 +3675,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_SENTENCECASE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditSentenceCase(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3685,7 +3686,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CONVERTTABS:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditTabsToSpaces(g_hwndEdit, g_iTabWidth, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3696,7 +3697,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CONVERTSPACES:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditSpacesToTabs(g_hwndEdit, g_iTabWidth, false);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3707,7 +3708,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CONVERTTABS2:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditTabsToSpaces(g_hwndEdit, g_iTabWidth, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3718,7 +3719,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CONVERTSPACES2:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditSpacesToTabs(g_hwndEdit, g_iTabWidth, true);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3731,7 +3732,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
WCHAR wszOpen[256] = { L'\0' };
|
||||
WCHAR wszClose[256] = { L'\0' };
|
||||
if (EditInsertTagDlg(hwnd, wszOpen, wszClose)) {
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, wszOpen, wszClose);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3748,7 +3749,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
char *p = StrChrA(msz, ',');
|
||||
if (p)
|
||||
*p = 0;
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_REPLACESEL,0,(LPARAM)msz);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3794,7 +3795,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
WideCharToMultiByteStrg(Encoding_SciCP,tchDateTime,mszBuf);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_REPLACESEL,0,(LPARAM)mszBuf);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3825,7 +3826,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
WideCharToMultiByteStrg(Encoding_SciCP,pszInsert,mszBuf);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_REPLACESEL,0,(LPARAM)mszBuf);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3842,7 +3843,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
wszGuid[wcslen(wszGuid) - 1] = L'\0'; // trim last brace char
|
||||
char mszGuid[40 * 4]; // UTF-8 max of 4 bytes per char
|
||||
if (WideCharToMultiByteStrg(Encoding_SciCP,pwszGuid,mszGuid)) {
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_REPLACESEL,0,(LPARAM)mszGuid);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -3855,7 +3856,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_LINECOMMENT:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
|
||||
switch (SendMessage(g_hwndEdit, SCI_GETLEXER, 0, 0)) {
|
||||
default:
|
||||
@ -3922,7 +3923,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_STREAMCOMMENT:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
|
||||
switch (SendMessage(g_hwndEdit, SCI_GETLEXER, 0, 0)) {
|
||||
default:
|
||||
@ -3983,7 +3984,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_URLENCODE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditURLEncode(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -3994,7 +3995,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_URLDECODE:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditURLDecode(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -4005,7 +4006,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_ESCAPECCHARS:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEscapeCChars(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -4016,7 +4017,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_UNESCAPECCHARS:
|
||||
{
|
||||
BeginWaitCursor(NULL);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditUnescapeCChars(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
EndWaitCursor();
|
||||
@ -4026,7 +4027,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_CHAR2HEX:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditChar2Hex(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -4045,7 +4046,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_EDIT_SELTOMATCHINGBRACE:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditSelectToMatchingBrace(g_hwndEdit);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -4884,7 +4885,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_CTRLENTER:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
const DocPos iPos = SciCall_GetCurrentPos();
|
||||
const DocLn iLine = SciCall_LineFromPosition(iPos);
|
||||
if (iLine <= 0) {
|
||||
@ -4912,7 +4913,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
case IDM_EDIT_CLEAR:
|
||||
case CMD_DEL:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SciCall_Clear();
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -4938,7 +4939,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
const DocPos iIndentPos = SciCall_GetLineIndentPosition(iLine);
|
||||
|
||||
if (iPos != iAnchor) {
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SciCall_SetSel(iPos, iPos);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -4963,7 +4964,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
const DocPos iEndPos = SciCall_GetLineEndPosition(iLine);
|
||||
|
||||
if (iPos != iAnchor) {
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SciCall_SetSel(iPos, iPos);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5209,7 +5210,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_STRINGIFY:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, L"'", L"'");
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5218,7 +5219,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_STRINGIFY2:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, L"\"", L"\"");
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5227,7 +5228,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_EMBRACE:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, L"(", L")");
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5236,7 +5237,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_EMBRACE2:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, L"[", L"]");
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5245,7 +5246,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_EMBRACE3:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, L"{", L"}");
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5254,7 +5255,7 @@ LRESULT MsgCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_EMBRACE4:
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
EditEncloseSelection(g_hwndEdit, L"`", L"`");
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5881,7 +5882,7 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
*pPos = '\0';
|
||||
}
|
||||
if (*pLineBuf) {
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SciCall_AddText(lstrlenA(pLineBuf), pLineBuf);
|
||||
EndUndoAction(token);
|
||||
}
|
||||
@ -5935,7 +5936,7 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
StringCchCompareINA(g_pTempLineBufferMain, COUNTOF(g_pTempLineBufferMain), "</link>", -1) &&
|
||||
StringCchCompareINA(g_pTempLineBufferMain, COUNTOF(g_pTempLineBufferMain), "</meta>", -1))
|
||||
{
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SciCall_ReplaceSel(g_pTempLineBufferMain);
|
||||
SciCall_SetSel(iCurPos, iCurPos);
|
||||
EndUndoAction(token);
|
||||
@ -8046,7 +8047,7 @@ int BeginUndoAction()
|
||||
break;
|
||||
}
|
||||
|
||||
int token = UndoRedoActionMap(-1, &sel);
|
||||
int const token = UndoRedoActionMap(-1, &sel);
|
||||
|
||||
if (token >= 0) {
|
||||
SciCall_BeginUndoAction();
|
||||
@ -8456,7 +8457,7 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload, bool bSkipUnicodeDetect,
|
||||
SendMessage(g_hwndEdit,SCI_GETTEXT,5,(LPARAM)tchLog);
|
||||
if (StringCchCompareXA(tchLog,".LOG") == 0) {
|
||||
EditJumpTo(g_hwndEdit,-1,0);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
SendMessage(g_hwndEdit,SCI_NEWLINE,0,0);
|
||||
SendMessage(g_hwndMain,WM_COMMAND,MAKELONG(IDM_EDIT_INSERT_SHORTDATE,1),0);
|
||||
EditJumpTo(g_hwndEdit,-1,0);
|
||||
@ -9506,7 +9507,7 @@ void CALLBACK PasteBoardTimer(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
|
||||
bool bAutoIndent2 = bAutoIndent;
|
||||
bAutoIndent = 0;
|
||||
EditJumpTo(g_hwndEdit,-1,0);
|
||||
int token = BeginUndoAction();
|
||||
int const token = BeginUndoAction();
|
||||
if (SendMessage(g_hwndEdit, SCI_GETLENGTH, 0, 0) > 0) {
|
||||
SendMessage(g_hwndEdit, SCI_NEWLINE, 0, 0);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user