mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge branch 'master' into mui_dev
This commit is contained in:
commit
c0922ce371
@ -1 +1 @@
|
||||
1695
|
||||
1697
|
||||
|
||||
@ -340,7 +340,7 @@ BEGIN
|
||||
MENUITEM "代码折叠(&F)\tCtrl+Shift+Alt+F", IDM_VIEW_FOLDING
|
||||
MENUITEM "切换折叠(&T)\tCtrl+Shift+F", IDM_VIEW_TOGGLEFOLDS
|
||||
MENUITEM "切换聚焦(&V)\tCtrl+Alt+V", IDM_VIEW_TOGGLE_VIEW
|
||||
MENUITEM "&Monitoring Log", IDM_VIEW_CHASING_DOCTAIL
|
||||
MENUITEM "日志监控(&M)", IDM_VIEW_CHASING_DOCTAIL
|
||||
MENUITEM "允许滚动超过文件尾(&F)", IDM_VIEW_SCROLLPASTEOF
|
||||
END
|
||||
POPUP "工具栏(&T)"
|
||||
|
||||
@ -89,7 +89,7 @@ STRINGTABLE
|
||||
BEGIN
|
||||
IDT_FILE_LAUNCH "运行当前文档"
|
||||
IDT_VIEW_TOGGLE_VIEW "仅显示匹配行"
|
||||
IDT_VIEW_CHASING_DOCTAIL "Monitoring Log"
|
||||
IDT_VIEW_CHASING_DOCTAIL "日志监控"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.19.506.1695"
|
||||
version="5.19.510.1697"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 RC</description>
|
||||
|
||||
@ -40,6 +40,13 @@ struct latexFoldSave {
|
||||
latexFoldSave(const latexFoldSave &save) : structLev(save.structLev) {
|
||||
for (int i = 0; i < 8; ++i) openBegins[i] = save.openBegins[i];
|
||||
}
|
||||
latexFoldSave &operator=(const latexFoldSave &save) {
|
||||
if (this != &save) {
|
||||
structLev = save.structLev;
|
||||
for (int i = 0; i < 8; ++i) openBegins[i] = save.openBegins[i];
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
int openBegins[8];
|
||||
Sci_Position structLev;
|
||||
};
|
||||
|
||||
@ -65,10 +65,10 @@ private:
|
||||
public:
|
||||
IHanjaDic *HJinterface;
|
||||
|
||||
HanjaDic() : HJinterface(NULL) {
|
||||
HanjaDic() : HJinterface(nullptr) {
|
||||
hr = CLSIDFromProgID(OLESTR("mshjdic.hanjadic"), &CLSID_HanjaDic);
|
||||
if (SUCCEEDED(hr)) {
|
||||
hr = CoCreateInstance(CLSID_HanjaDic, NULL,
|
||||
hr = CoCreateInstance(CLSID_HanjaDic, nullptr,
|
||||
CLSCTX_INPROC_SERVER, IID_IHanjaDic,
|
||||
(LPVOID *)& HJinterface);
|
||||
if (SUCCEEDED(hr)) {
|
||||
|
||||
@ -98,7 +98,7 @@ bool LoadD2D() {
|
||||
// A single threaded factory as Scintilla always draw on the GUI thread
|
||||
fnD2DCF(D2D1_FACTORY_TYPE_SINGLE_THREADED,
|
||||
__uuidof(ID2D1Factory),
|
||||
0,
|
||||
nullptr,
|
||||
reinterpret_cast<IUnknown**>(&pD2DFactory));
|
||||
}
|
||||
}
|
||||
@ -605,7 +605,7 @@ int SurfaceGDI::DeviceHeightFont(int points) {
|
||||
}
|
||||
|
||||
void SurfaceGDI::MoveTo(int x_, int y_) {
|
||||
::MoveToEx(hdc, x_, y_, 0);
|
||||
::MoveToEx(hdc, x_, y_, nullptr);
|
||||
}
|
||||
|
||||
void SurfaceGDI::LineTo(int x_, int y_) {
|
||||
@ -2216,7 +2216,7 @@ void Window::Show(bool show) {
|
||||
}
|
||||
|
||||
void Window::InvalidateAll() {
|
||||
::InvalidateRect(HwndFromWindowID(wid), NULL, FALSE);
|
||||
::InvalidateRect(HwndFromWindowID(wid), nullptr, FALSE);
|
||||
}
|
||||
|
||||
void Window::InvalidateRectangle(PRectangle rc) {
|
||||
@ -2799,7 +2799,7 @@ POINT ListBoxX::MaxTrackSize() const {
|
||||
void ListBoxX::SetRedraw(bool on) {
|
||||
::SendMessage(lb, WM_SETREDRAW, on, 0);
|
||||
if (on)
|
||||
::InvalidateRect(lb, NULL, TRUE);
|
||||
::InvalidateRect(lb, nullptr, TRUE);
|
||||
}
|
||||
|
||||
void ListBoxX::ResizeToCursor() {
|
||||
@ -3198,22 +3198,17 @@ LRESULT PASCAL ListBoxX::StaticWndProc(
|
||||
namespace {
|
||||
|
||||
bool ListBoxX_Register() noexcept {
|
||||
WNDCLASSEX wndclassc;
|
||||
WNDCLASSEX wndclassc {};
|
||||
wndclassc.cbSize = sizeof(wndclassc);
|
||||
// We need CS_HREDRAW and CS_VREDRAW because of the ellipsis that might be drawn for
|
||||
// truncated items in the list and the appearance/disappearance of the vertical scroll bar.
|
||||
// The list repaint is double-buffered to avoid the flicker this would otherwise cause.
|
||||
wndclassc.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
|
||||
wndclassc.cbClsExtra = 0;
|
||||
wndclassc.cbWndExtra = sizeof(ListBoxX *);
|
||||
wndclassc.hInstance = hinstPlatformRes;
|
||||
wndclassc.hIcon = NULL;
|
||||
wndclassc.hbrBackground = NULL;
|
||||
wndclassc.lpszMenuName = NULL;
|
||||
wndclassc.lpfnWndProc = ListBoxX::StaticWndProc;
|
||||
wndclassc.hCursor = ::LoadCursor(NULL, IDC_ARROW);
|
||||
wndclassc.lpszClassName = ListBoxX_ClassName;
|
||||
wndclassc.hIconSm = 0;
|
||||
|
||||
return ::RegisterClassEx(&wndclassc) != 0;
|
||||
}
|
||||
|
||||
@ -3435,7 +3435,7 @@ bool ScintillaWin::Register(HINSTANCE hInstance_) noexcept {
|
||||
|
||||
// Register the Scintilla class
|
||||
// Register Scintilla as a wide character window
|
||||
WNDCLASSEXW wndclass;
|
||||
WNDCLASSEXW wndclass {};
|
||||
wndclass.cbSize = sizeof(wndclass);
|
||||
wndclass.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
|
||||
wndclass.lpfnWndProc = ScintillaWin::SWndProc;
|
||||
@ -3453,7 +3453,7 @@ bool ScintillaWin::Register(HINSTANCE hInstance_) noexcept {
|
||||
|
||||
if (result) {
|
||||
// Register the CallTip class
|
||||
WNDCLASSEX wndclassc;
|
||||
WNDCLASSEX wndclassc {};
|
||||
wndclassc.cbSize = sizeof(wndclassc);
|
||||
wndclassc.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
|
||||
wndclassc.cbClsExtra = 0;
|
||||
|
||||
11
src/Edit.c
11
src/Edit.c
@ -394,9 +394,9 @@ bool EditConvertText(HWND hwnd, cpi_enc_t encSource, cpi_enc_t encDest, bool bSe
|
||||
|
||||
struct Sci_TextRange tr = { { 0, -1 }, NULL };
|
||||
tr.lpstrText = pchText;
|
||||
SendMessage(hwnd,SCI_GETTEXTRANGE,0,(LPARAM)&tr);
|
||||
DocPos const rlength = SciCall_GetTextRange(&tr);
|
||||
|
||||
const DocPos wchBufSize = length * 3 + 2;
|
||||
const DocPos wchBufSize = rlength * 3 + 2;
|
||||
WCHAR* pwchText = AllocMem(wchBufSize, HEAP_ZERO_MEMORY);
|
||||
|
||||
// MultiBytes(Sci) -> WideChar(destination) -> Sci(MultiByte)
|
||||
@ -410,6 +410,7 @@ bool EditConvertText(HWND hwnd, cpi_enc_t encSource, cpi_enc_t encDest, bool bSe
|
||||
cbwText = MultiByteToWideChar(cpDst, 0, pchText, cbText, pwchText, (MBWC_DocPos_Cast)wchBufSize);
|
||||
// convert to Scintilla format
|
||||
cbText = WideCharToMultiByte(Encoding_SciCP, 0, pwchText, cbwText, pchText, (MBWC_DocPos_Cast)chBufSize, NULL, NULL);
|
||||
|
||||
pchText[cbText] = '\0';
|
||||
pchText[cbText+1] = '\0';
|
||||
|
||||
@ -4554,6 +4555,8 @@ void EditFixPositions(HWND hwnd)
|
||||
//
|
||||
void EditGetExcerpt(HWND hwnd,LPWSTR lpszExcerpt,DWORD cchExcerpt)
|
||||
{
|
||||
UNUSED(hwnd);
|
||||
|
||||
const DocPos iCurPos = SciCall_GetCurrentPos();
|
||||
const DocPos iAnchorPos = SciCall_GetAnchor();
|
||||
|
||||
@ -4583,8 +4586,8 @@ void EditGetExcerpt(HWND hwnd,LPWSTR lpszExcerpt,DWORD cchExcerpt)
|
||||
if (pszText && pszTextW)
|
||||
{
|
||||
tr.lpstrText = pszText;
|
||||
SendMessage(hwnd,SCI_GETTEXTRANGE,0,(LPARAM)&tr);
|
||||
MultiByteToWideChar(Encoding_SciCP,0,pszText,(MBWC_DocPos_Cast)len,pszTextW,(MBWC_DocPos_Cast)len);
|
||||
DocPos const rlen = SciCall_GetTextRange(&tr);
|
||||
MultiByteToWideChar(Encoding_SciCP,0,pszText,(MBWC_DocPos_Cast)rlen,pszTextW,(MBWC_DocPos_Cast)len);
|
||||
|
||||
for (WCHAR* p = pszTextW; *p && cch < COUNTOF(tch)-1; p++) {
|
||||
if (*p == L'\r' || *p == L'\n' || *p == L'\t' || *p == L' ') {
|
||||
|
||||
@ -9771,8 +9771,8 @@ bool FileLoad(bool bDontSave, bool bNew, bool bReload,
|
||||
|
||||
// the .LOG feature ...
|
||||
if (SciCall_GetTextLength() >= 4) {
|
||||
char tchLog[6] = { '\0','\0','\0','\0','\0','\0' };
|
||||
SciCall_GetText(5, tchLog);
|
||||
char tchLog[5] = { '\0','\0','\0','\0','\0' };
|
||||
SciCall_GetText(COUNTOF(tchLog), tchLog);
|
||||
if (StringCchCompareXA(tchLog,".LOG") == 0) {
|
||||
EditJumpTo(Globals.hwndEdit,-1,0);
|
||||
_BEGIN_UNDO_ACTION_;
|
||||
@ -9891,8 +9891,8 @@ bool FileRevert(LPCWSTR szFileName, bool bIgnoreCmdLnEnc)
|
||||
}
|
||||
else if (SciCall_GetTextLength() >= 4)
|
||||
{
|
||||
char tch[6] = { '\0','\0','\0','\0','\0','\0' };
|
||||
SciCall_GetText(5, tch);
|
||||
char tch[5] = { '\0','\0','\0','\0','\0' };
|
||||
SciCall_GetText(COUNTOF(tch), tch);
|
||||
if (StringCchCompareXA(tch,".LOG") != 0) {
|
||||
SciCall_ClearSelections();
|
||||
//~EditSetSelectionEx(Globals.hwndEdit, iAnchorPos, iCurPos, vSpcAnchorPos, vSpcCaretPos);
|
||||
@ -10005,14 +10005,15 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy)
|
||||
|
||||
bool bIsEmptyNewFile = false;
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile)) == 0) {
|
||||
const DocPos cchText = SciCall_GetTextLength();
|
||||
if (cchText == 0)
|
||||
DocPos const cchText = SciCall_GetTextLength();
|
||||
if (cchText == 0) {
|
||||
bIsEmptyNewFile = true;
|
||||
else if (cchText < 1023) {
|
||||
char chTextBuf[1024] = { '\0' };
|
||||
SciCall_GetText(1023, chTextBuf);
|
||||
}
|
||||
else if (cchText < 2048) {
|
||||
char chTextBuf[2048] = { '\0' };
|
||||
SciCall_GetText(COUNTOF(chTextBuf), chTextBuf);
|
||||
StrTrimA(chTextBuf, " \t\n\r");
|
||||
if (StringCchLenA(chTextBuf, COUNTOF(chTextBuf)) == 0) {
|
||||
if (StrIsEmptyA(chTextBuf)) {
|
||||
bIsEmptyNewFile = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,6 +201,8 @@ DeclareSciCallV0(Cancel, CANCEL)
|
||||
DeclareSciCallV0(CopyAllowLine, COPYALLOWLINE)
|
||||
DeclareSciCallV2(CopyText, COPYTEXT, DocPos, length, const char*, text)
|
||||
DeclareSciCallV2(GetText, GETTEXT, DocPos, length, const char*, text)
|
||||
DeclareSciCallR01(GetTextRange, GETTEXTRANGE, DocPos, struct Sci_TextRange*, textrange)
|
||||
|
||||
|
||||
DeclareSciCallV2(SetSel, SETSEL, DocPos, anchorPos, DocPos, currentPos)
|
||||
DeclareSciCallV0(SelectAll, SELECTALL)
|
||||
|
||||
10
src/Styles.c
10
src/Styles.c
@ -1799,8 +1799,8 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile)
|
||||
|
||||
if (!Flags.NoCGIGuess && (StringCchCompareNI(wchMode,COUNTOF(wchMode),L"cgi", CSTRLEN(L"cgi")) == 0 ||
|
||||
StringCchCompareNI(wchMode,COUNTOF(wchMode),L"fcgi", CSTRLEN(L"fcgi")) == 0)) {
|
||||
char tchText[256] = { L'\0' };
|
||||
SciCall_GetText(COUNTOF(tchText) - 1, tchText);
|
||||
char tchText[256] = { '\0' };
|
||||
SciCall_GetText(COUNTOF(tchText), tchText);
|
||||
StrTrimA(tchText," \t\n\r");
|
||||
pLexSniffed = Style_SniffShebang(tchText);
|
||||
if (pLexSniffed) {
|
||||
@ -1837,7 +1837,7 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile)
|
||||
|
||||
if (!Flags.NoCGIGuess && (StringCchCompareXI(lpszExt,L"cgi") == 0 || StringCchCompareXI(lpszExt,L"fcgi") == 0)) {
|
||||
char tchText[256] = { '\0' };
|
||||
SciCall_GetText(COUNTOF(tchText) - 1, tchText);
|
||||
SciCall_GetText(COUNTOF(tchText), tchText);
|
||||
StrTrimA(tchText," \t\n\r");
|
||||
pLexSniffed = Style_SniffShebang(tchText);
|
||||
if (pLexSniffed) {
|
||||
@ -1880,8 +1880,8 @@ void Style_SetLexerFromFile(HWND hwnd,LPCWSTR lpszFile)
|
||||
}
|
||||
|
||||
if (!bFound && s_bAutoSelect && (!Flags.NoHTMLGuess || !Flags.NoCGIGuess)) {
|
||||
char tchText[512];
|
||||
SciCall_GetText(COUNTOF(tchText) - 1, tchText);
|
||||
char tchText[512] = { '\0' };
|
||||
SciCall_GetText(COUNTOF(tchText), tchText);
|
||||
StrTrimA(tchText," \t\n\r");
|
||||
if (!Flags.NoCGIGuess) {
|
||||
if (tchText[0] == '<') {
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
#define SAPPNAME "Notepad3"
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 19
|
||||
#define VERSION_REV 506
|
||||
#define VERSION_BUILD 1695
|
||||
#define VERSION_REV 510
|
||||
#define VERSION_BUILD 1697
|
||||
#define SCINTILLA_VER 415+
|
||||
#define ONIGMO_REGEX_VER 6.2.0
|
||||
#define VERSION_PATCH RC
|
||||
|
||||
Loading…
Reference in New Issue
Block a user