mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #1675 from RaiKoHoff/DevNewFeatures
Open current file path in Explorer
This commit is contained in:
commit
b5cf4b81d2
@ -1 +1 @@
|
||||
2650
|
||||
2651
|
||||
|
||||
@ -437,20 +437,21 @@
|
||||
#define IDM_FILE_READONLY 40007
|
||||
#define IDM_FILE_LAUNCH 40008
|
||||
#define IDM_FILE_LAUNCH_ELEVATED 40009
|
||||
#define IDM_FILE_OPENWITH 40010
|
||||
#define IDM_FILE_RUN 40011
|
||||
#define IDM_FILE_NEWWINDOW 40012
|
||||
#define IDM_FILE_NEWWINDOW2 40013
|
||||
#define IDM_FILE_PAGESETUP 40014
|
||||
#define IDM_FILE_PRINT 40015
|
||||
#define IDM_FILE_PROPERTIES 40016
|
||||
#define IDM_FILE_CREATELINK 40017
|
||||
#define IDM_FILE_OPENFAV 40018
|
||||
#define IDM_FILE_ADDTOFAV 40019
|
||||
#define IDM_FILE_MANAGEFAV 40020
|
||||
#define IDM_FILE_RECENT 40021
|
||||
#define IDM_FILE_EXIT 40022
|
||||
#define IDM_FILE_PRESERVE_FILEMODTIME 40023
|
||||
#define IDM_FILE_EXPLORE_DIR 40010
|
||||
#define IDM_FILE_OPENWITH 40011
|
||||
#define IDM_FILE_RUN 40012
|
||||
#define IDM_FILE_NEWWINDOW 40013
|
||||
#define IDM_FILE_NEWWINDOW2 40014
|
||||
#define IDM_FILE_PAGESETUP 40015
|
||||
#define IDM_FILE_PRINT 40016
|
||||
#define IDM_FILE_PROPERTIES 40017
|
||||
#define IDM_FILE_CREATELINK 40018
|
||||
#define IDM_FILE_OPENFAV 40019
|
||||
#define IDM_FILE_ADDTOFAV 40020
|
||||
#define IDM_FILE_MANAGEFAV 40021
|
||||
#define IDM_FILE_RECENT 40022
|
||||
#define IDM_FILE_EXIT 40023
|
||||
#define IDM_FILE_PRESERVE_FILEMODTIME 40024
|
||||
|
||||
#define IDM_ENCODING_ANSI 40100
|
||||
#define IDM_ENCODING_UNICODE 40101
|
||||
@ -526,31 +527,32 @@
|
||||
#define IDM_EDIT_INSERT_SHORTDATE 40350
|
||||
#define IDM_EDIT_INSERT_LONGDATE 40351
|
||||
#define IDM_EDIT_INSERT_FILENAME 40352
|
||||
#define IDM_EDIT_INSERT_PATHNAME 40353
|
||||
#define IDM_EDIT_LINECOMMENT 40354
|
||||
#define IDM_EDIT_STREAMCOMMENT 40355
|
||||
#define IDM_EDIT_URLENCODE 40356
|
||||
#define IDM_EDIT_URLDECODE 40357
|
||||
#define IDM_EDIT_ESCAPECCHARS 40358
|
||||
#define IDM_EDIT_UNESCAPECCHARS 40359
|
||||
#define IDM_EDIT_CHAR2HEX 40360
|
||||
#define IDM_EDIT_HEX2CHAR 40361
|
||||
#define IDM_EDIT_FINDMATCHINGBRACE 40362
|
||||
#define IDM_EDIT_SELTOMATCHINGBRACE 40363
|
||||
#define IDM_EDIT_FIND 40364
|
||||
#define IDM_EDIT_SAVEFIND 40365
|
||||
#define IDM_EDIT_FINDNEXT 40366
|
||||
#define IDM_EDIT_FINDPREV 40367
|
||||
#define IDM_EDIT_REPLACE 40368
|
||||
#define IDM_EDIT_REPLACENEXT 40369
|
||||
#define IDM_EDIT_GOTOLINE 40370
|
||||
#define IDM_EDIT_SELTONEXT 40371
|
||||
#define IDM_EDIT_SELTOPREV 40372
|
||||
#define IDM_EDIT_COMPLETEWORD 40373
|
||||
#define IDM_EDIT_JOINLN_NOSP 40374
|
||||
#define IDM_EDIT_REMOVEDUPLICATELINES 40375
|
||||
#define IDM_EDIT_REMOVEEMPTYLINES 40376
|
||||
#define IDM_EDIT_MERGEEMPTYLINES 40377
|
||||
#define IDM_EDIT_INSERT_DIRNAME 40353
|
||||
#define IDM_EDIT_INSERT_PATHNAME 40354
|
||||
#define IDM_EDIT_LINECOMMENT 40355
|
||||
#define IDM_EDIT_STREAMCOMMENT 40356
|
||||
#define IDM_EDIT_URLENCODE 40357
|
||||
#define IDM_EDIT_URLDECODE 40358
|
||||
#define IDM_EDIT_ESCAPECCHARS 40359
|
||||
#define IDM_EDIT_UNESCAPECCHARS 40360
|
||||
#define IDM_EDIT_CHAR2HEX 40361
|
||||
#define IDM_EDIT_HEX2CHAR 40362
|
||||
#define IDM_EDIT_FINDMATCHINGBRACE 40363
|
||||
#define IDM_EDIT_SELTOMATCHINGBRACE 40364
|
||||
#define IDM_EDIT_FIND 40365
|
||||
#define IDM_EDIT_SAVEFIND 40366
|
||||
#define IDM_EDIT_FINDNEXT 40367
|
||||
#define IDM_EDIT_FINDPREV 40368
|
||||
#define IDM_EDIT_REPLACE 40369
|
||||
#define IDM_EDIT_REPLACENEXT 40370
|
||||
#define IDM_EDIT_GOTOLINE 40371
|
||||
#define IDM_EDIT_SELTONEXT 40372
|
||||
#define IDM_EDIT_SELTOPREV 40373
|
||||
#define IDM_EDIT_COMPLETEWORD 40374
|
||||
#define IDM_EDIT_JOINLN_NOSP 40375
|
||||
#define IDM_EDIT_REMOVEDUPLICATELINES 40376
|
||||
#define IDM_EDIT_REMOVEEMPTYLINES 40377
|
||||
#define IDM_EDIT_MERGEEMPTYLINES 40378
|
||||
|
||||
#define IDM_VIEW_SCHEME 40400
|
||||
#define IDM_VIEW_USE2NDDEFAULT 40401
|
||||
|
||||
@ -256,7 +256,9 @@ BEGIN
|
||||
MENUITEM "Kopiere &GUID in die Zwischenablage\tCtrl+Shift+.", IDM_EDIT_INSERT_GUID
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Kopiere &Dateiname in die Zwischenablage\tCtrl+F9", IDM_EDIT_INSERT_FILENAME
|
||||
MENUITEM "Kopiere &Pfad in die Zwischenablage\tCtrl+Shift+F9", IDM_EDIT_INSERT_PATHNAME
|
||||
MENUITEM "Kopiere &Verzeichnispfad in die Zwischenablage", IDM_EDIT_INSERT_DIRNAME
|
||||
MENUITEM "Kopiere &Gesamtpfad in die Zwischenablage\tCtrl+Shift+F9", IDM_EDIT_INSERT_PATHNAME
|
||||
MENUITEM "Öffne Verzeichnis im Datei-Explorer", IDM_FILE_EXPLORE_DIR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Escape C Zeichen\tCtrl+Alt+E", IDM_EDIT_ESCAPECCHARS
|
||||
MENUITEM "&Unescape C Zeichen\tCtrl+Alt+R", IDM_EDIT_UNESCAPECCHARS
|
||||
|
||||
@ -255,8 +255,10 @@ BEGIN
|
||||
BEGIN
|
||||
MENUITEM "Copy &GUID to Clipboard\tCtrl+Shift+.", IDM_EDIT_INSERT_GUID
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Copy &Filename to Clipboard\tCtrl+F9", IDM_EDIT_INSERT_FILENAME
|
||||
MENUITEM "Copy &Path to Clipboard\tCtrl+Shift+F9", IDM_EDIT_INSERT_PATHNAME
|
||||
MENUITEM "Copy &Filename to Clipboard\tCtrl+F9", IDM_EDIT_INSERT_FILENAME
|
||||
MENUITEM "Copy &Directory-Path to Clipboard", IDM_EDIT_INSERT_DIRNAME
|
||||
MENUITEM "Copy &Full-Path to Clipboard\tCtrl+Shift+F9", IDM_EDIT_INSERT_PATHNAME
|
||||
MENUITEM "Open Directory in &Explorer", IDM_FILE_EXPLORE_DIR
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&Escape C Chars\tCtrl+Alt+E", IDM_EDIT_ESCAPECCHARS
|
||||
MENUITEM "&Unescape C Chars\tCtrl+Alt+R", IDM_EDIT_UNESCAPECCHARS
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<assemblyIdentity
|
||||
name="Notepad3"
|
||||
processorArchitecture="*"
|
||||
version="5.19.926.2650"
|
||||
version="5.19.926.2651"
|
||||
type="win32"
|
||||
/>
|
||||
<description>Notepad3 BETA</description>
|
||||
|
||||
@ -3371,7 +3371,7 @@ void DialogNewWindow(HWND hwnd, bool bSaveOnRunTools, bool bSetCurFile)
|
||||
StringCchPrintf(tch, COUNTOF(tch), L" -pos %i,%i,%i,%i,%i", wi.x, wi.y, wi.cx, wi.cy, wi.max);
|
||||
StringCchCat(szParameters, COUNTOF(szParameters), tch);
|
||||
|
||||
if (bSetCurFile && StringCchLenW(Globals.CurrentFile, MAX_PATH))
|
||||
if (bSetCurFile && StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
WCHAR szFileName[MAX_PATH] = { L'\0' };
|
||||
StringCchCopy(szFileName, COUNTOF(szFileName), Globals.CurrentFile);
|
||||
|
||||
@ -1401,7 +1401,7 @@ HWND InitInstance(HINSTANCE hInstance,LPCWSTR pszCmdLine,int nCmdShow)
|
||||
WCHAR tchPageFmt[32] = { L'\0' };
|
||||
WCHAR szDisplayName[MAX_PATH];
|
||||
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
PathGetDisplayName(szDisplayName, COUNTOF(szDisplayName), Globals.CurrentFile);
|
||||
pszTitle = szDisplayName;
|
||||
}
|
||||
@ -3120,7 +3120,7 @@ LRESULT MsgInitMenu(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
bool const bPosInSel = Sci_IsPosInSelection(iCurPos);
|
||||
bool const mrs = Sci_IsMultiOrRectangleSelection();
|
||||
|
||||
int i = (int)StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile));
|
||||
int i = StrIsEmpty(Globals.CurrentFile) ? FALSE : TRUE;
|
||||
|
||||
EnableCmd(hmenu,IDM_FILE_REVERT,i);
|
||||
EnableCmd(hmenu, CMD_RELOADASCIIASUTF8, i);
|
||||
@ -3627,7 +3627,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
|
||||
case IDM_FILE_READONLY:
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
DWORD dwFileAttributes = GetFileAttributes(Globals.CurrentFile);
|
||||
if (dwFileAttributes != INVALID_FILE_ATTRIBUTES) {
|
||||
@ -3667,16 +3667,14 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_FILE_LAUNCH:
|
||||
{
|
||||
if (!StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsEmpty(Globals.CurrentFile))
|
||||
break;
|
||||
|
||||
if (Settings.SaveBeforeRunningTools && !FileSave(false,true,false,false,Flags.bPreserveFileModTime))
|
||||
break;
|
||||
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
StringCchCopy(tchMaxPathBuffer,COUNTOF(tchMaxPathBuffer),Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(tchMaxPathBuffer, COUNTOF(tchMaxPathBuffer));
|
||||
}
|
||||
StringCchCopy(tchMaxPathBuffer,COUNTOF(tchMaxPathBuffer),Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(tchMaxPathBuffer, COUNTOF(tchMaxPathBuffer));
|
||||
|
||||
SHELLEXECUTEINFO sei;
|
||||
ZeroMemory(&sei,sizeof(SHELLEXECUTEINFO));
|
||||
@ -3693,6 +3691,25 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
break;
|
||||
|
||||
|
||||
case IDM_FILE_EXPLORE_DIR:
|
||||
{
|
||||
if (StrIsEmpty(Globals.CurrentFile))
|
||||
break;
|
||||
|
||||
if (Settings.SaveBeforeRunningTools && !FileSave(false, true, false, false, Flags.bPreserveFileModTime))
|
||||
break;
|
||||
|
||||
PIDLIST_ABSOLUTE pidl = NULL;
|
||||
DWORD rfg = 0;
|
||||
SHILCreateFromPath(Globals.CurrentFile, &pidl, &rfg);
|
||||
if (pidl) {
|
||||
SHOpenFolderAndSelectItems(pidl, 0, NULL, 0);
|
||||
ILFree(pidl);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case IDM_FILE_LAUNCH_ELEVATED:
|
||||
{
|
||||
EditFileIOStatus fioStatus = INIT_FILEIO_STATUS;
|
||||
@ -3739,7 +3756,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
WCHAR tchPageFmt[32] = { L'\0' };
|
||||
WCHAR szDisplayName[MAX_PATH];
|
||||
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
PathGetDisplayName(szDisplayName, COUNTOF(szDisplayName), Globals.CurrentFile);
|
||||
pszTitle = szDisplayName;
|
||||
@ -3760,7 +3777,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_FILE_PROPERTIES:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)) == 0)
|
||||
if (StrIsEmpty(Globals.CurrentFile))
|
||||
break;
|
||||
|
||||
SHELLEXECUTEINFO sei;
|
||||
@ -3777,7 +3794,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case IDM_FILE_CREATELINK:
|
||||
{
|
||||
if (!StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsEmpty(Globals.CurrentFile)) {
|
||||
break;
|
||||
}
|
||||
if (!PathCreateDeskLnk(Globals.CurrentFile)) {
|
||||
@ -3807,7 +3824,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
|
||||
case IDM_FILE_ADDTOFAV:
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
WCHAR szDisplayName[MAX_PATH];
|
||||
PathGetDisplayName(szDisplayName, COUNTOF(szDisplayName), Globals.CurrentFile);
|
||||
AddToFavDlg(hwnd, szDisplayName, Globals.CurrentFile);
|
||||
@ -4528,17 +4545,25 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
|
||||
case IDM_EDIT_INSERT_FILENAME:
|
||||
case IDM_EDIT_INSERT_DIRNAME:
|
||||
case IDM_EDIT_INSERT_PATHNAME:
|
||||
{
|
||||
WCHAR *pszInsert;
|
||||
WCHAR tchUntitled[32];
|
||||
WCHAR szDisplayName[MAX_PATH];
|
||||
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile))) {
|
||||
if (iLoWParam == IDM_EDIT_INSERT_FILENAME) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
if (iLoWParam == IDM_EDIT_INSERT_FILENAME)
|
||||
{
|
||||
PathGetDisplayName(szDisplayName, COUNTOF(szDisplayName), Globals.CurrentFile);
|
||||
pszInsert = szDisplayName;
|
||||
}
|
||||
else if (iLoWParam == IDM_EDIT_INSERT_DIRNAME)
|
||||
{
|
||||
StringCchCopy(szDisplayName, COUNTOF(szDisplayName), Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(szDisplayName, COUNTOF(szDisplayName));
|
||||
pszInsert = szDisplayName;
|
||||
}
|
||||
else {
|
||||
pszInsert = Globals.CurrentFile;
|
||||
}
|
||||
@ -4547,9 +4572,6 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
GetLngString(IDS_MUI_UNTITLED, tchUntitled, COUNTOF(tchUntitled));
|
||||
pszInsert = tchUntitled;
|
||||
}
|
||||
//char chPath[MAX_PATH];
|
||||
//WideCharToMultiByte(Encoding_SciCP, 0, pszInsert, -1, chPath, COUNTOF(chPath), NULL, NULL);
|
||||
//EditReplaceSelection(chPath, false);
|
||||
SetClipboardTextW(hwnd, pszInsert, StringCchLen(pszInsert, 0));
|
||||
}
|
||||
break;
|
||||
@ -5819,7 +5841,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RECODEDEFAULT:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
Encoding_SrcCmdLn(Encoding_MapUnicode(Settings.DefaultEncoding));
|
||||
StringCchCopy(tchMaxPathBuffer,COUNTOF(tchMaxPathBuffer),Globals.CurrentFile);
|
||||
FileLoad(false,false,true,true,true,false,tchMaxPathBuffer);
|
||||
@ -5830,7 +5852,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RECODEANSI:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
Encoding_SrcCmdLn(CPI_ANSI_DEFAULT);
|
||||
StringCchCopy(tchMaxPathBuffer,COUNTOF(tchMaxPathBuffer),Globals.CurrentFile);
|
||||
FileLoad(false,false,true,true,Settings.SkipANSICodePageDetection,false,tchMaxPathBuffer);
|
||||
@ -5841,7 +5863,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RECODEOEM:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
Encoding_SrcCmdLn(CPI_OEM);
|
||||
StringCchCopy(tchMaxPathBuffer,COUNTOF(tchMaxPathBuffer),Globals.CurrentFile);
|
||||
FileLoad(false,false,true,true,true,false,tchMaxPathBuffer);
|
||||
@ -5852,7 +5874,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RECODEGB18030:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
Encoding_SrcCmdLn(Encoding_GetByCodePage(54936)); // GB18030
|
||||
StringCchCopy(tchMaxPathBuffer, COUNTOF(tchMaxPathBuffer), Globals.CurrentFile);
|
||||
FileLoad(false, false, true, true, true, false, tchMaxPathBuffer);
|
||||
@ -5863,7 +5885,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RELOADASCIIASUTF8:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
Globals.bForceReLoadAsUTF8 = true;
|
||||
StringCchCopy(tchMaxPathBuffer,COUNTOF(tchMaxPathBuffer),Globals.CurrentFile);
|
||||
@ -5876,7 +5898,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RELOADFORCEDETECTION:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
Globals.bForceReLoadAsUTF8 = false;
|
||||
StringCchCopy(tchMaxPathBuffer, COUNTOF(tchMaxPathBuffer), Globals.CurrentFile);
|
||||
@ -5887,7 +5909,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
case CMD_RELOADNOFILEVARS:
|
||||
{
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
bool const _fNoFileVariables = Flags.NoFileVariables;
|
||||
bool const _bNoEncodingTags = Settings.NoEncodingTags;
|
||||
@ -6011,7 +6033,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
ExpandEnvironmentStringsEx(lpszCommand, cmdsz);
|
||||
|
||||
WCHAR wchDirectory[MAX_PATH] = { L'\0' };
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
StringCchCopy(wchDirectory,COUNTOF(wchDirectory),Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory));
|
||||
}
|
||||
@ -6128,7 +6150,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
WCHAR *pszCopy;
|
||||
WCHAR tchUntitled[32] = { L'\0' };
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile)))
|
||||
if (StrIsNotEmpty(Globals.CurrentFile))
|
||||
pszCopy = Globals.CurrentFile;
|
||||
else {
|
||||
GetLngString(IDS_MUI_UNTITLED, tchUntitled, COUNTOF(tchUntitled));
|
||||
@ -6704,7 +6726,7 @@ bool HandleHotSpotURLClicked(const DocPos position, const HYPERLINK_OPS operatio
|
||||
else if (operation & OPEN_WITH_BROWSER) // open in web browser
|
||||
{
|
||||
WCHAR wchDirectory[MAX_PATH] = { L'\0' };
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
StringCchCopy(wchDirectory, COUNTOF(wchDirectory), Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(wchDirectory, COUNTOF(wchDirectory));
|
||||
}
|
||||
@ -8104,7 +8126,7 @@ static void _UpdateToolbarDelayed()
|
||||
|
||||
if (!Settings.ShowToolbar) { return; }
|
||||
|
||||
EnableTool(Globals.hwndToolbar, IDT_FILE_ADDTOFAV, StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile)));
|
||||
EnableTool(Globals.hwndToolbar, IDT_FILE_ADDTOFAV, StrIsNotEmpty(Globals.CurrentFile));
|
||||
EnableTool(Globals.hwndToolbar, IDT_FILE_SAVE, IsSaveNeeded(ISN_GET) /*&& !bReadOnly*/);
|
||||
EnableTool(Globals.hwndToolbar, IDT_FILE_RECENT, (MRU_Count(Globals.pFileMRU) > 0));
|
||||
|
||||
@ -9849,7 +9871,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy, bool bP
|
||||
fioStatus.iEOLMode = SciCall_GetEOLMode();
|
||||
|
||||
bool bIsEmptyNewFile = false;
|
||||
if (StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile)) == 0) {
|
||||
if (StrIsEmpty(Globals.CurrentFile)) {
|
||||
DocPos const cchText = SciCall_GetTextLength();
|
||||
if (cchText <= 0) {
|
||||
bIsEmptyNewFile = true;
|
||||
@ -9899,7 +9921,7 @@ bool FileSave(bool bSaveAlways, bool bAsk, bool bSaveAs, bool bSaveCopy, bool bP
|
||||
}
|
||||
|
||||
// Read only...
|
||||
if (!bSaveAs && !bSaveCopy && StringCchLenW(Globals.CurrentFile, COUNTOF(Globals.CurrentFile)))
|
||||
if (!bSaveAs && !bSaveCopy && StrIsNotEmpty(Globals.CurrentFile))
|
||||
{
|
||||
DWORD dwFileAttributes = GetFileAttributes(Globals.CurrentFile);
|
||||
if (dwFileAttributes != INVALID_FILE_ATTRIBUTES)
|
||||
@ -10026,7 +10048,7 @@ bool OpenFileDlg(HWND hwnd,LPWSTR lpstrFile,int cchFile,LPCWSTR lpstrInitialDir)
|
||||
Style_GetOpenDlgFilterStr(s_szFilter,COUNTOF(s_szFilter));
|
||||
|
||||
if (!lpstrInitialDir) {
|
||||
if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
StringCchCopy(tchInitialDir,COUNTOF(tchInitialDir),Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(tchInitialDir, COUNTOF(tchInitialDir));
|
||||
}
|
||||
@ -10080,7 +10102,7 @@ bool SaveFileDlg(HWND hwnd,LPWSTR lpstrFile,int cchFile,LPCWSTR lpstrInitialDir)
|
||||
|
||||
if (StrIsNotEmpty(lpstrInitialDir))
|
||||
StringCchCopy(tchInitialDir,COUNTOF(tchInitialDir),lpstrInitialDir);
|
||||
else if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
else if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
StringCchCopy(tchInitialDir,COUNTOF(tchInitialDir),Globals.CurrentFile);
|
||||
PathCchRemoveFileSpec(tchInitialDir, COUNTOF(tchInitialDir));
|
||||
}
|
||||
@ -10573,8 +10595,7 @@ void SetNotifyIconTitle(HWND hwnd)
|
||||
GetLngString(IDS_MUI_TITLEEXCERPT,tchFormat,COUNTOF(tchFormat));
|
||||
StringCchPrintf(tchTitle,COUNTOF(tchTitle),tchFormat,s_wchTitleExcerpt);
|
||||
}
|
||||
|
||||
else if (StringCchLenW(Globals.CurrentFile,COUNTOF(Globals.CurrentFile))) {
|
||||
else if (StrIsNotEmpty(Globals.CurrentFile)) {
|
||||
WCHAR szDisplayName[MAX_PATH];
|
||||
PathGetDisplayName(szDisplayName, COUNTOF(szDisplayName), Globals.CurrentFile);
|
||||
PathCompactPathEx(tchTitle,szDisplayName,COUNTOF(tchTitle)-4,0);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#define VERSION_MAJOR 5
|
||||
#define VERSION_MINOR 19
|
||||
#define VERSION_REV 926
|
||||
#define VERSION_BUILD 2650
|
||||
#define VERSION_BUILD 2651
|
||||
#define SCINTILLA_VER 420
|
||||
#define ONIGURUMA_REGEX_VER 6.9.3
|
||||
#define UCHARDET_VER 2018.09.27
|
||||
|
||||
Loading…
Reference in New Issue
Block a user