Enhance API description in comment

Close #14587
This commit is contained in:
Don Ho 2024-01-13 19:41:32 +01:00
parent 50a6cf2981
commit bb278b26fc
6 changed files with 624 additions and 242 deletions

File diff suppressed because it is too large Load Diff

View File

@ -815,7 +815,7 @@ bool PluginsManager::allocateCmdID(int numberRequired, int *start)
*start = _dynamicIDAlloc.allocate(numberRequired);
if (-1 == *start)
if (*start == -1)
{
*start = 0;
retVal = false;

View File

@ -682,7 +682,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
BufferID id = MainFileManager.getBufferFromName(longNameFullpath);
if (id != BUFFER_INVALID)
doReload(id, wParam != 0);
break;
return TRUE;
}
case NPPM_SWITCHTOFILE :
@ -1157,7 +1158,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
else if (_pEditView == &_subEditView)
*id = SUB_VIEW;
else
*id = -1;
*id = -1; // cannot happen
return TRUE;
}
@ -1667,7 +1668,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return TRUE;
}
case NPPM_DESTROYSCINTILLAHANDLE:
case NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED:
{
//return _scintillaCtrls4Plugins.destroyScintilla(reinterpret_cast<HWND>(lParam));
@ -2068,7 +2069,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
int i;
if (lParam == SUB_VIEW)
if (lParam == SUB_VIEW) // priorityView is sub view, so we search in sub view firstly
{
if ((i = _subDocTab.getIndexByBuffer((BufferID)wParam)) != -1)
{
@ -2076,6 +2077,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
view <<= 30;
return view|i;
}
if ((i = _mainDocTab.getIndexByBuffer((BufferID)wParam)) != -1)
{
long view = MAIN_VIEW;
@ -2083,7 +2085,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return view|i;
}
}
else
else // (lParam == SUB_VIEW): priorityView is main view, so we search in main view firstly
{
if ((i = _mainDocTab.getIndexByBuffer((BufferID)wParam)) != -1)
{
@ -2091,6 +2093,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
view <<= 30;
return view|i;
}
if ((i = _subDocTab.getIndexByBuffer((BufferID)wParam)) != -1)
{
long view = SUB_VIEW;
@ -2913,7 +2916,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return _pluginsManager.relayPluginMessages(message, wParam, lParam);
}
case NPPM_ALLOCATESUPPORTED:
case NPPM_ALLOCATESUPPORTED_DEPRECATED:
{
return TRUE;
}

View File

@ -97,7 +97,17 @@ EolType convertIntToFormatType(int value, EolType defvalue = EolType::osdefault)
enum UniMode {uni8Bit=0, uniUTF8=1, uni16BE=2, uni16LE=3, uniCookie=4, uni7Bit=5, uni16BE_NoBOM=6, uni16LE_NoBOM=7, uniEnd};
enum UniMode {
uni8Bit = 0, // ANSI
uniUTF8 = 1, // UTF-8 with BOM
uni16BE = 2, // UTF-16 Big Ending with BOM
uni16LE = 3, // UTF-16 Little Ending with BOM
uniCookie = 4, // UTF-8 without BOM
uni7Bit = 5, //
uni16BE_NoBOM = 6, // UTF-16 Big Ending without BOM
uni16LE_NoBOM = 7, // UTF-16 Little Ending without BOM
uniEnd};
enum ChangeDetect { cdDisabled = 0x0, cdEnabledOld = 0x01, cdEnabledNew = 0x02, cdAutoUpdate = 0x04, cdGo2end = 0x08 };
enum BackupFeature {bak_none = 0, bak_simple = 1, bak_verbose = 2};
enum OpenSaveDirSetting {dir_followCurrent = 0, dir_last = 1, dir_userDef = 2};

View File

@ -1244,10 +1244,10 @@ SavingStatus FileManager::saveBuffer(BufferID id, const TCHAR* filename, bool is
if (isHiddenOrSys)
::SetFileAttributes(fullpath, attrib);
if (isCopy) // Save As command
if (isCopy) // "Save a Copy As..." command
{
_pscratchTilla->execute(SCI_SETDOCPOINTER, 0, _scratchDocDefault);
return SavingStatus::SaveOK; //all done
return SavingStatus::SaveOK; //all done - we don't change the current buffer's path to "fullpath", since it's "Save a Copy As..." action.
}
buffer->setFileName(fullpath);
@ -1373,7 +1373,7 @@ BufferID FileManager::newPlaceholderDocument(const TCHAR* missingFilename, int w
"FileInaccessibleUserSession",
_pNotepadPlus->_pEditView->getHSelf(),
L"Some files from your manually-saved session \"$STR_REPLACE$\" are inaccessible. They can be opened as empty and read-only documents as placeholders.\n\nWould you like to create those placeholders?\n\nNOTE: Choosing not to create the placeholders or closing them later, your manually-saved session will NOT be modified on exit.",
L"File inaccessinble",
L"File inaccessible",
MB_YESNO | MB_APPLMODAL,
0,
userCreatedSessionName);
@ -1384,7 +1384,7 @@ BufferID FileManager::newPlaceholderDocument(const TCHAR* missingFilename, int w
"FileInaccessibleDefaultSessionXml",
_pNotepadPlus->_pEditView->getHSelf(),
L"Some files from your past session are inaccessible. They can be opened as empty and read-only documents as placeholders.\n\nWould you like to create those placeholders?\n\nNOTE: Choosing not to create the placeholders or closing them later, your session WILL BE MODIFIED ON EXIT! We suggest you backup your \"session.xml\" now.",
L"File inaccessinble",
L"File inaccessible",
MB_YESNO | MB_APPLMODAL);
}

View File

@ -58,14 +58,14 @@ struct tTbData {
const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations
// internal data, do not use !!!
RECT rcFloat = {}; // floating position
RECT rcFloat = {}; // floating position
int iPrevCont = 0; // stores the privious container (toggling between float and dock)
const TCHAR* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin
};
struct tDockMgr {
HWND hWnd = nullptr; // the docking manager wnd
HWND hWnd = nullptr; // the docking manager wnd
RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs
};