mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #1606 from RaiKoHoff/DevNewFeatures
Fix Ctrl+Shift-C/X and Paste and Ctrl+Alt+Enter behavior
This commit is contained in:
commit
751e663fd2
@ -1 +1 @@
|
||||
2617
|
||||
2618
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.19.904.2617"
|
||||
version="5.19.905.2618"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 BETA</description>
|
||||
|
||||
16
src/Edit.c
16
src/Edit.c
@ -6893,7 +6893,7 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
|
||||
return false;
|
||||
}
|
||||
|
||||
DocPos const iMinWdChCnt = 2; // min number of typed chars before AutoC
|
||||
DocPos const iMinWdChCnt = autoInsert ? 0 : 2; // min number of typed chars before AutoC
|
||||
|
||||
char const* const pchAllowdWordChars =
|
||||
((Globals.bIsCJKInputCodePage || Globals.bUseLimitedAutoCCharSet) ? AutoCompleteWordCharSet :
|
||||
@ -6907,11 +6907,10 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
|
||||
DocPos const iPosBefore = SciCall_PositionBefore(iCurrentPos);
|
||||
DocPos const iWordStartPos = SciCall_WordStartPosition(iPosBefore, true);
|
||||
|
||||
if ((iWordStartPos == iPosBefore) || (iCol < iMinWdChCnt) || ((iCurrentPos - iWordStartPos) < iMinWdChCnt)) {
|
||||
if (((iPosBefore - iWordStartPos) < iMinWdChCnt) || (iCol < iMinWdChCnt) || ((iCurrentPos - iWordStartPos) < iMinWdChCnt)) {
|
||||
EditSetAccelWordNav(hwnd, Settings.AccelWordNavigation);
|
||||
return true;
|
||||
}
|
||||
|
||||
DocPos iPos = iWordStartPos;
|
||||
bool bWordAllNumbers = true;
|
||||
while ((iPos < iCurrentPos) && bWordAllNumbers && (iPos <= iDocEndPos)) {
|
||||
@ -6921,12 +6920,11 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
|
||||
}
|
||||
iPos = SciCall_PositionAfter(iPos);
|
||||
}
|
||||
if (bWordAllNumbers) {
|
||||
if (!autoInsert && bWordAllNumbers) {
|
||||
EditSetAccelWordNav(hwnd, Settings.AccelWordNavigation);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
char pRoot[_MAX_AUTOC_WORD_LEN];
|
||||
DocPos const iRootLen = (iCurrentPos - iWordStartPos);
|
||||
StringCchCopyNA(pRoot, COUNTOF(pRoot), SciCall_GetRangePointer(iWordStartPos, iRootLen), (size_t)iRootLen);
|
||||
@ -6936,7 +6934,7 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
|
||||
|
||||
PWLIST pListHead = NULL;
|
||||
|
||||
if (Settings.AutoCompleteWords)
|
||||
if (Settings.AutoCompleteWords || autoInsert)
|
||||
{
|
||||
struct Sci_TextToFind ft = { { 0, 0 }, 0, { 0, 0 } };
|
||||
ft.lpstrText = pRoot;
|
||||
@ -6979,7 +6977,7 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
|
||||
if (pwlNewWord) { FreeMem(pwlNewWord); pwlNewWord = NULL; }
|
||||
}
|
||||
// --------------------------------------------------------------------------
|
||||
if (Settings.AutoCLexerKeyWords)
|
||||
if (Settings.AutoCLexerKeyWords || autoInsert)
|
||||
// --------------------------------------------------------------------------
|
||||
{
|
||||
PKEYWORDLIST const pKeyWordList = Style_GetCurrentLexerPtr()->pKeyWords;
|
||||
@ -7043,7 +7041,6 @@ bool EditAutoCompleteWord(HWND hwnd, bool autoInsert)
|
||||
LL_DELETE(pListHead, pWLItem);
|
||||
FreeMem(pWLItem);
|
||||
}
|
||||
|
||||
SciCall_AutoCShow(iRootLen, (pList + 1));
|
||||
FreeMem(pList);
|
||||
}
|
||||
@ -8122,8 +8119,9 @@ void EditSetAccelWordNav(HWND hwnd,bool bAccelWordNav)
|
||||
SciCall_SetWhitespaceChars(WhiteSpaceCharsAccelerated);
|
||||
SciCall_SetPunctuationChars(PunctuationCharsAccelerated);
|
||||
}
|
||||
else
|
||||
else {
|
||||
SciCall_SetCharsDefault();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ void EditMarkAll(HWND hwnd, char* pszFind, int flags, DocPos rangeStart, DocPos
|
||||
void EditFinalizeStyling(HWND hwnd, DocPos iEndPos);
|
||||
void EditUpdateIndicators(HWND hwnd, DocPos startPos, DocPos endPos, bool bClearOnly);
|
||||
void EditSetAccelWordNav(HWND hwnd,bool);
|
||||
bool EditAutoCompleteWord(HWND hwnd,bool);
|
||||
bool EditAutoCompleteWord(HWND hwnd, bool autoInsert);
|
||||
bool EditCheckNewLineInACFillUps();
|
||||
void EditShowZeroLengthCallTip(HWND hwnd, DocPos iPosition);
|
||||
void EditGetBookmarkList(HWND hwnd,LPWSTR pszBookMarks,int cchLength);
|
||||
|
||||
@ -3861,6 +3861,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IDM_EDIT_REDO:
|
||||
if (SciCall_CanRedo()) {
|
||||
SciCall_Redo();
|
||||
@ -3907,13 +3908,18 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
if (s_flagPasteBoard) {
|
||||
s_bLastCopyFromMe = true;
|
||||
}
|
||||
if (!SciCall_IsSelectionEmpty() ||
|
||||
!HandleHotSpotURLClicked(SciCall_GetCurrentPos(), COPY_HYPERLINK))
|
||||
{
|
||||
_BEGIN_UNDO_ACTION_
|
||||
SciCall_CopyAllowLine();
|
||||
_END_UNDO_ACTION_
|
||||
_BEGIN_UNDO_ACTION_
|
||||
if (SciCall_IsSelectionEmpty()) {
|
||||
if (!HandleHotSpotURLClicked(SciCall_GetCurrentPos(), COPY_HYPERLINK))
|
||||
{
|
||||
// VisualStudio behavior
|
||||
SciCall_CopyAllowLine();
|
||||
}
|
||||
}
|
||||
else {
|
||||
SciCall_Copy();
|
||||
}
|
||||
_END_UNDO_ACTION_
|
||||
UpdateToolbar();
|
||||
}
|
||||
break;
|
||||
@ -3925,13 +3931,11 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
s_bLastCopyFromMe = true;
|
||||
}
|
||||
_BEGIN_UNDO_ACTION_
|
||||
if (SciCall_IsSelectionEmpty()) {
|
||||
SciCall_CopyAllowLine();
|
||||
}
|
||||
else {
|
||||
SciCall_CopyRange(SciCall_PositionFromLine(SciCall_LineFromPosition(SciCall_GetSelectionStart())),
|
||||
SciCall_GetLineEndPosition(SciCall_LineFromPosition(SciCall_GetSelectionEnd())));
|
||||
}
|
||||
DocPos const iSelLnStart = SciCall_PositionFromLine(SciCall_LineFromPosition(SciCall_GetSelectionStart()));
|
||||
DocPos const iLineSelLast = SciCall_LineFromPosition(SciCall_GetSelectionEnd());
|
||||
// copy incl last line-breaks
|
||||
DocPos const iSelLnEnd = SciCall_PositionFromLine(iLineSelLast) + SciCall_LineLength(iLineSelLast);
|
||||
SciCall_CopyRange(iSelLnStart, iSelLnEnd);
|
||||
_END_UNDO_ACTION_
|
||||
}
|
||||
break;
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
#define SAPPNAME "Notepad3"
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 19
|
||||
#define VERSION_REV 904
|
||||
#define VERSION_BUILD 2617
|
||||
#define VERSION_REV 905
|
||||
#define VERSION_BUILD 2618
|
||||
#define SCINTILLA_VER 420
|
||||
#define ONIGURUMA_REGEX_VER 6.9.3
|
||||
#define UCHARDET_VER 2018.09.27
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
# This is a TOML document. - encoding:UTF-8
|
||||
# Notepad3\test\test_files\StyleLexers\styleLexTOML\TOML.toml
|
||||
# https://github.com/toml-lang/toml
|
||||
#
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user