diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index 97de03bf..7137236d 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once #include #include @@ -31,6 +20,8 @@ #include #include #include +#include +#include const bool dirUp = true; @@ -92,19 +83,23 @@ std::string getFileContent(const TCHAR *file2read); generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath); void writeFileContent(const TCHAR *file2write, const char *content2write); bool matchInList(const TCHAR *fileName, const std::vector & patterns); +bool matchInExcludeDirList(const TCHAR* dirName, const std::vector& patterns, size_t level); +bool allPatternsAreExclusion(const std::vector patterns); class WcharMbcsConvertor final { public: - static WcharMbcsConvertor * getInstance() {return _pSelf;} - static void destroyInstance() {delete _pSelf;} + static WcharMbcsConvertor& getInstance() { + static WcharMbcsConvertor instance; + return instance; + } - const wchar_t * char2wchar(const char *mbStr, UINT codepage, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL); - const wchar_t * char2wchar(const char *mbcs2Convert, UINT codepage, int *mstart, int *mend); - const char * wchar2char(const wchar_t *wcStr, UINT codepage, int lenIn = -1, int *pLenOut = NULL); - const char * wchar2char(const wchar_t *wcStr, UINT codepage, long *mstart, long *mend); + const wchar_t * char2wchar(const char *mbStr, size_t codepage, int lenMbcs =-1, int* pLenOut=NULL, int* pBytesNotProcessed=NULL); + const wchar_t * char2wchar(const char *mbcs2Convert, size_t codepage, intptr_t* mstart, intptr_t* mend); + const char * wchar2char(const wchar_t *wcStr, size_t codepage, int lenIn = -1, int* pLenOut = NULL); + const char * wchar2char(const wchar_t *wcStr, size_t codepage, intptr_t* mstart, intptr_t* mend); - const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL) + const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn = -1, int* pLenOut=NULL, int* pBytesNotProcessed=NULL) { int lenWc = 0; const wchar_t * strW = char2wchar(txt2Encode, fromCodepage, lenIn, &lenWc, pBytesNotProcessed); @@ -112,15 +107,17 @@ class WcharMbcsConvertor final } protected: - WcharMbcsConvertor() {} - ~WcharMbcsConvertor() {} + WcharMbcsConvertor() = default; + ~WcharMbcsConvertor() = default; // Since there's no public ctor, we need to void the default assignment operator and copy ctor. // Since these are marked as deleted does not matter under which access specifier are kept WcharMbcsConvertor(const WcharMbcsConvertor&) = delete; WcharMbcsConvertor& operator= (const WcharMbcsConvertor&) = delete; - static WcharMbcsConvertor* _pSelf; + // No move ctor and assignment + WcharMbcsConvertor(WcharMbcsConvertor&&) = delete; + WcharMbcsConvertor& operator= (WcharMbcsConvertor&&) = delete; template class StringBuffer final @@ -169,12 +166,13 @@ class WcharMbcsConvertor final #define REBARBAND_SIZE sizeof(REBARBANDINFO) generic_string PathRemoveFileSpec(generic_string & path); -generic_string PathAppend(generic_string &strDest, const generic_string & str2append); +generic_string pathAppend(generic_string &strDest, const generic_string & str2append); COLORREF getCtrlBgColor(HWND hWnd); generic_string stringToUpper(generic_string strToConvert); generic_string stringToLower(generic_string strToConvert); generic_string stringReplace(generic_string subject, const generic_string& search, const generic_string& replace); std::vector stringSplit(const generic_string& input, const generic_string& delimiter); +bool str2numberVector(generic_string str2convert, std::vector& numVect); generic_string stringJoin(const std::vector& strings, const generic_string& separator); generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); @@ -182,13 +180,16 @@ double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); int OrdinalIgnoreCaseCompareStrings(LPCTSTR sz1, LPCTSTR sz2); bool str2Clipboard(const generic_string &str2cpy, HWND hwnd); +class Buffer; +bool buf2Clipborad(const std::vector& buffers, bool isFullPath, HWND hwnd); generic_string GetLastErrorAsString(DWORD errorCode = 0); generic_string intToString(int val); generic_string uintToString(unsigned int val); -HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText); +HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText, bool isRTL); +HWND CreateToolTipRect(int toolID, HWND hWnd, HINSTANCE hInst, const PTSTR pszText, const RECT rc); bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check); bool isAssoCommandExisting(LPCTSTR FullPathName); @@ -199,3 +200,38 @@ std::string ws2s(const std::wstring& wstr); bool deleteFileOrFolder(const generic_string& f2delete); void getFilesInFolder(std::vector& files, const generic_string& extTypeFilter, const generic_string& inFolder); + +template size_t vecRemoveDuplicates(std::vector& vec, bool isSorted = false, bool canSort = false) +{ + if (!isSorted && canSort) + { + std::sort(vec.begin(), vec.end()); + isSorted = true; + } + + if (isSorted) + { + typename std::vector::iterator it; + it = std::unique(vec.begin(), vec.end()); + vec.resize(distance(vec.begin(), it)); // unique() does not shrink the vector + } + else + { + std::unordered_set seen; + auto newEnd = std::remove_if(vec.begin(), vec.end(), [&seen](const T& value) + { + return !seen.insert(value).second; + }); + vec.erase(newEnd, vec.end()); + } + return vec.size(); +} + +void trim(generic_string& str); +bool endsWith(const generic_string& s, const generic_string& suffix); + +int nbDigitsFromNbLines(size_t nbLines); + +generic_string getDateTimeStrFrom(const generic_string& dateTimeFormat, const SYSTEMTIME& st); + +HFONT createFont(const TCHAR* fontName, int fontSize, bool isBold, HWND hDestParent); diff --git a/NppPlugin/include/Docking.h b/NppPlugin/include/Docking.h index f4b2af49..463298b2 100644 --- a/NppPlugin/include/Docking.h +++ b/NppPlugin/include/Docking.h @@ -1,29 +1,18 @@ -// this file is part of Notepad++ -// Copyright (C)2005 Jens Lorenz -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// // Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. -// +// This file is part of Notepad++ project +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once @@ -57,27 +46,27 @@ #define DWS_DF_FLOATING 0x80000000 // default state is floating -typedef struct { - HWND hClient; // client Window Handle - const TCHAR *pszName; // name of plugin (shown in window) - int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID +struct tTbData { + HWND hClient = nullptr; // client Window Handle + const TCHAR* pszName = nullptr; // name of plugin (shown in window) + int dlgID = 0; // a funcItem provides the function pointer to start a dialog. Please parse here these ID // user modifications - UINT uMask; // mask params: look to above defines - HICON hIconTab; // icon for tabs - const TCHAR *pszAddInfo; // for plugin to display additional informations + UINT uMask = 0; // mask params: look to above defines + HICON hIconTab = nullptr; // icon for tabs + const TCHAR* pszAddInfo = nullptr; // for plugin to display additional informations // internal data, do not use !!! - RECT rcFloat; // floating position - int iPrevCont; // stores the privious container (toggling between float and dock) - const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin -} tTbData; + RECT rcFloat = {0}; // 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 +}; -typedef struct { - HWND hWnd; // the docking manager wnd - RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs -} tDockMgr; +struct tDockMgr { + HWND hWnd = nullptr; // the docking manager wnd + RECT rcRegion[DOCKCONT_MAX] = {{0}}; // position of docked dialogs +}; #define HIT_TEST_THICKNESS 20 diff --git a/NppPlugin/include/DockingDlgInterface.h b/NppPlugin/include/DockingDlgInterface.h index 249a4706..d58532a2 100644 --- a/NppPlugin/include/DockingDlgInterface.h +++ b/NppPlugin/include/DockingDlgInterface.h @@ -1,28 +1,18 @@ -// this file is part of Function List Plugin for Notepad++ -// Copyright (C)2005 Jens Lorenz -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// This file is part of Notepad++ project +// Copyright (C)2006 Jens Lorenz + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software +// along with this program. If not, see . #pragma once @@ -34,6 +24,7 @@ #include #include "Common.h" #include "StaticDialog.h" +#include "NppDarkMode.h" @@ -43,16 +34,14 @@ class DockingDlgInterface : public StaticDialog DockingDlgInterface() = default; explicit DockingDlgInterface(int dlgID): _dlgID(dlgID) {} - virtual void init(HINSTANCE hInst, HWND parent) - { + virtual void init(HINSTANCE hInst, HWND parent) { StaticDialog::init(hInst, parent); TCHAR temp[MAX_PATH]; ::GetModuleFileName(reinterpret_cast(hInst), temp, MAX_PATH); _moduleName = ::PathFindFileName(temp); } - void create(tTbData * data, bool isRTL = false) - { + void create(tTbData* data, bool isRTL = false) { assert(data != nullptr); StaticDialog::create(_dlgID, isRTL); TCHAR temp[MAX_PATH]; @@ -60,22 +49,23 @@ class DockingDlgInterface : public StaticDialog _pluginName = temp; // user information - data->hClient = _hSelf; - data->pszName = _pluginName.c_str(); + data->hClient = _hSelf; + data->pszName = _pluginName.c_str(); // supported features by plugin - data->uMask = 0; + data->uMask = 0; // additional info - data->pszAddInfo = NULL; + data->pszAddInfo = NULL; } - virtual void updateDockingDlg() - { + virtual void updateDockingDlg() { ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, reinterpret_cast(_hSelf)); } - virtual void destroy() {} + virtual void destroy() { + StaticDialog::destroy(); + } virtual void setBackgroundColor(COLORREF) {} virtual void setForegroundColor(COLORREF) {} @@ -97,11 +87,28 @@ class DockingDlgInterface : public StaticDialog } protected : - virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam) - { - switch (message) + int _dlgID = -1; + bool _isFloating = true; + int _iDockedPos = 0; + generic_string _moduleName; + generic_string _pluginName; + bool _isClosed = false; + + virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { + switch (message) { + case WM_ERASEBKGND: + { + if (!NppDarkMode::isEnabled()) + { + break; + } + RECT rc = { 0 }; + getClientRect(rc); + ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); + return TRUE; + } case WM_NOTIFY: { LPNMHDR pnmh = reinterpret_cast(lParam); @@ -136,13 +143,4 @@ protected : } return FALSE; }; - - // Handles - HWND _HSource = NULL; - int _dlgID = -1; - bool _isFloating = true; - int _iDockedPos = 0; - generic_string _moduleName; - generic_string _pluginName; - bool _isClosed = false; }; diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index 306c109c..a31f69a4 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -1,33 +1,21 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef NOTEPAD_PLUS_MSGS_H -#define NOTEPAD_PLUS_MSGS_H +#pragma once #include #include @@ -43,18 +31,17 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ L_IHEX, L_TEHEX, L_SWIFT,\ L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \ L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \ - L_MMIXAL, L_NIMROD, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ - L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ + L_MMIXAL, L_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ + L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG, L_TYPESCRIPT,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; -enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10}; -enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; +enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10 }; +enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; -//Here you can find how to use these messages : http://docs.notepad-plus-plus.org/index.php/Messages_And_Notifications #define NPPMSG (WM_USER + 1000) #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) @@ -158,8 +145,10 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; #define NPPM_SETMENUITEMCHECK (NPPMSG + 40) //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE) - #define NPPM_ADDTOOLBARICON (NPPMSG + 41) - //void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon) + #define NPPM_ADDTOOLBARICON_DEPRECATED (NPPMSG + 41) + //void NPPM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons iconHandles) -- DEPRECATED : use NPPM_ADDTOOLBARICON_FORDARKMODE instead + //2 formats of icon are needed: .ico & .bmp + //Both handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users struct toolbarIcons { HBITMAP hToolbarBmp; HICON hToolbarIcon; @@ -255,7 +244,6 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // wParam: Buffer to reload // lParam: 0 if no alert, else alert - #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64) // INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0) // wParam: BufferID to get LangType from @@ -358,7 +346,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; #define NPPM_ALLOCATEMARKER (NPPMSG + 82) // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber) // sets startNumber to the initial command ID if successful - // Allocates a marker number to a plugin + // Allocates a marker number to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, + // it has to use this message to get marker number, in order to prevent from the conflict with the other plugins. // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful #define NPPM_GETLANGUAGENAME (NPPMSG + 83) @@ -377,14 +366,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time // by passing allocated buffer as argument langDesc - #define NPPM_SHOWDOCSWITCHER (NPPMSG + 85) - // VOID NPPM_ISDOCSWITCHERSHOWN(0, BOOL toShowOrNot) - // Send this message to show or hide doc switcher. - // if toShowOrNot is TRUE then show doc switcher, otherwise hide it. + #define NPPM_SHOWDOCLIST (NPPMSG + 85) + // VOID NPPM_SHOWDOCLIST(0, BOOL toShowOrNot) + // Send this message to show or hide Document List. + // if toShowOrNot is TRUE then show Document List, otherwise hide it. - #define NPPM_ISDOCSWITCHERSHOWN (NPPMSG + 86) - // BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0) - // Check to see if doc switcher is shown. + #define NPPM_ISDOCLISTSHOWN (NPPMSG + 86) + // BOOL NPPM_ISDOCLISTSHOWN(0, 0) + // Check to see if Document List is shown. #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87) // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0) @@ -394,9 +383,13 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // INT NPPM_GETCURRENTVIEW(0, 0) // Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary - #define NPPM_DOCSWITCHERDISABLECOLUMN (NPPMSG + 89) - // VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot) - // Disable or enable extension column of doc switcher + #define NPPM_DOCLISTDISABLEEXTCOLUMN (NPPMSG + 89) + // VOID NPPM_DOCLISTDISABLEEXTCOLUMN(0, BOOL disableOrNot) + // Disable or enable extension column of Document List + + #define NPPM_DOCLISTDISABLEPATHCOLUMN (NPPMSG + 102) + // VOID NPPM_DOCLISTDISABLEPATHCOLUMN(0, BOOL disableOrNot) + // Disable or enable path column of Document List #define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90) // INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) @@ -431,6 +424,49 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + #define NPPM_GETSETTINGSONCLOUDPATH (NPPMSG + 98) + // INT NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath) + // Get settings on cloud path. It's useful if plugins want to store its settings on Cloud, if this path is set. + // Returns the number of TCHAR copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path. + // Users should call it with settingsCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate settingsCloudPath buffer with the return value + 1, then call it again to get the path. + + #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) + #define LINENUMWIDTH_DYNAMIC 0 + #define LINENUMWIDTH_CONSTANT 1 + // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, INT widthMode) + // Set line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + // It may help some plugins to disable non-dynamic line number margins width to have a smoothly visual effect while vertical scrolling the content in Notepad++ + // If calling is successful return TRUE, otherwise return FALSE. + + #define NPPM_GETLINENUMBERWIDTHMODE (NPPMSG + 100) + // INT NPPM_GETLINENUMBERWIDTHMODE(0, 0) + // Get line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + + #define NPPM_ADDTOOLBARICON_FORDARKMODE (NPPMSG + 101) + // VOID NPPM_ADDTOOLBARICON_FORDARKMODE(UINT funcItem[X]._cmdID, toolbarIconsWithDarkMode iconHandles) + // Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON which doesn't support the dark mode + // 2 formats / 3 icons are needed: 1 * BMP + 2 * ICO + // All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode + struct toolbarIconsWithDarkMode { + HBITMAP hToolbarBmp; + HICON hToolbarIcon; + HICON hToolbarIconDarkMode; + }; + +#define VAR_NOT_RECOGNIZED 0 +#define FULL_CURRENT_PATH 1 +#define CURRENT_DIRECTORY 2 +#define FILE_NAME 3 +#define NAME_PART 4 +#define EXT_PART 5 +#define CURRENT_WORD 6 +#define NPP_DIRECTORY 7 +#define CURRENT_LINE 8 +#define CURRENT_COLUMN 9 +#define NPP_FULL_FILE_PATH 10 +#define GETFILENAMEATCURSOR 11 + #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) @@ -455,18 +491,6 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) - #define VAR_NOT_RECOGNIZED 0 - #define FULL_CURRENT_PATH 1 - #define CURRENT_DIRECTORY 2 - #define FILE_NAME 3 - #define NAME_PART 4 - #define EXT_PART 5 - #define CURRENT_WORD 6 - #define NPP_DIRECTORY 7 - #define CURRENT_LINE 8 - #define CURRENT_COLUMN 9 - #define NPP_FULL_FILE_PATH 10 - #define GETFILENAMEATCURSOR 11 // Notification code @@ -477,7 +501,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; //scnNotification->nmhdr.idFrom = 0; #define NPPN_TBMODIFICATION (NPPN_FIRST + 2) // To notify plugins that toolbar icons can be registered - //scnNotification->nmhdr.code = NPPN_TB_MODIFICATION; + //scnNotification->nmhdr.code = NPPN_TBMODIFICATION; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = 0; @@ -612,5 +636,3 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; //scnNotification->nmhdr.code = NPPN_FILEDELETED; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; - -#endif //NOTEPAD_PLUS_MSGS_H diff --git a/NppPlugin/include/NppDarkMode.h b/NppPlugin/include/NppDarkMode.h new file mode 100644 index 00000000..2cb60fc7 --- /dev/null +++ b/NppPlugin/include/NppDarkMode.h @@ -0,0 +1,172 @@ +// This file is part of Notepad++ project +// Copyright (c) 2021 adzm / Adam D. Walling + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#pragma once + +#include + +constexpr COLORREF HEXRGB(DWORD rrggbb) { + // from 0xRRGGBB like natural #RRGGBB + // to the little-endian 0xBBGGRR + return + ((rrggbb & 0xFF0000) >> 16) | + ((rrggbb & 0x00FF00) ) | + ((rrggbb & 0x0000FF) << 16); +} + +namespace NppDarkMode +{ + struct Colors + { + COLORREF background = 0; + COLORREF softerBackground = 0; + COLORREF hotBackground = 0; + COLORREF pureBackground = 0; + COLORREF errorBackground = 0; + COLORREF text = 0; + COLORREF darkerText = 0; + COLORREF disabledText = 0; + COLORREF linkText = 0; + COLORREF edge = 0; + }; + + struct Options + { + bool enable = false; + bool enableMenubar = false; + }; + + enum class ToolTipsType + { + tooltip, + toolbar, + listview, + treeview, + tabbar + }; + + enum ColorTone { + blackTone = 0, + redTone = 1, + greenTone = 2, + blueTone = 3, + purpleTone = 4, + cyanTone = 5, + oliveTone = 6, + customizedTone = 32 + }; + + enum class TreeViewStyle + { + classic = 0, + light = 1, + dark = 2 + }; + + void initDarkMode(); // pulls options from NppParameters + void refreshDarkMode(HWND hwnd, bool forceRefresh = false); // attempts to apply new options from NppParameters, sends NPPM_INTERNAL_REFRESHDARKMODE to hwnd's top level parent + + bool isEnabled(); + bool isDarkMenuEnabled(); + bool isExperimentalSupported(); + + bool isWindows11(); + + COLORREF invertLightness(COLORREF c); + COLORREF invertLightnessSofter(COLORREF c); + double calculatePerceivedLighness(COLORREF c); + + void setDarkTone(ColorTone colorToneChoice); + + COLORREF getBackgroundColor(); + COLORREF getSofterBackgroundColor(); + COLORREF getHotBackgroundColor(); + COLORREF getDarkerBackgroundColor(); + COLORREF getErrorBackgroundColor(); + + COLORREF getTextColor(); + COLORREF getDarkerTextColor(); + COLORREF getDisabledTextColor(); + COLORREF getLinkTextColor(); + + COLORREF getEdgeColor(); + + HBRUSH getBackgroundBrush(); + HBRUSH getDarkerBackgroundBrush(); + HBRUSH getSofterBackgroundBrush(); + HBRUSH getHotBackgroundBrush(); + HBRUSH getErrorBackgroundBrush(); + + HPEN getDarkerTextPen(); + HPEN getEdgePen(); + + void setBackgroundColor(COLORREF c); + void setSofterBackgroundColor(COLORREF c); + void setHotBackgroundColor(COLORREF c); + void setDarkerBackgroundColor(COLORREF c); + void setErrorBackgroundColor(COLORREF c); + void setTextColor(COLORREF c); + void setDarkerTextColor(COLORREF c); + void setDisabledTextColor(COLORREF c); + void setLinkTextColor(COLORREF c); + void setEdgeColor(COLORREF c); + + Colors getDarkModeDefaultColors(); + void changeCustomTheme(const Colors& colors); + + // handle events + void handleSettingChange(HWND hwnd, LPARAM lParam); + + // processes messages related to UAH / custom menubar drawing. + // return true if handled, false to continue with normal processing in your wndproc + bool runUAHWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT* lr); + void drawUAHMenuNCBottomLine(HWND hWnd); + + // from DarkMode.h + void initExperimentalDarkMode(); + void setDarkMode(bool useDark, bool fixDarkScrollbar); + void allowDarkModeForApp(bool allow); + bool allowDarkModeForWindow(HWND hWnd, bool allow); + void setTitleBarThemeColor(HWND hWnd); + + // enhancements to DarkMode.h + void enableDarkScrollBarForWindowAndChildren(HWND hwnd); + + void subclassButtonControl(HWND hwnd); + void subclassGroupboxControl(HWND hwnd); + void subclassTabControl(HWND hwnd); + void subclassComboBoxControl(HWND hwnd); + + void autoSubclassAndThemeChildControls(HWND hwndParent, bool subclass = true, bool theme = true); + void autoThemeChildControls(HWND hwndParent); + + void setDarkTitleBar(HWND hwnd); + void setDarkExplorerTheme(HWND hwnd); + void setDarkScrollBar(HWND hwnd); + void setDarkTooltips(HWND hwnd, ToolTipsType type); + void setDarkLineAbovePanelToolbar(HWND hwnd); + void setDarkListView(HWND hwnd); + + void disableVisualStyle(HWND hwnd, bool doDisable); + void calculateTreeViewStyle(); + void setTreeViewStyle(HWND hwnd); + void setBorder(HWND hwnd, bool border = true); + + LRESULT onCtlColor(HDC hdc); + LRESULT onCtlColorSofter(HDC hdc); + LRESULT onCtlColorDarker(HDC hdc); + LRESULT onCtlColorError(HDC hdc); +} diff --git a/NppPlugin/include/PluginInterface.h b/NppPlugin/include/PluginInterface.h index 4ec81f37..75664b8d 100644 --- a/NppPlugin/include/PluginInterface.h +++ b/NppPlugin/include/PluginInterface.h @@ -1,41 +1,24 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef PLUGININTERFACE_H -#define PLUGININTERFACE_H +#pragma once -#ifndef SCINTILLA_H #include "Scintilla.h" -#endif //SCINTILLA_H - -#ifndef NOTEPAD_PLUS_MSGS_H #include "Notepad_plus_msgs.h" -#endif //NOTEPAD_PLUS_MSGS_H const int nbChar = 64; @@ -43,9 +26,9 @@ typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); struct NppData { - HWND _nppHandle; - HWND _scintillaMainHandle; - HWND _scintillaSecondHandle; + HWND _nppHandle = nullptr; + HWND _scintillaMainHandle = nullptr; + HWND _scintillaSecondHandle = nullptr; }; typedef void (__cdecl * PFUNCSETINFO)(NppData); @@ -56,19 +39,19 @@ typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lPa struct ShortcutKey { - bool _isCtrl; - bool _isAlt; - bool _isShift; - UCHAR _key; + bool _isCtrl = false; + bool _isAlt = false; + bool _isShift = false; + UCHAR _key = 0; }; struct FuncItem { - TCHAR _itemName[nbChar]; - PFUNCPLUGINCMD _pFunc; - int _cmdID; - bool _init2Check; - ShortcutKey *_pShKey; + TCHAR _itemName[nbChar] = { '\0' }; + PFUNCPLUGINCMD _pFunc = nullptr; + int _cmdID = 0; + bool _init2Check = false; + ShortcutKey *_pShKey = nullptr; }; typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *); @@ -83,5 +66,3 @@ extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam // This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore extern "C" __declspec(dllexport) BOOL isUnicode(); - -#endif //PLUGININTERFACE_H diff --git a/NppPlugin/include/SciLexer.h b/NppPlugin/include/SciLexer.h index 36552d15..96c34d36 100644 --- a/NppPlugin/include/SciLexer.h +++ b/NppPlugin/include/SciLexer.h @@ -142,12 +142,15 @@ #define SCLEX_CIL 127 #define SCLEX_X12 128 #define SCLEX_DATAFLEX 129 +#define SCLEX_HOLLYWOOD 130 +#define SCLEX_RAKU 131 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 + //For All lexer #define SCE_UNIVERSAL_FOUND_STYLE 31 #define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 @@ -226,7 +229,6 @@ #define SCE_USER_STYLE_IDENTIFIER 24 #define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER #define SCE_USER_STYLE_MAPPER_TOTAL 17 -#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle #define SCE_USER_MASK_NESTING_NONE 0 #define SCE_USER_MASK_NESTING_DELIMITER1 0x1 @@ -257,6 +259,7 @@ #define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 #define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -334,7 +337,7 @@ #define SCE_SEARCHRESULT_FILE_HEADER 2 #define SCE_SEARCHRESULT_LINE_NUMBER 3 #define SCE_SEARCHRESULT_WORD2SEARCH 4 -#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 +//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) #define SCE_SEARCHRESULT_CURRENT_LINE 6 #define SCE_OBJC_DIRECTIVE 20 #define SCE_OBJC_QUALIFIER 21 @@ -639,6 +642,7 @@ #define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 +#define SCE_ERR_GCC_EXCERPT 25 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 @@ -2036,6 +2040,50 @@ #define SCE_DF_SCOPEWORD 12 #define SCE_DF_OPERATOR 13 #define SCE_DF_ICODE 14 +#define SCE_HOLLYWOOD_DEFAULT 0 +#define SCE_HOLLYWOOD_COMMENT 1 +#define SCE_HOLLYWOOD_COMMENTBLOCK 2 +#define SCE_HOLLYWOOD_NUMBER 3 +#define SCE_HOLLYWOOD_KEYWORD 4 +#define SCE_HOLLYWOOD_STDAPI 5 +#define SCE_HOLLYWOOD_PLUGINAPI 6 +#define SCE_HOLLYWOOD_PLUGINMETHOD 7 +#define SCE_HOLLYWOOD_STRING 8 +#define SCE_HOLLYWOOD_STRINGBLOCK 9 +#define SCE_HOLLYWOOD_PREPROCESSOR 10 +#define SCE_HOLLYWOOD_OPERATOR 11 +#define SCE_HOLLYWOOD_IDENTIFIER 12 +#define SCE_HOLLYWOOD_CONSTANT 13 +#define SCE_HOLLYWOOD_HEXNUMBER 14 +#define SCE_RAKU_DEFAULT 0 +#define SCE_RAKU_ERROR 1 +#define SCE_RAKU_COMMENTLINE 2 +#define SCE_RAKU_COMMENTEMBED 3 +#define SCE_RAKU_POD 4 +#define SCE_RAKU_CHARACTER 5 +#define SCE_RAKU_HEREDOC_Q 6 +#define SCE_RAKU_HEREDOC_QQ 7 +#define SCE_RAKU_STRING 8 +#define SCE_RAKU_STRING_Q 9 +#define SCE_RAKU_STRING_QQ 10 +#define SCE_RAKU_STRING_Q_LANG 11 +#define SCE_RAKU_STRING_VAR 12 +#define SCE_RAKU_REGEX 13 +#define SCE_RAKU_REGEX_VAR 14 +#define SCE_RAKU_ADVERB 15 +#define SCE_RAKU_NUMBER 16 +#define SCE_RAKU_PREPROCESSOR 17 +#define SCE_RAKU_OPERATOR 18 +#define SCE_RAKU_WORD 19 +#define SCE_RAKU_FUNCTION 20 +#define SCE_RAKU_IDENTIFIER 21 +#define SCE_RAKU_TYPEDEF 22 +#define SCE_RAKU_MU 23 +#define SCE_RAKU_POSITIONAL 24 +#define SCE_RAKU_ASSOCIATIVE 25 +#define SCE_RAKU_CALLABLE 26 +#define SCE_RAKU_GRAMMAR 27 +#define SCE_RAKU_CLASS 28 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/NppPlugin/include/Sci_Position.h b/NppPlugin/include/Sci_Position.h index abd0f340..bad91b44 100644 --- a/NppPlugin/include/Sci_Position.h +++ b/NppPlugin/include/Sci_Position.h @@ -15,10 +15,12 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold +// Definitions of common types typedef size_t Sci_PositionU; + // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE -typedef long Sci_PositionCR; +typedef intptr_t Sci_PositionCR; #ifdef _WIN32 #define SCI_METHOD __stdcall diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index a292dc37..44ba7adf 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -38,6 +38,8 @@ typedef intptr_t sptr_t; typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +#ifndef SCI_DISABLE_AUTOGENERATED + /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 #define SCI_START 2000 @@ -63,6 +65,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 +#define SCI_MARKERHANDLEFROMLINE 2732 +#define SCI_MARKERNUMBERFROMLINE 2733 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 @@ -93,6 +97,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 +#define SCI_SETTABMINIMUMWIDTH 2724 +#define SCI_GETTABMINIMUMWIDTH 2725 #define SCI_CLEARTABSTOPS 2675 #define SCI_ADDTABSTOP 2676 #define SCI_GETNEXTTABSTOP 2677 @@ -102,6 +108,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 #define SCI_SETIMEINTERACTION 2679 +#define SC_ALPHA_TRANSPARENT 0 +#define SC_ALPHA_OPAQUE 255 +#define SC_ALPHA_NOALPHA 256 +#define SC_CURSORNORMAL -1 +#define SC_CURSORARROW 2 +#define SC_CURSORWAIT 4 +#define SC_CURSORREVERSEARROW 7 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -293,6 +306,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_POINTCHARACTER 19 #define INDIC_GRADIENT 20 #define INDIC_GRADIENTCENTRE 21 +#define INDIC_EXPLORERLINK 22 #define INDIC_CONTAINER 8 #define INDIC_IME 32 #define INDIC_IME_MAX 35 @@ -449,8 +463,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETSTARTVIRTUALSPACE 2728 +#define SCI_GETTARGETSTARTVIRTUALSPACE 2729 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETENDVIRTUALSPACE 2730 +#define SCI_GETTARGETENDVIRTUALSPACE 2731 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 #define SCI_TARGETFROMSELECTION 2287 @@ -668,6 +686,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 +#define SCI_BRACEMATCHNEXT 2369 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 @@ -685,6 +704,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETEDGECOLOUR 2365 #define SCI_MULTIEDGEADDLINE 2694 #define SCI_MULTIEDGECLEARALL 2695 +#define SCI_GETMULTIEDGECOLUMN 2749 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 @@ -719,10 +739,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SCI_SETMOUSEWHEELCAPTURES 2696 #define SCI_GETMOUSEWHEELCAPTURES 2697 -#define SC_CURSORNORMAL -1 -#define SC_CURSORARROW 2 -#define SC_CURSORWAIT 4 -#define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 @@ -817,18 +833,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 -#define SCI_GETCARETSTICKY 2457 -#define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 -#define SC_ALPHA_TRANSPARENT 0 -#define SC_ALPHA_OPAQUE 255 -#define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 @@ -929,7 +942,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 +#define SCI_GETSELECTIONNSTARTVIRTUALSPACE 2726 #define SCI_SETSELECTIONNEND 2586 +#define SCI_GETSELECTIONNENDVIRTUALSPACE 2727 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 @@ -993,6 +1008,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_EOLANNOTATIONSETTEXT 2740 +#define SCI_EOLANNOTATIONGETTEXT 2741 +#define SCI_EOLANNOTATIONSETSTYLE 2742 +#define SCI_EOLANNOTATIONGETSTYLE 2743 +#define SCI_EOLANNOTATIONCLEARALL 2744 +#define EOLANNOTATION_HIDDEN 0 +#define EOLANNOTATION_STANDARD 1 +#define EOLANNOTATION_BOXED 2 +#define SCI_EOLANNOTATIONSETVISIBLE 2745 +#define SCI_EOLANNOTATIONGETVISIBLE 2746 +#define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 +#define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 @@ -1030,6 +1057,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_NAMEOFSTYLE 4030 #define SCI_TAGSOFSTYLE 4031 #define SCI_DESCRIPTIONOFSTYLE 4032 +#define SCI_SETILEXER 4033 #define SC_MOD_NONE 0x0 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 @@ -1053,8 +1081,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_LEXERSTATE 0x80000 #define SC_MOD_INSERTCHECK 0x100000 #define SC_MOD_CHANGETABSTOPS 0x200000 -#define SC_MODEVENTMASKALL 0x3FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 +#define SC_MOD_CHANGEEOLANNOTATION 0x400000 +#define SC_MODEVENTMASKALL 0x7FFFFF +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1144,11 +1173,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDEXPOSITIONFROMLINE 2714 #endif +#define SCI_GETBOOSTREGEXERRMSG 5000 + #define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#endif + /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ @@ -1246,12 +1279,12 @@ struct SCNotification { }; struct SearchResultMarking { - long _start; - long _end; + intptr_t _start; + intptr_t _end; }; struct SearchResultMarkings { - long _length; + intptr_t _length; SearchResultMarking *_markings; }; diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index 7e912f0b..9d89b099 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once #include "Notepad_plus_msgs.h" #include "Window.h" @@ -34,16 +23,16 @@ enum class PosAlign { left, right, top, bottom }; struct DLGTEMPLATEEX { - WORD dlgVer; - WORD signature; - DWORD helpID; - DWORD exStyle; - DWORD style; - WORD cDlgItems; - short x; - short y; - short cx; - short cy; + WORD dlgVer = 0; + WORD signature = 0; + DWORD helpID = 0; + DWORD exStyle = 0; + DWORD style = 0; + WORD cDlgItems = 0; + short x = 0; + short y = 0; + short cx = 0; + short cy = 0; // The structure has more fields but are variable length }; @@ -60,7 +49,9 @@ public : void goToCenter(); - void display(bool toShow = true) const; + void display(bool toShow = true, bool enhancedPositioningCheckWhenShowing = false) const; + + RECT getViewablePositionRect(RECT testRc) const; POINT getTopPoint(HWND hwnd, bool isLeft = true) const; @@ -69,13 +60,17 @@ public : return (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, checkControlID), BM_GETCHECK, 0, 0)); } + void setChecked(int checkControlID, bool checkOrNot = true) const + { + ::SendDlgItemMessage(_hSelf, checkControlID, BM_SETCHECK, checkOrNot ? BST_CHECKED : BST_UNCHECKED, 0); + } + virtual void destroy() override; protected: - RECT _rc; - static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); - virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; + RECT _rc = { 0 }; + static intptr_t CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); + virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; - void alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point); HGLOBAL makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate); }; diff --git a/NppPlugin/include/Window.h b/NppPlugin/include/Window.h index e69e02f8..76b6a65f 100644 --- a/NppPlugin/include/Window.h +++ b/NppPlugin/include/Window.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . #pragma once diff --git a/NppPlugin/include/dockingResource.h b/NppPlugin/include/dockingResource.h index 8b83f912..66220fc2 100644 --- a/NppPlugin/include/dockingResource.h +++ b/NppPlugin/include/dockingResource.h @@ -1,33 +1,21 @@ -// this file is part of docking functionality for Notepad++ +// This file is part of Notepad++ project // Copyright (C)2006 Jens Lorenz -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef DOCKING_RESOURCE_H -#define DOCKING_RESOURCE_H +#pragma once #define DM_NOFOCUSWHILECLICKINGCAPTION TEXT("NOFOCUSWHILECLICKINGCAPTION") @@ -77,5 +65,3 @@ //nmhdr.hwndFrom = DockingCont::_hself; //nmhdr.idFrom = 0; -#endif //DOCKING_RESOURCE_H - diff --git a/NppPlugin/include/keys.h b/NppPlugin/include/keys.h index 9fc3abd7..01a2c4b2 100644 --- a/NppPlugin/include/keys.h +++ b/NppPlugin/include/keys.h @@ -1,29 +1,18 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . /* diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index b1d7667f..86b192cf 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -1,67 +1,56 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#ifndef MENUCMDID_H -#define MENUCMDID_H +#pragma once #define IDM 40000 #define IDM_FILE (IDM + 1000) // IMPORTANT: If list below is modified, you have to change the value of IDM_FILEMENU_LASTONE and IDM_FILEMENU_EXISTCMDPOSITION - #define IDM_FILE_NEW (IDM_FILE + 1) - #define IDM_FILE_OPEN (IDM_FILE + 2) - #define IDM_FILE_CLOSE (IDM_FILE + 3) - #define IDM_FILE_CLOSEALL (IDM_FILE + 4) - #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) - #define IDM_FILE_SAVE (IDM_FILE + 6) - #define IDM_FILE_SAVEALL (IDM_FILE + 7) - #define IDM_FILE_SAVEAS (IDM_FILE + 8) - #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) - #define IDM_FILE_PRINT (IDM_FILE + 10) - #define IDM_FILE_PRINTNOW 1001 - #define IDM_FILE_EXIT (IDM_FILE + 11) - #define IDM_FILE_LOADSESSION (IDM_FILE + 12) - #define IDM_FILE_SAVESESSION (IDM_FILE + 13) - #define IDM_FILE_RELOAD (IDM_FILE + 14) - #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) - #define IDM_FILE_DELETE (IDM_FILE + 16) - #define IDM_FILE_RENAME (IDM_FILE + 17) - #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) - #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) - #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) - #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) - #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) - #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) - #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_NEW (IDM_FILE + 1) + #define IDM_FILE_OPEN (IDM_FILE + 2) + #define IDM_FILE_CLOSE (IDM_FILE + 3) + #define IDM_FILE_CLOSEALL (IDM_FILE + 4) + #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) + #define IDM_FILE_SAVE (IDM_FILE + 6) + #define IDM_FILE_SAVEALL (IDM_FILE + 7) + #define IDM_FILE_SAVEAS (IDM_FILE + 8) + #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) + #define IDM_FILE_PRINT (IDM_FILE + 10) + #define IDM_FILE_PRINTNOW 1001 + #define IDM_FILE_EXIT (IDM_FILE + 11) + #define IDM_FILE_LOADSESSION (IDM_FILE + 12) + #define IDM_FILE_SAVESESSION (IDM_FILE + 13) + #define IDM_FILE_RELOAD (IDM_FILE + 14) + #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) + #define IDM_FILE_DELETE (IDM_FILE + 16) + #define IDM_FILE_RENAME (IDM_FILE + 17) + #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) + #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) + #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) + #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) + #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) + #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) + #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_CONTAININGFOLDERASWORKSPACE (IDM_FILE + 25) // IMPORTANT: If list above is modified, you have to change the following values: // To be updated if new menu item(s) is (are) added in menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_UNCHANGED + #define IDM_FILEMENU_LASTONE IDM_FILE_CONTAININGFOLDERASWORKSPACE // 0 based position of command "Exit" including the bars in the file menu // and without counting "Recent files history" items @@ -93,104 +82,100 @@ #define IDM_EDIT (IDM + 2000) - #define IDM_EDIT_CUT (IDM_EDIT + 1) - #define IDM_EDIT_COPY (IDM_EDIT + 2) - #define IDM_EDIT_UNDO (IDM_EDIT + 3) - #define IDM_EDIT_REDO (IDM_EDIT + 4) - #define IDM_EDIT_PASTE (IDM_EDIT + 5) - #define IDM_EDIT_DELETE (IDM_EDIT + 6) - #define IDM_EDIT_SELECTALL (IDM_EDIT + 7) - #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20) - - #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) - #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) - #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) - #define IDM_EDIT_REMOVE_DUP_LINES (IDM_EDIT + 77) - #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) - #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) - #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) - #define IDM_EDIT_LINE_UP (IDM_EDIT + 14) - #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15) - #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16) - #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17) - #define IDM_EDIT_PROPERCASE_FORCE (IDM_EDIT + 67) - #define IDM_EDIT_PROPERCASE_BLEND (IDM_EDIT + 68) - #define IDM_EDIT_SENTENCECASE_FORCE (IDM_EDIT + 69) - #define IDM_EDIT_SENTENCECASE_BLEND (IDM_EDIT + 70) - #define IDM_EDIT_INVERTCASE (IDM_EDIT + 71) - #define IDM_EDIT_RANDOMCASE (IDM_EDIT + 72) - #define IDM_EDIT_REMOVEEMPTYLINES (IDM_EDIT + 55) - #define IDM_EDIT_REMOVEEMPTYLINESWITHBLANK (IDM_EDIT + 56) - #define IDM_EDIT_BLANKLINEABOVECURRENT (IDM_EDIT + 57) - #define IDM_EDIT_BLANKLINEBELOWCURRENT (IDM_EDIT + 58) - #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING (IDM_EDIT + 59) - #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING (IDM_EDIT + 60) - #define IDM_EDIT_SORTLINES_INTEGER_ASCENDING (IDM_EDIT + 61) - #define IDM_EDIT_SORTLINES_INTEGER_DESCENDING (IDM_EDIT + 62) - #define IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING (IDM_EDIT + 63) - #define IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING (IDM_EDIT + 64) - #define IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING (IDM_EDIT + 65) - #define IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING (IDM_EDIT + 66) - - #define IDM_EDIT_OPENASFILE (IDM_EDIT + 73) - #define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74) - #define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75) - #define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76) - -// Menu macro - #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) - #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) - #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21) -//----------- - - #define IDM_EDIT_BLOCK_COMMENT (IDM_EDIT + 22) - #define IDM_EDIT_STREAM_COMMENT (IDM_EDIT + 23) - #define IDM_EDIT_TRIMTRAILING (IDM_EDIT + 24) - #define IDM_EDIT_TRIMLINEHEAD (IDM_EDIT + 42) - #define IDM_EDIT_TRIM_BOTH (IDM_EDIT + 43) - #define IDM_EDIT_EOL2WS (IDM_EDIT + 44) - #define IDM_EDIT_TRIMALL (IDM_EDIT + 45) - #define IDM_EDIT_TAB2SW (IDM_EDIT + 46) - #define IDM_EDIT_SW2TAB_LEADING (IDM_EDIT + 53) - #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54) - #define IDM_EDIT_STREAM_UNCOMMENT (IDM_EDIT + 47) - -// Menu macro - #define IDM_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25) -//----------- - - #define IDM_EDIT_RTL (IDM_EDIT + 26) - #define IDM_EDIT_LTR (IDM_EDIT + 27) - #define IDM_EDIT_SETREADONLY (IDM_EDIT + 28) - #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29) - #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30) - #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31) - -// Menu macro - #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32) -//----------- - - #define IDM_EDIT_CLEARREADONLY (IDM_EDIT + 33) - #define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34) - #define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35) - #define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36) - #define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37) - #define IDM_EDIT_PASTE_AS_HTML (IDM_EDIT + 38) - #define IDM_EDIT_PASTE_AS_RTF (IDM_EDIT + 39) - #define IDM_EDIT_COPY_BINARY (IDM_EDIT + 48) - #define IDM_EDIT_CUT_BINARY (IDM_EDIT + 49) - #define IDM_EDIT_PASTE_BINARY (IDM_EDIT + 50) - #define IDM_EDIT_CHAR_PANEL (IDM_EDIT + 51) - #define IDM_EDIT_CLIPBOARDHISTORY_PANEL (IDM_EDIT + 52) - - #define IDM_EDIT_AUTOCOMPLETE (50000 + 0) - #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) - #define IDM_EDIT_FUNCCALLTIP (50000 + 2) - #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6) - - //Belong to MENU FILE - #define IDM_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40) - #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41) + #define IDM_EDIT_CUT (IDM_EDIT + 1) + #define IDM_EDIT_COPY (IDM_EDIT + 2) + #define IDM_EDIT_UNDO (IDM_EDIT + 3) + #define IDM_EDIT_REDO (IDM_EDIT + 4) + #define IDM_EDIT_PASTE (IDM_EDIT + 5) + #define IDM_EDIT_DELETE (IDM_EDIT + 6) + #define IDM_EDIT_SELECTALL (IDM_EDIT + 7) + #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) + #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) + #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) + #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) + #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) + #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) + #define IDM_EDIT_LINE_UP (IDM_EDIT + 14) + #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15) + #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16) + #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17) + #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) + #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) + #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20) + #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21) + #define IDM_EDIT_BLOCK_COMMENT (IDM_EDIT + 22) + #define IDM_EDIT_STREAM_COMMENT (IDM_EDIT + 23) + #define IDM_EDIT_TRIMTRAILING (IDM_EDIT + 24) + #define IDM_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25) + #define IDM_EDIT_RTL (IDM_EDIT + 26) + #define IDM_EDIT_LTR (IDM_EDIT + 27) + #define IDM_EDIT_SETREADONLY (IDM_EDIT + 28) + #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29) + #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30) + #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31) + #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32) + #define IDM_EDIT_CLEARREADONLY (IDM_EDIT + 33) + #define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34) + #define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35) + #define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36) + #define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37) + #define IDM_EDIT_PASTE_AS_HTML (IDM_EDIT + 38) + #define IDM_EDIT_PASTE_AS_RTF (IDM_EDIT + 39) + #define IDM_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40) + #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41) + #define IDM_EDIT_TRIMLINEHEAD (IDM_EDIT + 42) + #define IDM_EDIT_TRIM_BOTH (IDM_EDIT + 43) + #define IDM_EDIT_EOL2WS (IDM_EDIT + 44) + #define IDM_EDIT_TRIMALL (IDM_EDIT + 45) + #define IDM_EDIT_TAB2SW (IDM_EDIT + 46) + #define IDM_EDIT_STREAM_UNCOMMENT (IDM_EDIT + 47) + #define IDM_EDIT_COPY_BINARY (IDM_EDIT + 48) + #define IDM_EDIT_CUT_BINARY (IDM_EDIT + 49) + #define IDM_EDIT_PASTE_BINARY (IDM_EDIT + 50) + #define IDM_EDIT_CHAR_PANEL (IDM_EDIT + 51) + #define IDM_EDIT_CLIPBOARDHISTORY_PANEL (IDM_EDIT + 52) + #define IDM_EDIT_SW2TAB_LEADING (IDM_EDIT + 53) + #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54) + #define IDM_EDIT_REMOVEEMPTYLINES (IDM_EDIT + 55) + #define IDM_EDIT_REMOVEEMPTYLINESWITHBLANK (IDM_EDIT + 56) + #define IDM_EDIT_BLANKLINEABOVECURRENT (IDM_EDIT + 57) + #define IDM_EDIT_BLANKLINEBELOWCURRENT (IDM_EDIT + 58) + #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING (IDM_EDIT + 59) + #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING (IDM_EDIT + 60) + #define IDM_EDIT_SORTLINES_INTEGER_ASCENDING (IDM_EDIT + 61) + #define IDM_EDIT_SORTLINES_INTEGER_DESCENDING (IDM_EDIT + 62) + #define IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING (IDM_EDIT + 63) + #define IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING (IDM_EDIT + 64) + #define IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING (IDM_EDIT + 65) + #define IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING (IDM_EDIT + 66) + #define IDM_EDIT_PROPERCASE_FORCE (IDM_EDIT + 67) + #define IDM_EDIT_PROPERCASE_BLEND (IDM_EDIT + 68) + #define IDM_EDIT_SENTENCECASE_FORCE (IDM_EDIT + 69) + #define IDM_EDIT_SENTENCECASE_BLEND (IDM_EDIT + 70) + #define IDM_EDIT_INVERTCASE (IDM_EDIT + 71) + #define IDM_EDIT_RANDOMCASE (IDM_EDIT + 72) + #define IDM_EDIT_OPENASFILE (IDM_EDIT + 73) + #define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74) + #define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75) + #define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76) + #define IDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES (IDM_EDIT + 77) + #define IDM_EDIT_SORTLINES_RANDOMLY (IDM_EDIT + 78) + #define IDM_EDIT_REMOVE_ANY_DUP_LINES (IDM_EDIT + 79) + #define IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING (IDM_EDIT + 80) + #define IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING (IDM_EDIT + 81) + #define IDM_EDIT_COPY_LINK (IDM_EDIT + 82) + #define IDM_EDIT_SORTLINES_REVERSE_ORDER (IDM_EDIT + 83) + #define IDM_EDIT_INSERT_DATETIME_SHORT (IDM_EDIT + 84) + #define IDM_EDIT_INSERT_DATETIME_LONG (IDM_EDIT + 85) + #define IDM_EDIT_INSERT_DATETIME_CUSTOMIZED (IDM_EDIT + 86) + #define IDM_EDIT_COPY_ALL_NAMES (IDM_EDIT + 87) + #define IDM_EDIT_COPY_ALL_PATHS (IDM_EDIT + 88) + + #define IDM_EDIT_AUTOCOMPLETE (50000 + 0) + #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) + #define IDM_EDIT_FUNCCALLTIP (50000 + 2) + #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6) + #define IDM_SEARCH (IDM + 3000) #define IDM_SEARCH_FIND (IDM_SEARCH + 1) @@ -238,20 +223,36 @@ #define IDM_SEARCH_GONEXTMARKER_DEF (IDM_SEARCH + 44) #define IDM_FOCUS_ON_FOUND_RESULTS (IDM_SEARCH + 45) - #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46) - #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47) + #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46) + #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47) #define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48) #define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49) #define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50) - #define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51) - #define IDM_SEARCH_FINDCHARINRANGE (IDM_SEARCH + 52) - #define IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53) - #define IDM_SEARCH_MARK (IDM_SEARCH + 54) - + #define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51) + #define IDM_SEARCH_FINDCHARINRANGE (IDM_SEARCH + 52) + #define IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53) + #define IDM_SEARCH_MARK (IDM_SEARCH + 54) + + #define IDM_SEARCH_STYLE1TOCLIP (IDM_SEARCH + 55) + #define IDM_SEARCH_STYLE2TOCLIP (IDM_SEARCH + 56) + #define IDM_SEARCH_STYLE3TOCLIP (IDM_SEARCH + 57) + #define IDM_SEARCH_STYLE4TOCLIP (IDM_SEARCH + 58) + #define IDM_SEARCH_STYLE5TOCLIP (IDM_SEARCH + 59) + #define IDM_SEARCH_ALLSTYLESTOCLIP (IDM_SEARCH + 60) + #define IDM_SEARCH_MARKEDTOCLIP (IDM_SEARCH + 61) + + #define IDM_SEARCH_MARKONEEXT1 (IDM_SEARCH + 62) + #define IDM_SEARCH_MARKONEEXT2 (IDM_SEARCH + 63) + #define IDM_SEARCH_MARKONEEXT3 (IDM_SEARCH + 64) + #define IDM_SEARCH_MARKONEEXT4 (IDM_SEARCH + 65) + #define IDM_SEARCH_MARKONEEXT5 (IDM_SEARCH + 66) + #define IDM_MISC (IDM + 3500) - #define IDM_FILESWITCHER_FILESCLOSE (IDM_MISC + 1) - #define IDM_FILESWITCHER_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_DOCLIST_FILESCLOSE (IDM_MISC + 1) + #define IDM_DOCLIST_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_DOCLIST_COPYNAMES (IDM_MISC + 3) + #define IDM_DOCLIST_COPYPATHS (IDM_MISC + 4) #define IDM_VIEW (IDM + 4000) @@ -265,7 +266,7 @@ #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) #define IDM_VIEW_POSTIT (IDM_VIEW + 9) #define IDM_VIEW_TOGGLE_FOLDALL (IDM_VIEW + 10) - //#define IDM_VIEW_USER_DLG (IDM_VIEW + 11) + #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) #define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) #define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14) @@ -281,8 +282,8 @@ #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24) #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25) #define IDM_VIEW_EOL (IDM_VIEW + 26) - #define IDM_VIEW_EDGELINE (IDM_VIEW + 27) - #define IDM_VIEW_EDGEBACKGROUND (IDM_VIEW + 28) + #define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) + #define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) #define IDM_VIEW_TOGGLE_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) @@ -291,7 +292,7 @@ #define IDM_VIEW_ALWAYSONTOP (IDM_VIEW + 34) #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35) #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36) - #define IDM_VIEW_EDGENONE (IDM_VIEW + 37) + //#define IDM_VIEW_EDGENONE (IDM_VIEW + 37) #define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) #define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) #define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) @@ -300,10 +301,10 @@ #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) #define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) - #define IDM_VIEW_LWDEF (IDM_VIEW + 46) - #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) - #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) - #define IDM_VIEW_SUMMARY (IDM_VIEW + 49) + #define IDM_VIEW_LWDEF (IDM_VIEW + 46) + #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) + #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) + #define IDM_VIEW_SUMMARY (IDM_VIEW + 49) #define IDM_VIEW_FOLD (IDM_VIEW + 50) #define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1) @@ -325,37 +326,44 @@ #define IDM_VIEW_UNFOLD_7 (IDM_VIEW_UNFOLD + 7) #define IDM_VIEW_UNFOLD_8 (IDM_VIEW_UNFOLD + 8) - #define IDM_VIEW_FILESWITCHER_PANEL (IDM_VIEW + 70) - #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) - #define IDM_EXPORT_FUNC_LIST_AND_QUIT (IDM_VIEW + 73) - - #define IDM_VIEW_DOC_MAP (IDM_VIEW + 80) - - #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81) - #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82) - #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83) - - #define IDM_VIEW_FUNC_LIST (IDM_VIEW + 84) - #define IDM_VIEW_FILEBROWSER (IDM_VIEW + 85) - - #define IDM_VIEW_TAB1 (IDM_VIEW + 86) - #define IDM_VIEW_TAB2 (IDM_VIEW + 87) - #define IDM_VIEW_TAB3 (IDM_VIEW + 88) - #define IDM_VIEW_TAB4 (IDM_VIEW + 89) - #define IDM_VIEW_TAB5 (IDM_VIEW + 90) - #define IDM_VIEW_TAB6 (IDM_VIEW + 91) - #define IDM_VIEW_TAB7 (IDM_VIEW + 92) - #define IDM_VIEW_TAB8 (IDM_VIEW + 93) - #define IDM_VIEW_TAB9 (IDM_VIEW + 94) - #define IDM_VIEW_TAB_NEXT (IDM_VIEW + 95) - #define IDM_VIEW_TAB_PREV (IDM_VIEW + 96) + #define IDM_VIEW_DOCLIST (IDM_VIEW + 70) + #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) + #define IDM_EXPORT_FUNC_LIST_AND_QUIT (IDM_VIEW + 73) + + #define IDM_VIEW_DOC_MAP (IDM_VIEW + 80) + + #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81) + #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82) + #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83) + + #define IDM_VIEW_FUNC_LIST (IDM_VIEW + 84) + #define IDM_VIEW_FILEBROWSER (IDM_VIEW + 85) + + #define IDM_VIEW_TAB1 (IDM_VIEW + 86) + #define IDM_VIEW_TAB2 (IDM_VIEW + 87) + #define IDM_VIEW_TAB3 (IDM_VIEW + 88) + #define IDM_VIEW_TAB4 (IDM_VIEW + 89) + #define IDM_VIEW_TAB5 (IDM_VIEW + 90) + #define IDM_VIEW_TAB6 (IDM_VIEW + 91) + #define IDM_VIEW_TAB7 (IDM_VIEW + 92) + #define IDM_VIEW_TAB8 (IDM_VIEW + 93) + #define IDM_VIEW_TAB9 (IDM_VIEW + 94) + #define IDM_VIEW_TAB_NEXT (IDM_VIEW + 95) + #define IDM_VIEW_TAB_PREV (IDM_VIEW + 96) #define IDM_VIEW_MONITORING (IDM_VIEW + 97) - #define IDM_VIEW_TAB_MOVEFORWARD (IDM_VIEW + 98) - #define IDM_VIEW_TAB_MOVEBACKWARD (IDM_VIEW + 99) - #define IDM_VIEW_IN_FIREFOX (IDM_VIEW + 100) - #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101) - #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102) - #define IDM_VIEW_IN_IE (IDM_VIEW + 103) + #define IDM_VIEW_TAB_MOVEFORWARD (IDM_VIEW + 98) + #define IDM_VIEW_TAB_MOVEBACKWARD (IDM_VIEW + 99) + #define IDM_VIEW_IN_FIREFOX (IDM_VIEW + 100) + #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101) + #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102) + #define IDM_VIEW_IN_IE (IDM_VIEW + 103) + + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_1 (IDM_VIEW + 104) + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_2 (IDM_VIEW + 105) + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_3 (IDM_VIEW + 106) + #define IDM_VIEW_SWITCHTO_FILEBROWSER (IDM_VIEW + 107) + #define IDM_VIEW_SWITCHTO_FUNC_LIST (IDM_VIEW + 108) + #define IDM_VIEW_SWITCHTO_DOCLIST (IDM_VIEW + 109) #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 @@ -369,14 +377,14 @@ #define IDM_FORMAT_TOMAC (IDM_FORMAT + 3) #define IDM_FORMAT_ANSI (IDM_FORMAT + 4) #define IDM_FORMAT_UTF_8 (IDM_FORMAT + 5) - #define IDM_FORMAT_UCS_2BE (IDM_FORMAT + 6) - #define IDM_FORMAT_UCS_2LE (IDM_FORMAT + 7) + #define IDM_FORMAT_UTF_16BE (IDM_FORMAT + 6) + #define IDM_FORMAT_UTF_16LE (IDM_FORMAT + 7) #define IDM_FORMAT_AS_UTF_8 (IDM_FORMAT + 8) #define IDM_FORMAT_CONV2_ANSI (IDM_FORMAT + 9) #define IDM_FORMAT_CONV2_AS_UTF_8 (IDM_FORMAT + 10) #define IDM_FORMAT_CONV2_UTF_8 (IDM_FORMAT + 11) - #define IDM_FORMAT_CONV2_UCS_2BE (IDM_FORMAT + 12) - #define IDM_FORMAT_CONV2_UCS_2LE (IDM_FORMAT + 13) + #define IDM_FORMAT_CONV2_UTF_16BE (IDM_FORMAT + 12) + #define IDM_FORMAT_CONV2_UTF_16LE (IDM_FORMAT + 13) #define IDM_FORMAT_ENCODE (IDM_FORMAT + 20) #define IDM_FORMAT_WIN_1250 (IDM_FORMAT_ENCODE + 0) @@ -403,8 +411,8 @@ #define IDM_FORMAT_ISO_8859_14 (IDM_FORMAT_ENCODE + 21) #define IDM_FORMAT_ISO_8859_15 (IDM_FORMAT_ENCODE + 22) //#define IDM_FORMAT_ISO_8859_16 (IDM_FORMAT_ENCODE + 23) - #define IDM_FORMAT_DOS_437 (IDM_FORMAT_ENCODE + 24) - #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25) + #define IDM_FORMAT_DOS_437 (IDM_FORMAT_ENCODE + 24) + #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25) #define IDM_FORMAT_DOS_737 (IDM_FORMAT_ENCODE + 26) #define IDM_FORMAT_DOS_775 (IDM_FORMAT_ENCODE + 27) #define IDM_FORMAT_DOS_850 (IDM_FORMAT_ENCODE + 28) @@ -488,10 +496,10 @@ #define IDM_LANG_POWERSHELL (IDM_LANG + 53) #define IDM_LANG_R (IDM_LANG + 54) #define IDM_LANG_JSP (IDM_LANG + 55) - #define IDM_LANG_COFFEESCRIPT (IDM_LANG + 56) - #define IDM_LANG_JSON (IDM_LANG + 57) + #define IDM_LANG_COFFEESCRIPT (IDM_LANG + 56) + #define IDM_LANG_JSON (IDM_LANG + 57) #define IDM_LANG_FORTRAN_77 (IDM_LANG + 58) - #define IDM_LANG_BAANC (IDM_LANG + 59) + #define IDM_LANG_BAANC (IDM_LANG + 59) #define IDM_LANG_SREC (IDM_LANG + 60) #define IDM_LANG_IHEX (IDM_LANG + 61) #define IDM_LANG_TEHEX (IDM_LANG + 62) @@ -507,7 +515,7 @@ #define IDM_LANG_FORTH (IDM_LANG + 72) #define IDM_LANG_LATEX (IDM_LANG + 73) #define IDM_LANG_MMIXAL (IDM_LANG + 74) - #define IDM_LANG_NIMROD (IDM_LANG + 75) + #define IDM_LANG_NIM (IDM_LANG + 75) #define IDM_LANG_NNCRONTAB (IDM_LANG + 76) #define IDM_LANG_OSCRIPT (IDM_LANG + 77) #define IDM_LANG_REBOL (IDM_LANG + 78) @@ -516,30 +524,32 @@ #define IDM_LANG_SPICE (IDM_LANG + 81) #define IDM_LANG_TXT2TAGS (IDM_LANG + 82) #define IDM_LANG_VISUALPROLOG (IDM_LANG + 83) + #define IDM_LANG_TYPESCRIPT (IDM_LANG + 84) #define IDM_LANG_EXTERNAL (IDM_LANG + 165) #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179) #define IDM_LANG_USER (IDM_LANG + 180) //46180: Used for translation #define IDM_LANG_USER_LIMIT (IDM_LANG + 210) //46210: Ajust with IDM_LANG_USER - #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_OPENUDLDIR (IDM_LANG + 300) + #define IDM_LANG_UDLCOLLECTION_PROJECT_SITE (IDM_LANG + 301) + - - #define IDM_ABOUT (IDM + 7000) #define IDM_HOMESWEETHOME (IDM_ABOUT + 1) #define IDM_PROJECTPAGE (IDM_ABOUT + 2) - #define IDM_ONLINEHELP (IDM_ABOUT + 3) + #define IDM_ONLINEDOCUMENT (IDM_ABOUT + 3) #define IDM_FORUM (IDM_ABOUT + 4) //#define IDM_PLUGINSHOME (IDM_ABOUT + 5) #define IDM_UPDATE_NPP (IDM_ABOUT + 6) #define IDM_WIKIFAQ (IDM_ABOUT + 7) - #define IDM_HELP (IDM_ABOUT + 8) - #define IDM_CONFUPDATERPROXY (IDM_ABOUT + 9) - #define IDM_CMDLINEARGUMENTS (IDM_ABOUT + 10) - #define IDM_ONLINESUPPORT (IDM_ABOUT + 11) - #define IDM_DEBUGINFO (IDM_ABOUT + 12) + //#define IDM_HELP (IDM_ABOUT + 8) + #define IDM_CONFUPDATERPROXY (IDM_ABOUT + 9) + #define IDM_CMDLINEARGUMENTS (IDM_ABOUT + 10) + //#define IDM_ONLINESUPPORT (IDM_ABOUT + 11) + #define IDM_DEBUGINFO (IDM_ABOUT + 12) #define IDM_SETTING (IDM + 8000) @@ -555,17 +565,17 @@ #define IDM_SETTING_PREFERENCE (IDM_SETTING + 11) #define IDM_SETTING_OPENPLUGINSDIR (IDM_SETTING + 14) #define IDM_SETTING_PLUGINADM (IDM_SETTING + 15) - #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) - #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) - #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) + #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) + #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) + #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) #define IDM_TOOL (IDM + 8500) - #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1) - #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2) - #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3) - #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) - #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) - #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) + #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1) + #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2) + #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3) + #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) + #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) + #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) #define IDM_EXECUTE (IDM + 9000) @@ -575,5 +585,3 @@ #define IDM_SYSTRAYPOPUP_NEW_AND_PASTE (IDM_SYSTRAYPOPUP + 3) #define IDM_SYSTRAYPOPUP_OPENFILE (IDM_SYSTRAYPOPUP + 4) #define IDM_SYSTRAYPOPUP_CLOSE (IDM_SYSTRAYPOPUP + 5) - -#endif //MENUCMDID_H diff --git a/NppPlugin/project/NppPlugin.vcxproj b/NppPlugin/project/NppPlugin.vcxproj index 13291b79..a0ea4f02 100644 --- a/NppPlugin/project/NppPlugin.vcxproj +++ b/NppPlugin/project/NppPlugin.vcxproj @@ -179,6 +179,7 @@ + Create @@ -195,8 +196,13 @@ + + + + + diff --git a/NppPlugin/project/NppPlugin.vcxproj.filters b/NppPlugin/project/NppPlugin.vcxproj.filters index f6253f6c..bc91814e 100644 --- a/NppPlugin/project/NppPlugin.vcxproj.filters +++ b/NppPlugin/project/NppPlugin.vcxproj.filters @@ -21,6 +21,9 @@ Source Files + + Source Files + @@ -56,6 +59,21 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + diff --git a/NppPlugin/src/NppDarkModeDummy.cpp b/NppPlugin/src/NppDarkModeDummy.cpp new file mode 100644 index 00000000..6f0ab09e --- /dev/null +++ b/NppPlugin/src/NppDarkModeDummy.cpp @@ -0,0 +1,19 @@ +#include "stdafx.h" //ADDED BY PYTHONSCRIPT +#include "NppDarkMode.h" + +namespace NppDarkMode +{ + bool isEnabled() + { + return false; + } + + HBRUSH getDarkerBackgroundBrush() + { + return 0; + } + + void setDarkTitleBar(HWND /*hwnd*/) + { + } +} diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index b18ce0ce..1906bb5d 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -1,42 +1,32 @@ // This file is part of Notepad++ project -// Copyright (C)2003 Don HO -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// Note that the GPL places important restrictions on "derived works", yet -// it does not provide a detailed definition of that term. To avoid -// misunderstandings, we consider an application to constitute a -// "derivative work" for the purpose of this license if it does any of the -// following: -// 1. Integrates source code from Notepad++. -// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable -// installer, such as those produced by InstallShield. -// 3. Links to a library or executes a program that does any of the above. +// Copyright (C)2021 Don HO + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// at your option any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// along with this program. If not, see . -#include "stdafx.h" +#include "stdafx.h" //ADDED BY PYTHONSCRIPT #include #include #include "StaticDialog.h" #include "Common.h" +#include "NppDarkMode.h" StaticDialog::~StaticDialog() { if (isCreated()) { // Prevent run_dlgProc from doing anything, since its virtual - ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, NULL); + ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, 0); destroy(); } } @@ -78,37 +68,111 @@ void StaticDialog::goToCenter() ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW); } -void StaticDialog::display(bool toShow) const +void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing) const { if (toShow) { - // If the user has switched from a dual monitor to a single monitor since we last - // displayed the dialog, then ensure that it's still visible on the single monitor. - RECT workAreaRect = {0}; - RECT rc = {0}; - ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); - ::GetWindowRect(_hSelf, &rc); - int newLeft = rc.left; - int newTop = rc.top; - int margin = ::GetSystemMetrics(SM_CYSMCAPTION); - - if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN)-margin) - newLeft -= rc.right - workAreaRect.right; - if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN)+margin) - newLeft = workAreaRect.left; - if (newTop > ::GetSystemMetrics(SM_CYVIRTUALSCREEN)-margin) - newTop -= rc.bottom - workAreaRect.bottom; - if (newTop + (rc.bottom - rc.top) < ::GetSystemMetrics(SM_YVIRTUALSCREEN)+margin) - newTop = workAreaRect.top; - - if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk - // Remember that MoveWindow wants width/height. - ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE); + if (enhancedPositioningCheckWhenShowing) + { + RECT testPositionRc, candidateRc; + + getWindowRect(testPositionRc); + + candidateRc = getViewablePositionRect(testPositionRc); + + if ((testPositionRc.left != candidateRc.left) || (testPositionRc.top != candidateRc.top)) + { + ::MoveWindow(_hSelf, candidateRc.left, candidateRc.top, + candidateRc.right - candidateRc.left, candidateRc.bottom - candidateRc.top, TRUE); + } + } + else + { + // If the user has switched from a dual monitor to a single monitor since we last + // displayed the dialog, then ensure that it's still visible on the single monitor. + RECT workAreaRect = { 0 }; + RECT rc = { 0 }; + ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); + ::GetWindowRect(_hSelf, &rc); + int newLeft = rc.left; + int newTop = rc.top; + int margin = ::GetSystemMetrics(SM_CYSMCAPTION); + + if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN) - margin) + newLeft -= rc.right - workAreaRect.right; + if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN) + margin) + newLeft = workAreaRect.left; + if (newTop > ::GetSystemMetrics(SM_CYVIRTUALSCREEN) - margin) + newTop -= rc.bottom - workAreaRect.bottom; + if (newTop + (rc.bottom - rc.top) < ::GetSystemMetrics(SM_YVIRTUALSCREEN) + margin) + newTop = workAreaRect.top; + + if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk + // Remember that MoveWindow wants width/height. + ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE); + } } Window::display(toShow); } +RECT StaticDialog::getViewablePositionRect(RECT testPositionRc) const +{ + HMONITOR hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONULL); + + MONITORINFO mi; + mi.cbSize = sizeof(MONITORINFO); + + bool rectPosViewableWithoutChange = false; + + if (hMon != NULL) + { + // rect would be at least partially visible on a monitor + + ::GetMonitorInfo(hMon, &mi); + + int margin = ::GetSystemMetrics(SM_CYBORDER) + ::GetSystemMetrics(SM_CYSIZEFRAME) + ::GetSystemMetrics(SM_CYCAPTION); + + // require that the title bar of the window be in a viewable place so the user can see it to grab it with the mouse + if ((testPositionRc.top >= mi.rcWork.top) && (testPositionRc.top + margin <= mi.rcWork.bottom) && + // require that some reasonable amount of width of the title bar be in the viewable area: + (testPositionRc.right - (margin * 2) > mi.rcWork.left) && (testPositionRc.left + (margin * 2) < mi.rcWork.right)) + { + rectPosViewableWithoutChange = true; + } + } + else + { + // rect would not have been visible on a monitor; get info about the nearest monitor to it + + hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONEAREST); + + ::GetMonitorInfo(hMon, &mi); + } + + RECT returnRc = testPositionRc; + + if (!rectPosViewableWithoutChange) + { + // reposition rect so that it would be viewable on current/nearest monitor, centering if reasonable + + LONG testRectWidth = testPositionRc.right - testPositionRc.left; + LONG testRectHeight = testPositionRc.bottom - testPositionRc.top; + LONG monWidth = mi.rcWork.right - mi.rcWork.left; + LONG monHeight = mi.rcWork.bottom - mi.rcWork.top; + + returnRc.left = mi.rcWork.left; + if (testRectWidth < monWidth) returnRc.left += (monWidth - testRectWidth) / 2; + returnRc.right = returnRc.left + testRectWidth; + + returnRc.top = mi.rcWork.top; + if (testRectHeight < monHeight) returnRc.top += (monHeight - testRectHeight) / 2; + returnRc.bottom = returnRc.top + testRectHeight; + } + + return returnRc; +} + HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate) { // Get Dlg Template resource @@ -127,11 +191,16 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat // Duplicate Dlg Template resource unsigned long sizeDlg = ::SizeofResource(_hInst, hDialogRC); HGLOBAL hMyDlgTemplate = ::GlobalAlloc(GPTR, sizeDlg); + if (!hMyDlgTemplate) return nullptr; + *ppMyDlgTemplate = static_cast(::GlobalLock(hMyDlgTemplate)); + if (!*ppMyDlgTemplate) return nullptr; ::memcpy(*ppMyDlgTemplate, pDlgTemplate, sizeDlg); - DLGTEMPLATEEX *pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); + DLGTEMPLATEEX* pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); + if (!pMyDlgTemplateEx) return nullptr; + if (pMyDlgTemplateEx->signature == 0xFFFF) pMyDlgTemplateEx->exStyle |= WS_EX_LAYOUTRTL; else @@ -160,16 +229,20 @@ void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) return; } + NppDarkMode::setDarkTitleBar(_hSelf); + // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(_hSelf)); } -INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +intptr_t CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: { + NppDarkMode::setDarkTitleBar(hwnd); + StaticDialog *pStaticDlg = reinterpret_cast(lParam); pStaticDlg->_hSelf = hwnd; ::SetWindowLongPtr(hwnd, GWLP_USERDATA, static_cast(lParam)); @@ -189,41 +262,3 @@ INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, L } } -void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point) -{ - RECT rc, rc2; - ::GetWindowRect(handle, &rc); - - point.x = rc.left; - point.y = rc.top; - - switch (pos) - { - case PosAlign::left: - { - ::GetWindowRect(handle2Align, &rc2); - point.x -= rc2.right - rc2.left; - break; - } - case PosAlign::right: - { - ::GetWindowRect(handle, &rc2); - point.x += rc2.right - rc2.left; - break; - } - case PosAlign::top: - { - ::GetWindowRect(handle2Align, &rc2); - point.y -= rc2.bottom - rc2.top; - break; - } - case PosAlign::bottom: - { - ::GetWindowRect(handle, &rc2); - point.y += rc2.bottom - rc2.top; - break; - } - } - - ::ScreenToClient(_hSelf, &point); -} diff --git a/PythonScript.Tests/TestRunner.cpp b/PythonScript.Tests/TestRunner.cpp index a2284f78..ed6d6f9d 100644 --- a/PythonScript.Tests/TestRunner.cpp +++ b/PythonScript.Tests/TestRunner.cpp @@ -13,8 +13,7 @@ void deleteEntry(NppPythonScript::ReplaceEntry* entry) void runReplace() { - - NppPythonScript::Replacer replacer; + NppPythonScript::Replacer replacer; std::list entries; bool moreEntries = replacer.startReplace("aaabbbaaabb", 12, 0, 0, "(b+)", "x$1x", NppPythonScript::python_re_flag_normal, entries); ASSERT_EQ(2, entries.size()); @@ -26,26 +25,26 @@ void runReplace() int main(int argc, char* argv[]) { #ifdef _DEBUG - _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); -_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); -_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); -_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); -_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); -_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); -_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); + _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); + _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); + _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); + _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); + _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); _CrtMemState state; _CrtMemCheckpoint(&state); #endif - + ::testing::InitGoogleTest(&argc, argv); RUN_ALL_TESTS(); - + // This function call is used to check if we've created memory leaks using startReplace // Gtest creates various static objects, so it can be a bit tricky to identify leaks with Gtest running - // It's left commented out as it normally serves no purpose. If it looks like there's leaks, then remove the + // It's left commented out as it normally serves no purpose. If it looks like there's leaks, then remove the // test code above, and uncomment this runReplace() call to try to identify the source of the leak. - // runReplace(); + // runReplace(); #ifdef _DEBUG _CrtMemDumpAllObjectsSince(&state); diff --git a/PythonScript.Tests/stdafx.h b/PythonScript.Tests/stdafx.h index 755dfdad..14738486 100644 --- a/PythonScript.Tests/stdafx.h +++ b/PythonScript.Tests/stdafx.h @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -29,9 +30,9 @@ #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows. #endif -#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. +#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. -#endif +#endif #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. @@ -42,7 +43,9 @@ #endif #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#ifndef NOMINMAX #define NOMINMAX +#endif // Windows Header Files: #include #include @@ -52,10 +55,10 @@ #ifdef _DEBUG #define _CRTDBG_MAP_ALLOC #include - #ifndef DBG_NEW - #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) - #define new DBG_NEW - #endif + #ifndef DBG_NEW + #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) + #define new DBG_NEW + #endif #endif diff --git a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py index e0a9c7c1..c47e698c 100644 --- a/PythonScript/python_tests/tests/NotepadWrapperTestCase.py +++ b/PythonScript/python_tests/tests/NotepadWrapperTestCase.py @@ -30,6 +30,7 @@ def setUp(self): def tearDown(self): for file in self.files_to_delete: os.remove(file) + notepad.showDocSwitcher(False) # helper functions @@ -112,6 +113,7 @@ def __test_invalid_parameter_passed(self, notepad_method): self._invalid_parameter_passed(notepad_method, -1,-1,-1) + doc_switcher_found = False @staticmethod def foreach_window(hwnd, lParam): if ctypes.windll.user32.IsWindowVisible(hwnd): @@ -120,18 +122,21 @@ def foreach_window(hwnd, lParam): buffer = ctypes.create_unicode_buffer(length) ctypes.windll.user32.GetWindowTextW(hwnd, buffer, length) if buffer.value == ctypes.wstring_at(lParam): + NotepadTestCase.doc_switcher_found = True return False return True def find_child_window(self, caption): - return not ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, + NotepadTestCase.doc_switcher_found = False + ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, EnumWindowsProc(self.foreach_window), ctypes.create_unicode_buffer(caption)) + return NotepadTestCase.doc_switcher_found # old tests - + def test_setEncoding(self): notepad.new() notepad.setEncoding(BUFFERENCODING.UTF8) @@ -374,6 +379,52 @@ def test_saveCurrentSession(self): def test_reloadFile(self): + + WM_CLOSE = 0x010 + WM_COMMAND = 0x0111 + IDC_CHECK_UPDATESILENTLY = 0x18A9 # decimal 6313 + def prepare_silent_file_updates(): + def set_silent_updates(hwnd, lParam): + curr_class = ctypes.create_unicode_buffer(256) + ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) + + length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) + + if curr_class.value.lower() == u'button' and buff.value == u'Update silently': + BM_SETCHECK = 0xF1 + BST_UNCHECKED = 0 + BST_CHECKED = 1 + + ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_CHECKED, None) + return False + + return True # let enumeration continue + + def store_silent_updates(hwnd, lParam): + curr_class = ctypes.create_unicode_buffer(256) + ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) + + length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) + + if curr_class.value == u'#32770': + print(curr_class.value) + ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_UPDATESILENTLY, 0) + return True # let enumeration continue as it is unclear if the right sub dlg was found + + return True # let enumeration continue + + notepad.menuCommand(MENUCOMMAND.SETTING_PREFERENCE) + preferences_dialog = ctypes.windll.user32.FindWindowW(None, u'Preferences') + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(set_silent_updates), 0) + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(store_silent_updates), 0) + ctypes.windll.user32.SendMessageW(preferences_dialog, WM_CLOSE, 0, 0) + + prepare_silent_file_updates() + notepad.new() editor.write('Reload test') filename = self.get_temp_filename() @@ -502,8 +553,8 @@ def test_closeAllButCurrent(self): # test return code # test functionality - # TODO: NPP BUG - Crash - # + # TODO: NPP BUG - Crash + # # def test_createScintilla(self): # ''' ''' # self.__test_invalid_parameter_passed(notepad.createScintilla) @@ -528,7 +579,7 @@ def test_decodeSci(self): self.assertEqual(editor.getCodePage(), 0) notepad.close() - # TODO: NPP BUG - Crash + # TODO: NPP BUG - Crash @unittest.skipUnless(notepad.getVersion() > (7,5,8), "NPP BUG STILL EXISTS") def test_destroyScintilla(self): ''' ''' @@ -548,6 +599,9 @@ def test_destroyScintilla(self): def test_disableAutoUpdate(self): ''' ''' WM_CLOSE = 0x010 + WM_COMMAND = 0x0111 + IDC_CHECK_AUTOUPDATE = 0x18B3 # decimal 6323 + def start_and_immediately_stop_new_npp_instance(): process = subprocess.Popen([r'notepad++.exe', '-multiInst']) process_id = ctypes.windll.kernel32.GetProcessId(int(process._handle)) @@ -568,7 +622,7 @@ def find_newly_created_npp_instance(hwnd, lparam): ctypes.windll.user32.EnumWindows(EnumWindowsProc(find_newly_created_npp_instance), process_id) def prepare_auto_updater(): - def reset_auto_updater(hwnd, lParam): + def set_auto_updater(hwnd, lParam): curr_class = ctypes.create_unicode_buffer(256) ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) @@ -581,17 +635,33 @@ def reset_auto_updater(hwnd, lParam): BST_UNCHECKED = 0 BST_CHECKED = 1 - ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_UNCHECKED, None) ctypes.windll.user32.SendMessageW(hwnd,BM_SETCHECK, BST_CHECKED, None) return False return True # let enumeration continue + def store_auto_updater(hwnd, lParam): + curr_class = ctypes.create_unicode_buffer(256) + ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) + + length = ctypes.windll.user32.GetWindowTextLengthW(hwnd) + buff = ctypes.create_unicode_buffer(length + 1) + ctypes.windll.user32.GetWindowTextW(hwnd, buff, length + 1) + + if curr_class.value == u'#32770': + #print(curr_class.value) + ctypes.windll.user32.SendMessageW(hwnd,WM_COMMAND, IDC_CHECK_AUTOUPDATE, 0) + return True # let enumeration continue as it is unclear if the right sub dlg was found + + return True # let enumeration continue + + notepad.menuCommand(MENUCOMMAND.SETTING_PREFERENCE) - prefernces_dialog = ctypes.windll.user32.FindWindowW(None, u'Preferences') - ctypes.windll.user32.EnumChildWindows(prefernces_dialog, EnumWindowsProc(reset_auto_updater), 0) - ctypes.windll.user32.SendMessageW(prefernces_dialog, WM_CLOSE, 0, 0) + preferences_dialog = ctypes.windll.user32.FindWindowW(None, u'Preferences') + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(set_auto_updater), 0) + ctypes.windll.user32.EnumChildWindows(preferences_dialog, EnumWindowsProc(store_auto_updater), 0) + ctypes.windll.user32.SendMessageW(preferences_dialog, WM_CLOSE, 0, 0) self.__test_invalid_parameter_passed(notepad.disableAutoUpdate) updater_exe = os.path.join(notepad.getNppDir(), u'updater\gup.exe') @@ -609,7 +679,9 @@ def reset_auto_updater(hwnd, lParam): self.assertEqual(self._get_disable_update_xml(), 'no') prepare_auto_updater() - def test_docSwitcherDisableColumn(self): + + doc_switcher_control_value_found = False + def test_docSwitcherDisableExtColumn(self): ''' ''' def search_for_doc_switcher(hwnd, lParam): if ctypes.windll.user32.IsWindowVisible(hwnd): @@ -627,11 +699,13 @@ def search_for_doc_switcher_controls(hwnd, lParam): ctypes.windll.user32.GetClassNameW(hwnd, curr_class, 256) if curr_class.value == 'SysHeader32': - if ctypes.windll.user32.SendMessageW(hwnd, 0x1200, 0, 0) == lParam: + HDM_GETITEMCOUNT = 0x1200 + if ctypes.windll.user32.SendMessageW(hwnd, HDM_GETITEMCOUNT, 0, 0) == lParam: + self.doc_switcher_control_value_found = True return False return True - notepad_method = notepad.docSwitcherDisableColumn + notepad_method = notepad.docSwitcherDisableExtColumn with self.assertRaises(ArgumentError): self._invalid_parameter_passed(notepad_method) with self.assertRaises(ArgumentError): @@ -642,28 +716,30 @@ def search_for_doc_switcher_controls(hwnd, lParam): self._invalid_parameter_passed(notepad_method, False,False) control_dict = {} - self.assertIsNone(notepad.docSwitcherDisableColumn(False)) + self.assertIsNone(notepad.docSwitcherDisableExtColumn(False)) notepad.showDocSwitcher(True) ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, EnumWindowsProc(search_for_doc_switcher), - ctypes.create_unicode_buffer(u'Doc Switcher')) + ctypes.create_unicode_buffer(u'Document List')) - return_code = ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Doc Switcher'), + self.doc_switcher_control_value_found = False + ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Document List'), EnumWindowsProc(search_for_doc_switcher_controls), 2) - self.assertEqual(return_code, 0) + self.assertTrue(self.doc_switcher_control_value_found) - self.assertIsNone(notepad.docSwitcherDisableColumn(True)) + self.assertIsNone(notepad.docSwitcherDisableExtColumn(True)) ctypes.windll.user32.EnumChildWindows(NPP_HANDLE, EnumWindowsProc(search_for_doc_switcher), - ctypes.create_unicode_buffer(u'Doc Switcher')) + ctypes.create_unicode_buffer(u'Document List')) - return_code = ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Doc Switcher'), + self.doc_switcher_control_value_found = False + ctypes.windll.user32.EnumChildWindows(control_dict.get(u'Document List'), EnumWindowsProc(search_for_doc_switcher_controls), 1) - self.assertEqual(return_code, 0) + self.assertTrue(self.doc_switcher_control_value_found) notepad.showDocSwitcher(False) @@ -977,12 +1053,12 @@ def test_isDocSwitcherShown(self): doc_switcher_shown = notepad.isDocSwitcherShown() self.assertIsInstance(doc_switcher_shown, bool) - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertEqual(doc_switcher_shown, res) notepad.showDocSwitcher(True) doc_switcher_shown = notepad.isDocSwitcherShown() - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertEqual(doc_switcher_shown, res) notepad.showDocSwitcher(False) @@ -1268,11 +1344,13 @@ def test_saveFile(self): self.assertEqual(_content, '') notepad.saveFile(tmpfile) + # TODO moved here from below, because otherwise with N++ 7.8.6 the _content is still empty + # TODO on reading below from python/filesystem, seems to be a N++ issue, which needs further investigation + notepad.close() with open(tmpfile, 'r') as f: _content = f.read() self.assertEqual(_content, text_to_be_saved) - notepad.close() def test_setEditorBorderEdge(self): @@ -1351,11 +1429,11 @@ def test_showDocSwitcher(self): self._invalid_parameter_passed(notepad_method, -1,-1,-1) self.assertIsNone(notepad.showDocSwitcher(True)) - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertTrue(res) self.assertIsNone(notepad.showDocSwitcher(False)) - res = self.find_child_window(u'Doc Switcher') + res = self.find_child_window(u'Document List') self.assertFalse(res) @@ -1400,7 +1478,7 @@ def start_monitor(): menu_handle = ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, MN_GETHMENU, 0, 0) item_count = ctypes.windll.user32.GetMenuItemCount(menu_handle) - self.assertEqual(item_count, 28, msg=u'Expected 28 menu items but received:{}'.format(item_count)) + self.assertEqual(item_count, 29, msg=u'Expected 29 menu items but received:{}'.format(item_count)) ctypes.windll.user32.SendMessageW(tabbar_context_menu_hwnd, WM_CLOSE, 0, 0) timer = Timer(1, start_monitor) diff --git a/PythonScript/src/CreateWrapper.py b/PythonScript/src/CreateWrapper.py index 5999bb33..f46605d6 100644 --- a/PythonScript/src/CreateWrapper.py +++ b/PythonScript/src/CreateWrapper.py @@ -29,7 +29,7 @@ types = { 'string' : 'boost::python::object', - 'position' : 'intptr_t', + 'position' : 'Sci_Position', 'line' : 'intptr_t', 'cells' : 'ScintillaCells', 'pointer' : 'intptr_t', @@ -99,6 +99,7 @@ 'Lexer' : 'int', 'Bidirectional' : 'int', 'LineCharacterIndexType' : 'int', + 'EOLAnnotationVisible' : 'int', } castsL = { @@ -121,8 +122,8 @@ # Must be kept in sync with pythonTypeExplosions typeExplosions = { #'colour' : lambda name: 'int {0}Red, int {0}Green, int {0}Blue'.format(name), - 'findtext' : 'int start, int end, boost::python::object {}', - 'textrange' : 'int start, int end' + 'findtext' : 'Sci_PositionCR start, Sci_PositionCR end, boost::python::object {}', + 'textrange' : 'Sci_PositionCR start, Sci_PositionCR end' } # Must be kept in sync with typeExplosions @@ -320,7 +321,7 @@ def getTextRangeBody(v, out): if (end < start) {{ - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; }} @@ -340,7 +341,7 @@ def getStyledTextBody(v, out): ''' Sci_TextRange src; if (end < start) {{ - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; }} @@ -521,7 +522,7 @@ def getPythonParamNamesQuoted(param1Type, param1Name, param2Type, param2Name): specialCases = { - 'GetStyledText' : ('boost::python::tuple', 'int', 'start', 'int', 'end', getStyledTextBody), + 'GetStyledText' : ('boost::python::tuple', 'Sci_PositionCR', 'start', 'Sci_PositionCR', 'end', getStyledTextBody), 'GetLine': ('boost::python::str', 'int', 'line', '', '', getLineBody), 'AnnotationSetText' : ('void', 'int', 'line', 'boost::python::object', 'text', annotationSetTextBody), 'SetDocPointer' :('void', '','','intptr_t', 'pointer', getSetDocPointerBody), diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index 3fc1e820..5099313a 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -236,6 +236,21 @@ enum IMEInteraction PYSCR_SC_IME_INLINE = SC_IME_INLINE }; +enum Alpha +{ + PYSCR_SC_ALPHA_TRANSPARENT = SC_ALPHA_TRANSPARENT, + PYSCR_SC_ALPHA_OPAQUE = SC_ALPHA_OPAQUE, + PYSCR_SC_ALPHA_NOALPHA = SC_ALPHA_NOALPHA +}; + +enum CursorShape +{ + PYSCR_SC_CURSORNORMAL = SC_CURSORNORMAL, + PYSCR_SC_CURSORARROW = SC_CURSORARROW, + PYSCR_SC_CURSORWAIT = SC_CURSORWAIT, + PYSCR_SC_CURSORREVERSEARROW = SC_CURSORREVERSEARROW +}; + enum MarkerSymbol { PYSCR_SC_MARK_CIRCLE = SC_MARK_CIRCLE, @@ -574,14 +589,6 @@ enum Status PYSCR_SC_STATUS_WARN_REGEX = SC_STATUS_WARN_REGEX }; -enum CursorShape -{ - PYSCR_SC_CURSORNORMAL = SC_CURSORNORMAL, - PYSCR_SC_CURSORARROW = SC_CURSORARROW, - PYSCR_SC_CURSORWAIT = SC_CURSORWAIT, - PYSCR_SC_CURSORREVERSEARROW = SC_CURSORREVERSEARROW -}; - enum VisiblePolicy { PYSCR_VISIBLE_SLOP = VISIBLE_SLOP, @@ -630,13 +637,6 @@ enum CaretSticky PYSCR_SC_CARETSTICKY_WHITESPACE = SC_CARETSTICKY_WHITESPACE }; -enum Alpha -{ - PYSCR_SC_ALPHA_TRANSPARENT = SC_ALPHA_TRANSPARENT, - PYSCR_SC_ALPHA_OPAQUE = SC_ALPHA_OPAQUE, - PYSCR_SC_ALPHA_NOALPHA = SC_ALPHA_NOALPHA -}; - enum CaretStyle { PYSCR_CARETSTYLE_INVISIBLE = CARETSTYLE_INVISIBLE, @@ -690,6 +690,13 @@ enum LineEndType PYSCR_SC_LINE_END_TYPE_UNICODE = SC_LINE_END_TYPE_UNICODE }; +enum EOLAnnotationVisible +{ + PYSCR_EOLANNOTATION_HIDDEN = EOLANNOTATION_HIDDEN, + PYSCR_EOLANNOTATION_STANDARD = EOLANNOTATION_STANDARD, + PYSCR_EOLANNOTATION_BOXED = EOLANNOTATION_BOXED +}; + enum TypeProperty { PYSCR_SC_TYPE_BOOLEAN = SC_TYPE_BOOLEAN, @@ -722,6 +729,7 @@ enum ModificationFlags PYSCR_SC_MOD_LEXERSTATE = SC_MOD_LEXERSTATE, PYSCR_SC_MOD_INSERTCHECK = SC_MOD_INSERTCHECK, PYSCR_SC_MOD_CHANGETABSTOPS = SC_MOD_CHANGETABSTOPS, + PYSCR_SC_MOD_CHANGEEOLANNOTATION = SC_MOD_CHANGEEOLANNOTATION, PYSCR_SC_MODEVENTMASKALL = SC_MODEVENTMASKALL }; @@ -913,6 +921,8 @@ enum Lexer PYSCR_SCLEX_CIL = SCLEX_CIL, PYSCR_SCLEX_X12 = SCLEX_X12, PYSCR_SCLEX_DATAFLEX = SCLEX_DATAFLEX, + PYSCR_SCLEX_HOLLYWOOD = SCLEX_HOLLYWOOD, + PYSCR_SCLEX_RAKU = SCLEX_RAKU, PYSCR_SCLEX_AUTOMATIC = SCLEX_AUTOMATIC }; @@ -959,6 +969,8 @@ enum ScintillaMessage PYSCR_SCI_CANREDO = SCI_CANREDO, PYSCR_SCI_MARKERLINEFROMHANDLE = SCI_MARKERLINEFROMHANDLE, PYSCR_SCI_MARKERDELETEHANDLE = SCI_MARKERDELETEHANDLE, + PYSCR_SCI_MARKERHANDLEFROMLINE = SCI_MARKERHANDLEFROMLINE, + PYSCR_SCI_MARKERNUMBERFROMLINE = SCI_MARKERNUMBERFROMLINE, PYSCR_SCI_GETUNDOCOLLECTION = SCI_GETUNDOCOLLECTION, PYSCR_SCI_GETVIEWWS = SCI_GETVIEWWS, PYSCR_SCI_SETVIEWWS = SCI_SETVIEWWS, @@ -980,6 +992,8 @@ enum ScintillaMessage PYSCR_SCI_SETBUFFEREDDRAW = SCI_SETBUFFEREDDRAW, PYSCR_SCI_SETTABWIDTH = SCI_SETTABWIDTH, PYSCR_SCI_GETTABWIDTH = SCI_GETTABWIDTH, + PYSCR_SCI_SETTABMINIMUMWIDTH = SCI_SETTABMINIMUMWIDTH, + PYSCR_SCI_GETTABMINIMUMWIDTH = SCI_GETTABMINIMUMWIDTH, PYSCR_SCI_CLEARTABSTOPS = SCI_CLEARTABSTOPS, PYSCR_SCI_ADDTABSTOP = SCI_ADDTABSTOP, PYSCR_SCI_GETNEXTTABSTOP = SCI_GETNEXTTABSTOP, @@ -1192,8 +1206,12 @@ enum ScintillaMessage PYSCR_SCI_GETCARETWIDTH = SCI_GETCARETWIDTH, PYSCR_SCI_SETTARGETSTART = SCI_SETTARGETSTART, PYSCR_SCI_GETTARGETSTART = SCI_GETTARGETSTART, + PYSCR_SCI_SETTARGETSTARTVIRTUALSPACE = SCI_SETTARGETSTARTVIRTUALSPACE, + PYSCR_SCI_GETTARGETSTARTVIRTUALSPACE = SCI_GETTARGETSTARTVIRTUALSPACE, PYSCR_SCI_SETTARGETEND = SCI_SETTARGETEND, PYSCR_SCI_GETTARGETEND = SCI_GETTARGETEND, + PYSCR_SCI_SETTARGETENDVIRTUALSPACE = SCI_SETTARGETENDVIRTUALSPACE, + PYSCR_SCI_GETTARGETENDVIRTUALSPACE = SCI_GETTARGETENDVIRTUALSPACE, PYSCR_SCI_SETTARGETRANGE = SCI_SETTARGETRANGE, PYSCR_SCI_GETTARGETTEXT = SCI_GETTARGETTEXT, PYSCR_SCI_TARGETFROMSELECTION = SCI_TARGETFROMSELECTION, @@ -1356,6 +1374,7 @@ enum ScintillaMessage PYSCR_SCI_BRACEBADLIGHT = SCI_BRACEBADLIGHT, PYSCR_SCI_BRACEBADLIGHTINDICATOR = SCI_BRACEBADLIGHTINDICATOR, PYSCR_SCI_BRACEMATCH = SCI_BRACEMATCH, + PYSCR_SCI_BRACEMATCHNEXT = SCI_BRACEMATCHNEXT, PYSCR_SCI_GETVIEWEOL = SCI_GETVIEWEOL, PYSCR_SCI_SETVIEWEOL = SCI_SETVIEWEOL, PYSCR_SCI_GETDOCPOINTER = SCI_GETDOCPOINTER, @@ -1369,6 +1388,7 @@ enum ScintillaMessage PYSCR_SCI_SETEDGECOLOUR = SCI_SETEDGECOLOUR, PYSCR_SCI_MULTIEDGEADDLINE = SCI_MULTIEDGEADDLINE, PYSCR_SCI_MULTIEDGECLEARALL = SCI_MULTIEDGECLEARALL, + PYSCR_SCI_GETMULTIEDGECOLUMN = SCI_GETMULTIEDGECOLUMN, PYSCR_SCI_SEARCHANCHOR = SCI_SEARCHANCHOR, PYSCR_SCI_SEARCHNEXT = SCI_SEARCHNEXT, PYSCR_SCI_SEARCHPREV = SCI_SEARCHPREV, @@ -1560,7 +1580,9 @@ enum ScintillaMessage PYSCR_SCI_GETSELECTIONNANCHORVIRTUALSPACE = SCI_GETSELECTIONNANCHORVIRTUALSPACE, PYSCR_SCI_SETSELECTIONNSTART = SCI_SETSELECTIONNSTART, PYSCR_SCI_GETSELECTIONNSTART = SCI_GETSELECTIONNSTART, + PYSCR_SCI_GETSELECTIONNSTARTVIRTUALSPACE = SCI_GETSELECTIONNSTARTVIRTUALSPACE, PYSCR_SCI_SETSELECTIONNEND = SCI_SETSELECTIONNEND, + PYSCR_SCI_GETSELECTIONNENDVIRTUALSPACE = SCI_GETSELECTIONNENDVIRTUALSPACE, PYSCR_SCI_GETSELECTIONNEND = SCI_GETSELECTIONNEND, PYSCR_SCI_SETRECTANGULARSELECTIONCARET = SCI_SETRECTANGULARSELECTIONCARET, PYSCR_SCI_GETRECTANGULARSELECTIONCARET = SCI_GETRECTANGULARSELECTIONCARET, @@ -1614,6 +1636,15 @@ enum ScintillaMessage PYSCR_SCI_SETREPRESENTATION = SCI_SETREPRESENTATION, PYSCR_SCI_GETREPRESENTATION = SCI_GETREPRESENTATION, PYSCR_SCI_CLEARREPRESENTATION = SCI_CLEARREPRESENTATION, + PYSCR_SCI_EOLANNOTATIONSETTEXT = SCI_EOLANNOTATIONSETTEXT, + PYSCR_SCI_EOLANNOTATIONGETTEXT = SCI_EOLANNOTATIONGETTEXT, + PYSCR_SCI_EOLANNOTATIONSETSTYLE = SCI_EOLANNOTATIONSETSTYLE, + PYSCR_SCI_EOLANNOTATIONGETSTYLE = SCI_EOLANNOTATIONGETSTYLE, + PYSCR_SCI_EOLANNOTATIONCLEARALL = SCI_EOLANNOTATIONCLEARALL, + PYSCR_SCI_EOLANNOTATIONSETVISIBLE = SCI_EOLANNOTATIONSETVISIBLE, + PYSCR_SCI_EOLANNOTATIONGETVISIBLE = SCI_EOLANNOTATIONGETVISIBLE, + PYSCR_SCI_EOLANNOTATIONSETSTYLEOFFSET = SCI_EOLANNOTATIONSETSTYLEOFFSET, + PYSCR_SCI_EOLANNOTATIONGETSTYLEOFFSET = SCI_EOLANNOTATIONGETSTYLEOFFSET, PYSCR_SCI_STARTRECORD = SCI_STARTRECORD, PYSCR_SCI_STOPRECORD = SCI_STOPRECORD, PYSCR_SCI_SETLEXER = SCI_SETLEXER, @@ -1646,6 +1677,7 @@ enum ScintillaMessage PYSCR_SCI_NAMEOFSTYLE = SCI_NAMEOFSTYLE, PYSCR_SCI_TAGSOFSTYLE = SCI_TAGSOFSTYLE, PYSCR_SCI_DESCRIPTIONOFSTYLE = SCI_DESCRIPTIONOFSTYLE, + PYSCR_SCI_SETILEXER = SCI_SETILEXER, PYSCR_SCI_GETBIDIRECTIONAL = SCI_GETBIDIRECTIONAL, PYSCR_SCI_SETBIDIRECTIONAL = SCI_SETBIDIRECTIONAL, PYSCR_SCI_GETLINECHARACTERINDEX = SCI_GETLINECHARACTERINDEX, diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index eeae0962..08acfb81 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -224,6 +224,17 @@ void export_enums() .value("WINDOWED", PYSCR_SC_IME_WINDOWED) .value("INLINE", PYSCR_SC_IME_INLINE); + boost::python::enum_("ALPHA") + .value("TRANSPARENT", PYSCR_SC_ALPHA_TRANSPARENT) + .value("OPAQUE", PYSCR_SC_ALPHA_OPAQUE) + .value("NOALPHA", PYSCR_SC_ALPHA_NOALPHA); + + boost::python::enum_("CURSORSHAPE") + .value("NORMAL", PYSCR_SC_CURSORNORMAL) + .value("ARROW", PYSCR_SC_CURSORARROW) + .value("WAIT", PYSCR_SC_CURSORWAIT) + .value("REVERSEARROW", PYSCR_SC_CURSORREVERSEARROW); + boost::python::enum_("MARKERSYMBOL") .value("CIRCLE", PYSCR_SC_MARK_CIRCLE) .value("ROUNDRECT", PYSCR_SC_MARK_ROUNDRECT) @@ -496,12 +507,6 @@ void export_enums() .value("WARN_START", PYSCR_SC_STATUS_WARN_START) .value("WARN_REGEX", PYSCR_SC_STATUS_WARN_REGEX); - boost::python::enum_("CURSORSHAPE") - .value("NORMAL", PYSCR_SC_CURSORNORMAL) - .value("ARROW", PYSCR_SC_CURSORARROW) - .value("WAIT", PYSCR_SC_CURSORWAIT) - .value("REVERSEARROW", PYSCR_SC_CURSORREVERSEARROW); - boost::python::enum_("VISIBLEPOLICY") .value("SLOP", PYSCR_VISIBLE_SLOP) .value("STRICT", PYSCR_VISIBLE_STRICT); @@ -536,11 +541,6 @@ void export_enums() .value("ON", PYSCR_SC_CARETSTICKY_ON) .value("WHITESPACE", PYSCR_SC_CARETSTICKY_WHITESPACE); - boost::python::enum_("ALPHA") - .value("TRANSPARENT", PYSCR_SC_ALPHA_TRANSPARENT) - .value("OPAQUE", PYSCR_SC_ALPHA_OPAQUE) - .value("NOALPHA", PYSCR_SC_ALPHA_NOALPHA); - boost::python::enum_("CARETSTYLE") .value("INVISIBLE", PYSCR_CARETSTYLE_INVISIBLE) .value("LINE", PYSCR_CARETSTYLE_LINE) @@ -580,6 +580,11 @@ void export_enums() .value("DEFAULT", PYSCR_SC_LINE_END_TYPE_DEFAULT) .value("UNICODE", PYSCR_SC_LINE_END_TYPE_UNICODE); + boost::python::enum_("EOLANNOTATIONVISIBLE") + .value("HIDDEN", PYSCR_EOLANNOTATION_HIDDEN) + .value("STANDARD", PYSCR_EOLANNOTATION_STANDARD) + .value("BOXED", PYSCR_EOLANNOTATION_BOXED); + boost::python::enum_("TYPEPROPERTY") .value("BOOLEAN", PYSCR_SC_TYPE_BOOLEAN) .value("INTEGER", PYSCR_SC_TYPE_INTEGER) @@ -609,6 +614,7 @@ void export_enums() .value("LEXERSTATE", PYSCR_SC_MOD_LEXERSTATE) .value("INSERTCHECK", PYSCR_SC_MOD_INSERTCHECK) .value("CHANGETABSTOPS", PYSCR_SC_MOD_CHANGETABSTOPS) + .value("CHANGEEOLANNOTATION", PYSCR_SC_MOD_CHANGEEOLANNOTATION) .value("MODEVENTMASKALL", PYSCR_SC_MODEVENTMASKALL); boost::python::enum_("UPDATE") @@ -788,6 +794,8 @@ void export_enums() .value("CIL", PYSCR_SCLEX_CIL) .value("X12", PYSCR_SCLEX_X12) .value("DATAFLEX", PYSCR_SCLEX_DATAFLEX) + .value("HOLLYWOOD", PYSCR_SCLEX_HOLLYWOOD) + .value("RAKU", PYSCR_SCLEX_RAKU) .value("AUTOMATIC", PYSCR_SCLEX_AUTOMATIC); boost::python::enum_("BIDIRECTIONAL") @@ -855,6 +863,8 @@ void export_enums() .value("SCI_CANREDO", PYSCR_SCI_CANREDO) .value("SCI_MARKERLINEFROMHANDLE", PYSCR_SCI_MARKERLINEFROMHANDLE) .value("SCI_MARKERDELETEHANDLE", PYSCR_SCI_MARKERDELETEHANDLE) + .value("SCI_MARKERHANDLEFROMLINE", PYSCR_SCI_MARKERHANDLEFROMLINE) + .value("SCI_MARKERNUMBERFROMLINE", PYSCR_SCI_MARKERNUMBERFROMLINE) .value("SCI_GETUNDOCOLLECTION", PYSCR_SCI_GETUNDOCOLLECTION) .value("SCI_GETVIEWWS", PYSCR_SCI_GETVIEWWS) .value("SCI_SETVIEWWS", PYSCR_SCI_SETVIEWWS) @@ -876,6 +886,8 @@ void export_enums() .value("SCI_SETBUFFEREDDRAW", PYSCR_SCI_SETBUFFEREDDRAW) .value("SCI_SETTABWIDTH", PYSCR_SCI_SETTABWIDTH) .value("SCI_GETTABWIDTH", PYSCR_SCI_GETTABWIDTH) + .value("SCI_SETTABMINIMUMWIDTH", PYSCR_SCI_SETTABMINIMUMWIDTH) + .value("SCI_GETTABMINIMUMWIDTH", PYSCR_SCI_GETTABMINIMUMWIDTH) .value("SCI_CLEARTABSTOPS", PYSCR_SCI_CLEARTABSTOPS) .value("SCI_ADDTABSTOP", PYSCR_SCI_ADDTABSTOP) .value("SCI_GETNEXTTABSTOP", PYSCR_SCI_GETNEXTTABSTOP) @@ -1088,8 +1100,12 @@ void export_enums() .value("SCI_GETCARETWIDTH", PYSCR_SCI_GETCARETWIDTH) .value("SCI_SETTARGETSTART", PYSCR_SCI_SETTARGETSTART) .value("SCI_GETTARGETSTART", PYSCR_SCI_GETTARGETSTART) + .value("SCI_SETTARGETSTARTVIRTUALSPACE", PYSCR_SCI_SETTARGETSTARTVIRTUALSPACE) + .value("SCI_GETTARGETSTARTVIRTUALSPACE", PYSCR_SCI_GETTARGETSTARTVIRTUALSPACE) .value("SCI_SETTARGETEND", PYSCR_SCI_SETTARGETEND) .value("SCI_GETTARGETEND", PYSCR_SCI_GETTARGETEND) + .value("SCI_SETTARGETENDVIRTUALSPACE", PYSCR_SCI_SETTARGETENDVIRTUALSPACE) + .value("SCI_GETTARGETENDVIRTUALSPACE", PYSCR_SCI_GETTARGETENDVIRTUALSPACE) .value("SCI_SETTARGETRANGE", PYSCR_SCI_SETTARGETRANGE) .value("SCI_GETTARGETTEXT", PYSCR_SCI_GETTARGETTEXT) .value("SCI_TARGETFROMSELECTION", PYSCR_SCI_TARGETFROMSELECTION) @@ -1252,6 +1268,7 @@ void export_enums() .value("SCI_BRACEBADLIGHT", PYSCR_SCI_BRACEBADLIGHT) .value("SCI_BRACEBADLIGHTINDICATOR", PYSCR_SCI_BRACEBADLIGHTINDICATOR) .value("SCI_BRACEMATCH", PYSCR_SCI_BRACEMATCH) + .value("SCI_BRACEMATCHNEXT", PYSCR_SCI_BRACEMATCHNEXT) .value("SCI_GETVIEWEOL", PYSCR_SCI_GETVIEWEOL) .value("SCI_SETVIEWEOL", PYSCR_SCI_SETVIEWEOL) .value("SCI_GETDOCPOINTER", PYSCR_SCI_GETDOCPOINTER) @@ -1265,6 +1282,7 @@ void export_enums() .value("SCI_SETEDGECOLOUR", PYSCR_SCI_SETEDGECOLOUR) .value("SCI_MULTIEDGEADDLINE", PYSCR_SCI_MULTIEDGEADDLINE) .value("SCI_MULTIEDGECLEARALL", PYSCR_SCI_MULTIEDGECLEARALL) + .value("SCI_GETMULTIEDGECOLUMN", PYSCR_SCI_GETMULTIEDGECOLUMN) .value("SCI_SEARCHANCHOR", PYSCR_SCI_SEARCHANCHOR) .value("SCI_SEARCHNEXT", PYSCR_SCI_SEARCHNEXT) .value("SCI_SEARCHPREV", PYSCR_SCI_SEARCHPREV) @@ -1456,7 +1474,9 @@ void export_enums() .value("SCI_GETSELECTIONNANCHORVIRTUALSPACE", PYSCR_SCI_GETSELECTIONNANCHORVIRTUALSPACE) .value("SCI_SETSELECTIONNSTART", PYSCR_SCI_SETSELECTIONNSTART) .value("SCI_GETSELECTIONNSTART", PYSCR_SCI_GETSELECTIONNSTART) + .value("SCI_GETSELECTIONNSTARTVIRTUALSPACE", PYSCR_SCI_GETSELECTIONNSTARTVIRTUALSPACE) .value("SCI_SETSELECTIONNEND", PYSCR_SCI_SETSELECTIONNEND) + .value("SCI_GETSELECTIONNENDVIRTUALSPACE", PYSCR_SCI_GETSELECTIONNENDVIRTUALSPACE) .value("SCI_GETSELECTIONNEND", PYSCR_SCI_GETSELECTIONNEND) .value("SCI_SETRECTANGULARSELECTIONCARET", PYSCR_SCI_SETRECTANGULARSELECTIONCARET) .value("SCI_GETRECTANGULARSELECTIONCARET", PYSCR_SCI_GETRECTANGULARSELECTIONCARET) @@ -1510,6 +1530,15 @@ void export_enums() .value("SCI_SETREPRESENTATION", PYSCR_SCI_SETREPRESENTATION) .value("SCI_GETREPRESENTATION", PYSCR_SCI_GETREPRESENTATION) .value("SCI_CLEARREPRESENTATION", PYSCR_SCI_CLEARREPRESENTATION) + .value("SCI_EOLANNOTATIONSETTEXT", PYSCR_SCI_EOLANNOTATIONSETTEXT) + .value("SCI_EOLANNOTATIONGETTEXT", PYSCR_SCI_EOLANNOTATIONGETTEXT) + .value("SCI_EOLANNOTATIONSETSTYLE", PYSCR_SCI_EOLANNOTATIONSETSTYLE) + .value("SCI_EOLANNOTATIONGETSTYLE", PYSCR_SCI_EOLANNOTATIONGETSTYLE) + .value("SCI_EOLANNOTATIONCLEARALL", PYSCR_SCI_EOLANNOTATIONCLEARALL) + .value("SCI_EOLANNOTATIONSETVISIBLE", PYSCR_SCI_EOLANNOTATIONSETVISIBLE) + .value("SCI_EOLANNOTATIONGETVISIBLE", PYSCR_SCI_EOLANNOTATIONGETVISIBLE) + .value("SCI_EOLANNOTATIONSETSTYLEOFFSET", PYSCR_SCI_EOLANNOTATIONSETSTYLEOFFSET) + .value("SCI_EOLANNOTATIONGETSTYLEOFFSET", PYSCR_SCI_EOLANNOTATIONGETSTYLEOFFSET) .value("SCI_STARTRECORD", PYSCR_SCI_STARTRECORD) .value("SCI_STOPRECORD", PYSCR_SCI_STOPRECORD) .value("SCI_SETLEXER", PYSCR_SCI_SETLEXER) @@ -1542,6 +1571,7 @@ void export_enums() .value("SCI_NAMEOFSTYLE", PYSCR_SCI_NAMEOFSTYLE) .value("SCI_TAGSOFSTYLE", PYSCR_SCI_TAGSOFSTYLE) .value("SCI_DESCRIPTIONOFSTYLE", PYSCR_SCI_DESCRIPTIONOFSTYLE) + .value("SCI_SETILEXER", PYSCR_SCI_SETILEXER) .value("SCI_GETBIDIRECTIONAL", PYSCR_SCI_GETBIDIRECTIONAL) .value("SCI_SETBIDIRECTIONAL", PYSCR_SCI_SETBIDIRECTIONAL) .value("SCI_GETLINECHARACTERINDEX", PYSCR_SCI_GETLINECHARACTERINDEX) diff --git a/PythonScript/src/MenuManager.cpp b/PythonScript/src/MenuManager.cpp index af77d998..6c504e15 100644 --- a/PythonScript/src/MenuManager.cpp +++ b/PythonScript/src/MenuManager.cpp @@ -318,8 +318,8 @@ bool MenuManager::populateScriptsMenu() InsertMenu(m_pythonPluginMenu, static_cast(m_scriptsMenuIndex), MF_BYPOSITION | MF_POPUP, reinterpret_cast(m_hScriptsMenu), _T("Scripts")); m_submenus.insert(std::pair(_T("\\"), m_hScriptsMenu)); - TCHAR pluginDir[MAX_PATH]; - TCHAR configDir[MAX_PATH]; + TCHAR pluginDir[MAX_PATH]{}; + TCHAR configDir[MAX_PATH]{}; ::SendMessage(m_hNotepad, NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(pluginDir)); ::SendMessage(m_hNotepad, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast(configDir)); std::shared_ptr path = WcharMbcsConverter::tchar2tchar(pluginDir); @@ -779,7 +779,7 @@ void MenuManager::reconfigure() void MenuManager::removeItem(int index) { - BOOL removed = ::SendMessage(m_hNotepad, NPPM_REMOVESHORTCUTBYCMDID, static_cast(m_funcItems[m_dynamicStartIndex + index - 1]._cmdID), 0); + ::SendMessage(m_hNotepad, NPPM_REMOVESHORTCUTBYCMDID, static_cast(m_funcItems[m_dynamicStartIndex + index - 1]._cmdID), 0); } void MenuManager::configureToolbarIcons() @@ -795,14 +795,14 @@ void MenuManager::configureToolbarIcons() // s_startToolbarID = m_funcItems[0]._cmdID + ADD_TOOLBAR_ID; m_toolbarMenuManager->reserve(toolbarItems.size()); m_toolbarMenuManager->begin(); - toolbarIcons icons; + toolbarIcons icons{}; for(ConfigFile::ToolbarItemsTD::iterator it = toolbarItems.begin(); it != toolbarItems.end(); ++it) { icons.hToolbarBmp = it->second.first; icons.hToolbarIcon = NULL; m_toolbarCommands.insert(std::pair(m_toolbarMenuManager->currentID(), WcharMbcsConverter::tchar2tchar(it->first.c_str()).get())); - ::SendMessage(m_hNotepad, NPPM_ADDTOOLBARICON, m_toolbarMenuManager->currentID(), reinterpret_cast(&icons)); + ::SendMessage(m_hNotepad, NPPM_ADDTOOLBARICON_DEPRECATED, m_toolbarMenuManager->currentID(), reinterpret_cast(&icons)); ++(*m_toolbarMenuManager); } @@ -838,10 +838,10 @@ idx_t MenuManager::findPluginCommand(const TCHAR *pluginName, const TCHAR *menuO HMENU hPluginMenu = (HMENU)::SendMessage(m_hNotepad, NPPM_GETMENUHANDLE, 0, 0); size_t iMenuItems = (size_t)GetMenuItemCount(hPluginMenu); - TCHAR strBuffer[500]; + TCHAR strBuffer[500]{}; for ( idx_t i = 0; i < iMenuItems; ++i ) { - MENUITEMINFO mii; + MENUITEMINFO mii{}; mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_STRING | MIIM_SUBMENU; mii.cch = 500; @@ -939,11 +939,11 @@ idx_t MenuManager::findMenuCommand(HMENU hParentMenu, const TCHAR *parentMenuNam size_t iMenuItems = (size_t)GetMenuItemCount(hParentMenu); idx_t retVal = 0; - TCHAR strBuffer[500]; + TCHAR strBuffer[500]{}; for ( idx_t i = 0; i < iMenuItems; ++i ) { - MENUITEMINFO mii; + MENUITEMINFO mii{}; mii.cbSize = sizeof(MENUITEMINFO); mii.fMask = MIIM_ID | MIIM_STRING | MIIM_SUBMENU; mii.cch = 500; @@ -1056,7 +1056,7 @@ void MenuManager::updatePreviousScript(const TCHAR *filename) } - MENUITEMINFO mi; + MENUITEMINFO mi{}; mi.cbSize = sizeof(MENUITEMINFO); mi.fMask = MIIM_STATE | MIIM_STRING; mi.fState = MFS_ENABLED; diff --git a/PythonScript/src/NotepadPlusWrapper.cpp b/PythonScript/src/NotepadPlusWrapper.cpp index 57caa72e..0c5a4908 100644 --- a/PythonScript/src/NotepadPlusWrapper.cpp +++ b/PythonScript/src/NotepadPlusWrapper.cpp @@ -252,14 +252,14 @@ bool NotepadPlusWrapper::activateFile(const char *filename) int NotepadPlusWrapper::getCurrentView() { - int currentView; + int currentView = 0; callNotepad(NPPM_GETCURRENTSCINTILLA, 0, reinterpret_cast(¤tView)); return currentView; } LangType NotepadPlusWrapper::getCurrentLangType() { - int lang; + int lang = 0; callNotepad(NPPM_GETCURRENTLANGTYPE, 0, reinterpret_cast(&lang)); return static_cast(lang); } @@ -374,7 +374,7 @@ boost::python::list NotepadPlusWrapper::getSessionFiles(const char *sessionFilen void NotepadPlusWrapper::saveSession(const char *sessionFilename, boost::python::list files) { - sessionInfo si; + sessionInfo si{}; std::shared_ptr tsessionFilename = WcharMbcsConverter::char2tchar(sessionFilename); si.sessionFilePathName = tsessionFilename.get(); @@ -435,7 +435,7 @@ idx_t NotepadPlusWrapper::getCurrentDocIndex(int view) void NotepadPlusWrapper::setStatusBar(StatusBarSection section, const char *text) { #ifdef UNICODE - std::shared_ptr s = WcharMbcsConverter::char2tchar(text); + std::shared_ptr s = WcharMbcsConverter::char2tchar(text); callNotepad(NPPM_SETSTATUSBAR, static_cast(section), reinterpret_cast(s.get())); #else callNotepad(NPPM_SETSTATUSBAR, static_cast(section), reinterpret_cast(text)); @@ -471,7 +471,7 @@ void NotepadPlusWrapper::activateFileString(boost::python::str filename) { notAllowedInScintillaCallback("activateFile() cannot be called in a synchronous editor callback. " "Use an asynchronous callback, or avoid using activateFile() in the callback handler"); - #ifdef UNICODE +#ifdef UNICODE std::shared_ptr s = WcharMbcsConverter::char2tchar((const char*)boost::python::extract(filename)); callNotepad(NPPM_SWITCHTOFILE, 0, reinterpret_cast(s.get())); #else @@ -498,7 +498,7 @@ void NotepadPlusWrapper::saveAllFiles() boost::python::str NotepadPlusWrapper::getPluginConfigDir() { - TCHAR temp[MAX_PATH]; + TCHAR temp[MAX_PATH]{}; callNotepad(NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast(temp)); return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(temp).get())); } @@ -723,12 +723,12 @@ boost::python::object NotepadPlusWrapper::prompt(boost::python::object promptObj const char *cPrompt = NULL; const char *cTitle = NULL; const char *cInitial = NULL; - if (!promptObj | !promptObj.is_none()) + if (!promptObj || !promptObj.is_none()) cPrompt = (const char *)boost::python::extract(promptObj.attr("__str__")()); - if (!title | !title.is_none()) + if (!title || !title.is_none()) cTitle= (const char *)boost::python::extract(title.attr("__str__")()); - if (!initial | !initial.is_none()) + if (!initial || !initial.is_none()) cInitial = (const char *)boost::python::extract(initial.attr("__str__")()); PromptDialog::PROMPT_RESULT result; @@ -834,7 +834,7 @@ void NotepadPlusWrapper::activateBufferID(intptr_t bufferID) boost::python::str NotepadPlusWrapper::getBufferFilename(intptr_t bufferID) { - TCHAR buffer[MAX_PATH]; + TCHAR buffer[MAX_PATH]{}; callNotepad(NPPM_GETFULLPATHFROMBUFFERID, static_cast(bufferID), reinterpret_cast(buffer)); std::shared_ptr filename = WcharMbcsConverter::tchar2char(buffer); return boost::python::str(const_cast(filename.get())); @@ -843,7 +843,7 @@ boost::python::str NotepadPlusWrapper::getBufferFilename(intptr_t bufferID) boost::python::str NotepadPlusWrapper::getCurrentFilename() { idx_t bufferID = callNotepad(NPPM_GETCURRENTBUFFERID); - TCHAR buffer[MAX_PATH]; + TCHAR buffer[MAX_PATH]{}; callNotepad(NPPM_GETFULLPATHFROMBUFFERID, bufferID, reinterpret_cast(buffer)); std::shared_ptr filename = WcharMbcsConverter::tchar2char(buffer); return boost::python::str(const_cast(filename.get())); @@ -894,7 +894,7 @@ bool NotepadPlusWrapper::runMenuCommand(boost::python::str menuName, boost::pyth boost::python::str NotepadPlusWrapper::getNppDir() { - TCHAR buffer[MAX_PATH]; + TCHAR buffer[MAX_PATH]{}; callNotepad(NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast(buffer)); return boost::python::str(const_cast(WcharMbcsConverter::tchar2char(buffer).get())); } @@ -911,7 +911,7 @@ bool NotepadPlusWrapper::allocateSupported() boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) { - int startID; + int startID = 0; bool result = 1 == callNotepad(NPPM_ALLOCATECMDID, static_cast(quantity), reinterpret_cast(&startID)); if (result) { @@ -925,7 +925,7 @@ boost::python::object NotepadPlusWrapper::allocateCmdID(int quantity) boost::python::object NotepadPlusWrapper::allocateMarker(int quantity) { - int startID; + int startID = 0; bool result = 1 == callNotepad(NPPM_ALLOCATEMARKER, static_cast(quantity), reinterpret_cast(&startID)); if (result) { @@ -985,17 +985,22 @@ void NotepadPlusWrapper::saveFile(boost::python::str filename) void NotepadPlusWrapper::showDocSwitcher(bool showOrNot) { - callNotepad(NPPM_SHOWDOCSWITCHER, 0, showOrNot); + callNotepad(NPPM_SHOWDOCLIST, 0, showOrNot); } bool NotepadPlusWrapper::isDocSwitcherShown() { - return callNotepad(NPPM_ISDOCSWITCHERSHOWN); + return callNotepad(NPPM_ISDOCLISTSHOWN); +} + +void NotepadPlusWrapper::docSwitcherDisableExtColumn(bool disableOrNot) +{ + callNotepad(NPPM_DOCLISTDISABLEEXTCOLUMN, 0, disableOrNot); } -void NotepadPlusWrapper::docSwitcherDisableColumn(bool disableOrNot) +void NotepadPlusWrapper::docSwitcherDisablePathColumn(bool disableOrNot) { - callNotepad(NPPM_DOCSWITCHERDISABLECOLUMN, 0, disableOrNot); + callNotepad(NPPM_DOCLISTDISABLEPATHCOLUMN, 0, disableOrNot); } intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding() @@ -1005,7 +1010,7 @@ intptr_t NotepadPlusWrapper::getCurrentNativeLangEncoding() boost::python::str NotepadPlusWrapper::getLanguageName(int langType) { - int size = callNotepad(NPPM_GETLANGUAGENAME, langType, NULL); + size_t size = callNotepad(NPPM_GETLANGUAGENAME, langType, NULL); wchar_t* result(new wchar_t[size+1]); callNotepad(NPPM_GETLANGUAGENAME, langType, reinterpret_cast(result)); std::shared_ptr languageName = WcharMbcsConverter::tchar2char(result); @@ -1014,7 +1019,7 @@ boost::python::str NotepadPlusWrapper::getLanguageName(int langType) boost::python::str NotepadPlusWrapper::getLanguageDesc(int langType) { - int size = callNotepad(NPPM_GETLANGUAGEDESC, langType, NULL); + size_t size = callNotepad(NPPM_GETLANGUAGEDESC, langType, NULL); wchar_t* result(new wchar_t[size+1]); callNotepad(NPPM_GETLANGUAGEDESC, langType, reinterpret_cast(result)); std::shared_ptr languageName = WcharMbcsConverter::tchar2char(result); @@ -1101,7 +1106,7 @@ bool NotepadPlusWrapper::isSingleView() void NotepadPlusWrapper::flashWindow(UINT count, DWORD milliseconds) { - FLASHWINFO flashinfo; + FLASHWINFO flashinfo{}; flashinfo.cbSize = sizeof(flashinfo); flashinfo.hwnd = m_nppHandle; flashinfo.dwFlags = FLASHW_ALL; diff --git a/PythonScript/src/NotepadPlusWrapper.h b/PythonScript/src/NotepadPlusWrapper.h index 64376062..6d25cf92 100644 --- a/PythonScript/src/NotepadPlusWrapper.h +++ b/PythonScript/src/NotepadPlusWrapper.h @@ -117,6 +117,7 @@ enum MessageBoxFlags enum MenuCommands { + NPPIDM_FILE = IDM_FILE, NPPIDM_FILE_NEW = IDM_FILE_NEW, NPPIDM_FILE_OPEN = IDM_FILE_OPEN, NPPIDM_FILE_CLOSE = IDM_FILE_CLOSE, @@ -125,6 +126,7 @@ enum MenuCommands NPPIDM_FILE_SAVE = IDM_FILE_SAVE, NPPIDM_FILE_SAVEALL = IDM_FILE_SAVEALL, NPPIDM_FILE_SAVEAS = IDM_FILE_SAVEAS, + NPPIDM_FILE_CLOSEALL_TOLEFT = IDM_FILE_CLOSEALL_TOLEFT, NPPIDM_FILE_PRINT = IDM_FILE_PRINT, NPPIDM_FILE_PRINTNOW = IDM_FILE_PRINTNOW, NPPIDM_FILE_EXIT = IDM_FILE_EXIT, @@ -134,6 +136,17 @@ enum MenuCommands NPPIDM_FILE_SAVECOPYAS = IDM_FILE_SAVECOPYAS, NPPIDM_FILE_DELETE = IDM_FILE_DELETE, NPPIDM_FILE_RENAME = IDM_FILE_RENAME, + NPPIDM_FILE_CLOSEALL_TORIGHT = IDM_FILE_CLOSEALL_TORIGHT, + NPPIDM_FILE_OPEN_FOLDER = IDM_FILE_OPEN_FOLDER, + NPPIDM_FILE_OPEN_CMD = IDM_FILE_OPEN_CMD, + NPPIDM_FILE_RESTORELASTCLOSEDFILE = IDM_FILE_RESTORELASTCLOSEDFILE, + NPPIDM_FILE_OPENFOLDERASWORSPACE = IDM_FILE_OPENFOLDERASWORSPACE, + NPPIDM_FILE_OPEN_DEFAULT_VIEWER = IDM_FILE_OPEN_DEFAULT_VIEWER, + NPPIDM_FILE_CLOSEALL_UNCHANGED = IDM_FILE_CLOSEALL_UNCHANGED, + NPPIDM_FILE_CONTAININGFOLDERASWORKSPACE = IDM_FILE_CONTAININGFOLDERASWORKSPACE, + NPPIDM_FILEMENU_LASTONE = IDM_FILEMENU_LASTONE, + NPPIDM_FILEMENU_EXISTCMDPOSITION = IDM_FILEMENU_EXISTCMDPOSITION, + NPPIDM_EDIT = IDM_EDIT, NPPIDM_EDIT_CUT = IDM_EDIT_CUT, NPPIDM_EDIT_COPY = IDM_EDIT_COPY, NPPIDM_EDIT_UNDO = IDM_EDIT_UNDO, @@ -144,7 +157,6 @@ enum MenuCommands NPPIDM_EDIT_INS_TAB = IDM_EDIT_INS_TAB, NPPIDM_EDIT_RMV_TAB = IDM_EDIT_RMV_TAB, NPPIDM_EDIT_DUP_LINE = IDM_EDIT_DUP_LINE, - NPPIDM_EDIT_REMOVE_DUP_LINES = IDM_EDIT_REMOVE_DUP_LINES, NPPIDM_EDIT_TRANSPOSE_LINE = IDM_EDIT_TRANSPOSE_LINE, NPPIDM_EDIT_SPLIT_LINES = IDM_EDIT_SPLIT_LINES, NPPIDM_EDIT_JOIN_LINES = IDM_EDIT_JOIN_LINES, @@ -154,6 +166,7 @@ enum MenuCommands NPPIDM_EDIT_LOWERCASE = IDM_EDIT_LOWERCASE, NPPIDM_MACRO_STARTRECORDINGMACRO = IDM_MACRO_STARTRECORDINGMACRO, NPPIDM_MACRO_STOPRECORDINGMACRO = IDM_MACRO_STOPRECORDINGMACRO, + NPPIDM_EDIT_BEGINENDSELECT = IDM_EDIT_BEGINENDSELECT, NPPIDM_MACRO_PLAYBACKRECORDEDMACRO = IDM_MACRO_PLAYBACKRECORDEDMACRO, NPPIDM_EDIT_BLOCK_COMMENT = IDM_EDIT_BLOCK_COMMENT, NPPIDM_EDIT_STREAM_COMMENT = IDM_EDIT_STREAM_COMMENT, @@ -170,11 +183,63 @@ enum MenuCommands NPPIDM_EDIT_COLUMNMODE = IDM_EDIT_COLUMNMODE, NPPIDM_EDIT_BLOCK_COMMENT_SET = IDM_EDIT_BLOCK_COMMENT_SET, NPPIDM_EDIT_BLOCK_UNCOMMENT = IDM_EDIT_BLOCK_UNCOMMENT, + NPPIDM_EDIT_COLUMNMODETIP = IDM_EDIT_COLUMNMODETIP, + NPPIDM_EDIT_PASTE_AS_HTML = IDM_EDIT_PASTE_AS_HTML, + NPPIDM_EDIT_PASTE_AS_RTF = IDM_EDIT_PASTE_AS_RTF, + NPPIDM_OPEN_ALL_RECENT_FILE = IDM_OPEN_ALL_RECENT_FILE, + NPPIDM_CLEAN_RECENT_FILE_LIST = IDM_CLEAN_RECENT_FILE_LIST, + NPPIDM_EDIT_TRIMLINEHEAD = IDM_EDIT_TRIMLINEHEAD, + NPPIDM_EDIT_TRIM_BOTH = IDM_EDIT_TRIM_BOTH, + NPPIDM_EDIT_EOL2WS = IDM_EDIT_EOL2WS, + NPPIDM_EDIT_TRIMALL = IDM_EDIT_TRIMALL, + NPPIDM_EDIT_TAB2SW = IDM_EDIT_TAB2SW, + NPPIDM_EDIT_STREAM_UNCOMMENT = IDM_EDIT_STREAM_UNCOMMENT, + NPPIDM_EDIT_COPY_BINARY = IDM_EDIT_COPY_BINARY, + NPPIDM_EDIT_CUT_BINARY = IDM_EDIT_CUT_BINARY, + NPPIDM_EDIT_PASTE_BINARY = IDM_EDIT_PASTE_BINARY, + NPPIDM_EDIT_CHAR_PANEL = IDM_EDIT_CHAR_PANEL, + NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL = IDM_EDIT_CLIPBOARDHISTORY_PANEL, + NPPIDM_EDIT_SW2TAB_LEADING = IDM_EDIT_SW2TAB_LEADING, + NPPIDM_EDIT_SW2TAB_ALL = IDM_EDIT_SW2TAB_ALL, + NPPIDM_EDIT_REMOVEEMPTYLINES = IDM_EDIT_REMOVEEMPTYLINES, + NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK = IDM_EDIT_REMOVEEMPTYLINESWITHBLANK, + NPPIDM_EDIT_BLANKLINEABOVECURRENT = IDM_EDIT_BLANKLINEABOVECURRENT, + NPPIDM_EDIT_BLANKLINEBELOWCURRENT = IDM_EDIT_BLANKLINEBELOWCURRENT, + NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING, + NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING, + NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING = IDM_EDIT_SORTLINES_INTEGER_ASCENDING, + NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING = IDM_EDIT_SORTLINES_INTEGER_DESCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING, + NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING, + NPPIDM_EDIT_PROPERCASE_FORCE = IDM_EDIT_PROPERCASE_FORCE, + NPPIDM_EDIT_PROPERCASE_BLEND = IDM_EDIT_PROPERCASE_BLEND, + NPPIDM_EDIT_SENTENCECASE_FORCE = IDM_EDIT_SENTENCECASE_FORCE, + NPPIDM_EDIT_SENTENCECASE_BLEND = IDM_EDIT_SENTENCECASE_BLEND, + NPPIDM_EDIT_INVERTCASE = IDM_EDIT_INVERTCASE, + NPPIDM_EDIT_RANDOMCASE = IDM_EDIT_RANDOMCASE, + NPPIDM_EDIT_OPENASFILE = IDM_EDIT_OPENASFILE, + NPPIDM_EDIT_OPENINFOLDER = IDM_EDIT_OPENINFOLDER, + NPPIDM_EDIT_SEARCHONINTERNET = IDM_EDIT_SEARCHONINTERNET, + NPPIDM_EDIT_CHANGESEARCHENGINE = IDM_EDIT_CHANGESEARCHENGINE, + NPPIDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES = IDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES, + NPPIDM_EDIT_SORTLINES_RANDOMLY = IDM_EDIT_SORTLINES_RANDOMLY, + NPPIDM_EDIT_REMOVE_ANY_DUP_LINES = IDM_EDIT_REMOVE_ANY_DUP_LINES, + NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING = IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING, + NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING = IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING, + NPPIDM_EDIT_COPY_LINK = IDM_EDIT_COPY_LINK, + NPPIDM_EDIT_SORTLINES_REVERSE_ORDER = IDM_EDIT_SORTLINES_REVERSE_ORDER, + NPPIDM_EDIT_INSERT_DATETIME_SHORT = IDM_EDIT_INSERT_DATETIME_SHORT, + NPPIDM_EDIT_INSERT_DATETIME_LONG = IDM_EDIT_INSERT_DATETIME_LONG, + NPPIDM_EDIT_INSERT_DATETIME_CUSTOMIZED = IDM_EDIT_INSERT_DATETIME_CUSTOMIZED, + NPPIDM_EDIT_COPY_ALL_NAMES = IDM_EDIT_COPY_ALL_NAMES, + NPPIDM_EDIT_COPY_ALL_PATHS = IDM_EDIT_COPY_ALL_PATHS, NPPIDM_EDIT_AUTOCOMPLETE = IDM_EDIT_AUTOCOMPLETE, NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE = IDM_EDIT_AUTOCOMPLETE_CURRENTFILE, NPPIDM_EDIT_FUNCCALLTIP = IDM_EDIT_FUNCCALLTIP, - NPPIDM_OPEN_ALL_RECENT_FILE = IDM_OPEN_ALL_RECENT_FILE, - NPPIDM_CLEAN_RECENT_FILE_LIST = IDM_CLEAN_RECENT_FILE_LIST, + NPPIDM_EDIT_AUTOCOMPLETE_PATH = IDM_EDIT_AUTOCOMPLETE_PATH, + NPPIDM_SEARCH = IDM_SEARCH, NPPIDM_SEARCH_FIND = IDM_SEARCH_FIND, NPPIDM_SEARCH_FINDNEXT = IDM_SEARCH_FINDNEXT, NPPIDM_SEARCH_REPLACE = IDM_SEARCH_REPLACE, @@ -221,6 +286,29 @@ enum MenuCommands NPPIDM_SEARCH_GOTOPREVFOUND = IDM_SEARCH_GOTOPREVFOUND, NPPIDM_SEARCH_SETANDFINDNEXT = IDM_SEARCH_SETANDFINDNEXT, NPPIDM_SEARCH_SETANDFINDPREV = IDM_SEARCH_SETANDFINDPREV, + NPPIDM_SEARCH_INVERSEMARKS = IDM_SEARCH_INVERSEMARKS, + NPPIDM_SEARCH_DELETEUNMARKEDLINES = IDM_SEARCH_DELETEUNMARKEDLINES, + NPPIDM_SEARCH_FINDCHARINRANGE = IDM_SEARCH_FINDCHARINRANGE, + NPPIDM_SEARCH_SELECTMATCHINGBRACES = IDM_SEARCH_SELECTMATCHINGBRACES, + NPPIDM_SEARCH_MARK = IDM_SEARCH_MARK, + NPPIDM_SEARCH_STYLE1TOCLIP = IDM_SEARCH_STYLE1TOCLIP, + NPPIDM_SEARCH_STYLE2TOCLIP = IDM_SEARCH_STYLE2TOCLIP, + NPPIDM_SEARCH_STYLE3TOCLIP = IDM_SEARCH_STYLE3TOCLIP, + NPPIDM_SEARCH_STYLE4TOCLIP = IDM_SEARCH_STYLE4TOCLIP, + NPPIDM_SEARCH_STYLE5TOCLIP = IDM_SEARCH_STYLE5TOCLIP, + NPPIDM_SEARCH_ALLSTYLESTOCLIP = IDM_SEARCH_ALLSTYLESTOCLIP, + NPPIDM_SEARCH_MARKEDTOCLIP = IDM_SEARCH_MARKEDTOCLIP, + NPPIDM_SEARCH_MARKONEEXT1 = IDM_SEARCH_MARKONEEXT1, + NPPIDM_SEARCH_MARKONEEXT2 = IDM_SEARCH_MARKONEEXT2, + NPPIDM_SEARCH_MARKONEEXT3 = IDM_SEARCH_MARKONEEXT3, + NPPIDM_SEARCH_MARKONEEXT4 = IDM_SEARCH_MARKONEEXT4, + NPPIDM_SEARCH_MARKONEEXT5 = IDM_SEARCH_MARKONEEXT5, + NPPIDM_MISC = IDM_MISC, + NPPIDM_DOCLIST_FILESCLOSE = IDM_DOCLIST_FILESCLOSE, + NPPIDM_DOCLIST_FILESCLOSEOTHERS = IDM_DOCLIST_FILESCLOSEOTHERS, + NPPIDM_DOCLIST_COPYNAMES = IDM_DOCLIST_COPYNAMES, + NPPIDM_DOCLIST_COPYPATHS = IDM_DOCLIST_COPYPATHS, + NPPIDM_VIEW = IDM_VIEW, NPPIDM_VIEW_TOOLBAR_REDUCE = IDM_VIEW_TOOLBAR_REDUCE, NPPIDM_VIEW_TOOLBAR_ENLARGE = IDM_VIEW_TOOLBAR_ENLARGE, NPPIDM_VIEW_TOOLBAR_STANDARD = IDM_VIEW_TOOLBAR_STANDARD, @@ -230,6 +318,7 @@ enum MenuCommands NPPIDM_VIEW_DRAWTABBAR_INACIVETAB = IDM_VIEW_DRAWTABBAR_INACIVETAB, NPPIDM_VIEW_POSTIT = IDM_VIEW_POSTIT, NPPIDM_VIEW_TOGGLE_FOLDALL = IDM_VIEW_TOGGLE_FOLDALL, + NPPIDM_VIEW_DISTRACTIONFREE = IDM_VIEW_DISTRACTIONFREE, NPPIDM_VIEW_LINENUMBER = IDM_VIEW_LINENUMBER, NPPIDM_VIEW_SYMBOLMARGIN = IDM_VIEW_SYMBOLMARGIN, NPPIDM_VIEW_FOLDERMAGIN = IDM_VIEW_FOLDERMAGIN, @@ -245,8 +334,8 @@ enum MenuCommands NPPIDM_VIEW_ZOOMOUT = IDM_VIEW_ZOOMOUT, NPPIDM_VIEW_TAB_SPACE = IDM_VIEW_TAB_SPACE, NPPIDM_VIEW_EOL = IDM_VIEW_EOL, - NPPIDM_VIEW_EDGELINE = IDM_VIEW_EDGELINE, - NPPIDM_VIEW_EDGEBACKGROUND = IDM_VIEW_EDGEBACKGROUND, + NPPIDM_VIEW_TOOLBAR_REDUCE_SET2 = IDM_VIEW_TOOLBAR_REDUCE_SET2, + NPPIDM_VIEW_TOOLBAR_ENLARGE_SET2 = IDM_VIEW_TOOLBAR_ENLARGE_SET2, NPPIDM_VIEW_TOGGLE_UNFOLDALL = IDM_VIEW_TOGGLE_UNFOLDALL, NPPIDM_VIEW_FOLD_CURRENT = IDM_VIEW_FOLD_CURRENT, NPPIDM_VIEW_UNFOLD_CURRENT = IDM_VIEW_UNFOLD_CURRENT, @@ -255,7 +344,6 @@ enum MenuCommands NPPIDM_VIEW_ALWAYSONTOP = IDM_VIEW_ALWAYSONTOP, NPPIDM_VIEW_SYNSCROLLV = IDM_VIEW_SYNSCROLLV, NPPIDM_VIEW_SYNSCROLLH = IDM_VIEW_SYNSCROLLH, - NPPIDM_VIEW_EDGENONE = IDM_VIEW_EDGENONE, NPPIDM_VIEW_DRAWTABBAR_CLOSEBOTTUN = IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN, NPPIDM_VIEW_DRAWTABBAR_DBCLK2CLOSE = IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE, NPPIDM_VIEW_REFRESHTABAR = IDM_VIEW_REFRESHTABAR, @@ -264,6 +352,10 @@ enum MenuCommands NPPIDM_VIEW_DRAWTABBAR_VERTICAL = IDM_VIEW_DRAWTABBAR_VERTICAL, NPPIDM_VIEW_DRAWTABBAR_MULTILINE = IDM_VIEW_DRAWTABBAR_MULTILINE, NPPIDM_VIEW_DOCCHANGEMARGIN = IDM_VIEW_DOCCHANGEMARGIN, + NPPIDM_VIEW_LWDEF = IDM_VIEW_LWDEF, + NPPIDM_VIEW_LWALIGN = IDM_VIEW_LWALIGN, + NPPIDM_VIEW_LWINDENT = IDM_VIEW_LWINDENT, + NPPIDM_VIEW_SUMMARY = IDM_VIEW_SUMMARY, NPPIDM_VIEW_FOLD = IDM_VIEW_FOLD, NPPIDM_VIEW_FOLD_1 = IDM_VIEW_FOLD_1, NPPIDM_VIEW_FOLD_2 = IDM_VIEW_FOLD_2, @@ -282,24 +374,57 @@ enum MenuCommands NPPIDM_VIEW_UNFOLD_6 = IDM_VIEW_UNFOLD_6, NPPIDM_VIEW_UNFOLD_7 = IDM_VIEW_UNFOLD_7, NPPIDM_VIEW_UNFOLD_8 = IDM_VIEW_UNFOLD_8, + NPPIDM_VIEW_DOCLIST = IDM_VIEW_DOCLIST, + NPPIDM_VIEW_SWITCHTO_OTHER_VIEW = IDM_VIEW_SWITCHTO_OTHER_VIEW, + NPPIDM_EXPORT_FUNC_LIST_AND_QUIT = IDM_EXPORT_FUNC_LIST_AND_QUIT, + NPPIDM_VIEW_DOC_MAP = IDM_VIEW_DOC_MAP, + NPPIDM_VIEW_PROJECT_PANEL_1 = IDM_VIEW_PROJECT_PANEL_1, + NPPIDM_VIEW_PROJECT_PANEL_2 = IDM_VIEW_PROJECT_PANEL_2, + NPPIDM_VIEW_PROJECT_PANEL_3 = IDM_VIEW_PROJECT_PANEL_3, + NPPIDM_VIEW_FUNC_LIST = IDM_VIEW_FUNC_LIST, + NPPIDM_VIEW_FILEBROWSER = IDM_VIEW_FILEBROWSER, + NPPIDM_VIEW_TAB1 = IDM_VIEW_TAB1, + NPPIDM_VIEW_TAB2 = IDM_VIEW_TAB2, + NPPIDM_VIEW_TAB3 = IDM_VIEW_TAB3, + NPPIDM_VIEW_TAB4 = IDM_VIEW_TAB4, + NPPIDM_VIEW_TAB5 = IDM_VIEW_TAB5, + NPPIDM_VIEW_TAB6 = IDM_VIEW_TAB6, + NPPIDM_VIEW_TAB7 = IDM_VIEW_TAB7, + NPPIDM_VIEW_TAB8 = IDM_VIEW_TAB8, + NPPIDM_VIEW_TAB9 = IDM_VIEW_TAB9, + NPPIDM_VIEW_TAB_NEXT = IDM_VIEW_TAB_NEXT, + NPPIDM_VIEW_TAB_PREV = IDM_VIEW_TAB_PREV, + NPPIDM_VIEW_MONITORING = IDM_VIEW_MONITORING, + NPPIDM_VIEW_TAB_MOVEFORWARD = IDM_VIEW_TAB_MOVEFORWARD, + NPPIDM_VIEW_TAB_MOVEBACKWARD = IDM_VIEW_TAB_MOVEBACKWARD, + NPPIDM_VIEW_IN_FIREFOX = IDM_VIEW_IN_FIREFOX, + NPPIDM_VIEW_IN_CHROME = IDM_VIEW_IN_CHROME, + NPPIDM_VIEW_IN_EDGE = IDM_VIEW_IN_EDGE, + NPPIDM_VIEW_IN_IE = IDM_VIEW_IN_IE, + NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_1 = IDM_VIEW_SWITCHTO_PROJECT_PANEL_1, + NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_2 = IDM_VIEW_SWITCHTO_PROJECT_PANEL_2, + NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_3 = IDM_VIEW_SWITCHTO_PROJECT_PANEL_3, + NPPIDM_VIEW_SWITCHTO_FILEBROWSER = IDM_VIEW_SWITCHTO_FILEBROWSER, + NPPIDM_VIEW_SWITCHTO_FUNC_LIST = IDM_VIEW_SWITCHTO_FUNC_LIST, + NPPIDM_VIEW_SWITCHTO_DOCLIST = IDM_VIEW_SWITCHTO_DOCLIST, NPPIDM_VIEW_GOTO_ANOTHER_VIEW = IDM_VIEW_GOTO_ANOTHER_VIEW, NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW = IDM_VIEW_CLONE_TO_ANOTHER_VIEW, NPPIDM_VIEW_GOTO_NEW_INSTANCE = IDM_VIEW_GOTO_NEW_INSTANCE, NPPIDM_VIEW_LOAD_IN_NEW_INSTANCE = IDM_VIEW_LOAD_IN_NEW_INSTANCE, - NPPIDM_VIEW_SWITCHTO_OTHER_VIEW = IDM_VIEW_SWITCHTO_OTHER_VIEW, + NPPIDM_FORMAT = IDM_FORMAT, NPPIDM_FORMAT_TODOS = IDM_FORMAT_TODOS, NPPIDM_FORMAT_TOUNIX = IDM_FORMAT_TOUNIX, NPPIDM_FORMAT_TOMAC = IDM_FORMAT_TOMAC, NPPIDM_FORMAT_ANSI = IDM_FORMAT_ANSI, NPPIDM_FORMAT_UTF_8 = IDM_FORMAT_UTF_8, - NPPIDM_FORMAT_UCS_2BE = IDM_FORMAT_UCS_2BE, - NPPIDM_FORMAT_UCS_2LE = IDM_FORMAT_UCS_2LE, + NPPIDM_FORMAT_UTF_16BE = IDM_FORMAT_UTF_16BE, + NPPIDM_FORMAT_UTF_16LE = IDM_FORMAT_UTF_16LE, NPPIDM_FORMAT_AS_UTF_8 = IDM_FORMAT_AS_UTF_8, NPPIDM_FORMAT_CONV2_ANSI = IDM_FORMAT_CONV2_ANSI, NPPIDM_FORMAT_CONV2_AS_UTF_8 = IDM_FORMAT_CONV2_AS_UTF_8, NPPIDM_FORMAT_CONV2_UTF_8 = IDM_FORMAT_CONV2_UTF_8, - NPPIDM_FORMAT_CONV2_UCS_2BE = IDM_FORMAT_CONV2_UCS_2BE, - NPPIDM_FORMAT_CONV2_UCS_2LE = IDM_FORMAT_CONV2_UCS_2LE, + NPPIDM_FORMAT_CONV2_UTF_16BE = IDM_FORMAT_CONV2_UTF_16BE, + NPPIDM_FORMAT_CONV2_UTF_16LE = IDM_FORMAT_CONV2_UTF_16LE, NPPIDM_FORMAT_ENCODE = IDM_FORMAT_ENCODE, NPPIDM_FORMAT_WIN_1250 = IDM_FORMAT_WIN_1250, NPPIDM_FORMAT_WIN_1251 = IDM_FORMAT_WIN_1251, @@ -348,6 +473,7 @@ enum MenuCommands NPPIDM_FORMAT_KOI8U_CYRILLIC = IDM_FORMAT_KOI8U_CYRILLIC, NPPIDM_FORMAT_KOI8R_CYRILLIC = IDM_FORMAT_KOI8R_CYRILLIC, NPPIDM_FORMAT_ENCODE_END = IDM_FORMAT_ENCODE_END, + NPPIDM_LANG = IDM_LANG, NPPIDM_LANGSTYLE_CONFIG_DLG = IDM_LANGSTYLE_CONFIG_DLG, NPPIDM_LANG_C = IDM_LANG_C, NPPIDM_LANG_CPP = IDM_LANG_CPP, @@ -403,117 +529,6 @@ enum MenuCommands NPPIDM_LANG_POWERSHELL = IDM_LANG_POWERSHELL, NPPIDM_LANG_R = IDM_LANG_R, NPPIDM_LANG_JSP = IDM_LANG_JSP, - NPPIDM_LANG_EXTERNAL = IDM_LANG_EXTERNAL, - NPPIDM_LANG_EXTERNAL_LIMIT = IDM_LANG_EXTERNAL_LIMIT, - NPPIDM_LANG_USER = IDM_LANG_USER, - NPPIDM_LANG_USER_LIMIT = IDM_LANG_USER_LIMIT, - NPPIDM_HOMESWEETHOME = IDM_HOMESWEETHOME, - NPPIDM_PROJECTPAGE = IDM_PROJECTPAGE, - NPPIDM_ONLINEHELP = IDM_ONLINEHELP, - NPPIDM_FORUM = IDM_FORUM, - NPPIDM_UPDATE_NPP = IDM_UPDATE_NPP, - NPPIDM_WIKIFAQ = IDM_WIKIFAQ, - NPPIDM_HELP = IDM_HELP, - NPPIDM_SETTING_IMPORTPLUGIN = IDM_SETTING_IMPORTPLUGIN, - NPPIDM_SETTING_IMPORTSTYLETHEMS = IDM_SETTING_IMPORTSTYLETHEMS, - NPPIDM_SETTING_TRAYICON = IDM_SETTING_TRAYICON, - NPPIDM_SETTING_SHORTCUT_MAPPER = IDM_SETTING_SHORTCUT_MAPPER, - NPPIDM_SETTING_REMEMBER_LAST_SESSION = IDM_SETTING_REMEMBER_LAST_SESSION, - NPPIDM_SETTING_PREFERENCE = IDM_SETTING_PREFERENCE, - NPPIDM_SETTING_OPENPLUGINSDIR = IDM_SETTING_OPENPLUGINSDIR, - NPPIDM_SETTING_PLUGINADM = IDM_SETTING_PLUGINADM, - NPPIDM_SYSTRAYPOPUP_ACTIVATE = IDM_SYSTRAYPOPUP_ACTIVATE, - NPPIDM_SYSTRAYPOPUP_NEWDOC = IDM_SYSTRAYPOPUP_NEWDOC, - NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE = IDM_SYSTRAYPOPUP_NEW_AND_PASTE, - NPPIDM_SYSTRAYPOPUP_OPENFILE = IDM_SYSTRAYPOPUP_OPENFILE, - NPPIDM_SYSTRAYPOPUP_CLOSE = IDM_SYSTRAYPOPUP_CLOSE, - NPPIDM_FILE_CLOSEALL_TOLEFT = IDM_FILE_CLOSEALL_TOLEFT, - NPPIDM_FILE_CLOSEALL_TORIGHT = IDM_FILE_CLOSEALL_TORIGHT, - NPPIDM_FILE_OPEN_FOLDER = IDM_FILE_OPEN_FOLDER, - NPPIDM_FILE_OPEN_CMD = IDM_FILE_OPEN_CMD, - NPPIDM_FILE_RESTORELASTCLOSEDFILE = IDM_FILE_RESTORELASTCLOSEDFILE, - NPPIDM_FILE_OPENFOLDERASWORSPACE = IDM_FILE_OPENFOLDERASWORSPACE, - NPPIDM_FILE_OPEN_DEFAULT_VIEWER = IDM_FILE_OPEN_DEFAULT_VIEWER, - NPPIDM_FILE_CLOSEALL_UNCHANGED = IDM_FILE_CLOSEALL_UNCHANGED, - NPPIDM_FILEMENU_LASTONE = IDM_FILEMENU_LASTONE, - NPPIDM_FILEMENU_EXISTCMDPOSITION = IDM_FILEMENU_EXISTCMDPOSITION, - NPPIDM_EDIT_BEGINENDSELECT = IDM_EDIT_BEGINENDSELECT, - NPPIDM_EDIT_PROPERCASE_FORCE = IDM_EDIT_PROPERCASE_FORCE, - NPPIDM_EDIT_PROPERCASE_BLEND = IDM_EDIT_PROPERCASE_BLEND, - NPPIDM_EDIT_SENTENCECASE_FORCE = IDM_EDIT_SENTENCECASE_FORCE, - NPPIDM_EDIT_SENTENCECASE_BLEND = IDM_EDIT_SENTENCECASE_BLEND, - NPPIDM_EDIT_INVERTCASE = IDM_EDIT_INVERTCASE, - NPPIDM_EDIT_RANDOMCASE = IDM_EDIT_RANDOMCASE, - NPPIDM_EDIT_REMOVEEMPTYLINES = IDM_EDIT_REMOVEEMPTYLINES, - NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK = IDM_EDIT_REMOVEEMPTYLINESWITHBLANK, - NPPIDM_EDIT_BLANKLINEABOVECURRENT = IDM_EDIT_BLANKLINEABOVECURRENT, - NPPIDM_EDIT_BLANKLINEBELOWCURRENT = IDM_EDIT_BLANKLINEBELOWCURRENT, - NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING, - NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING = IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING, - NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING = IDM_EDIT_SORTLINES_INTEGER_ASCENDING, - NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING = IDM_EDIT_SORTLINES_INTEGER_DESCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING = IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING, - NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING = IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING, - NPPIDM_EDIT_OPENASFILE = IDM_EDIT_OPENASFILE, - NPPIDM_EDIT_OPENINFOLDER = IDM_EDIT_OPENINFOLDER, - NPPIDM_EDIT_SEARCHONINTERNET = IDM_EDIT_SEARCHONINTERNET, - NPPIDM_EDIT_CHANGESEARCHENGINE = IDM_EDIT_CHANGESEARCHENGINE, - NPPIDM_EDIT_TRIMLINEHEAD = IDM_EDIT_TRIMLINEHEAD, - NPPIDM_EDIT_TRIM_BOTH = IDM_EDIT_TRIM_BOTH, - NPPIDM_EDIT_EOL2WS = IDM_EDIT_EOL2WS, - NPPIDM_EDIT_TRIMALL = IDM_EDIT_TRIMALL, - NPPIDM_EDIT_TAB2SW = IDM_EDIT_TAB2SW, - NPPIDM_EDIT_SW2TAB_LEADING = IDM_EDIT_SW2TAB_LEADING, - NPPIDM_EDIT_SW2TAB_ALL = IDM_EDIT_SW2TAB_ALL, - NPPIDM_EDIT_STREAM_UNCOMMENT = IDM_EDIT_STREAM_UNCOMMENT, - NPPIDM_EDIT_COLUMNMODETIP = IDM_EDIT_COLUMNMODETIP, - NPPIDM_EDIT_PASTE_AS_HTML = IDM_EDIT_PASTE_AS_HTML, - NPPIDM_EDIT_PASTE_AS_RTF = IDM_EDIT_PASTE_AS_RTF, - NPPIDM_EDIT_COPY_BINARY = IDM_EDIT_COPY_BINARY, - NPPIDM_EDIT_CUT_BINARY = IDM_EDIT_CUT_BINARY, - NPPIDM_EDIT_PASTE_BINARY = IDM_EDIT_PASTE_BINARY, - NPPIDM_EDIT_CHAR_PANEL = IDM_EDIT_CHAR_PANEL, - NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL = IDM_EDIT_CLIPBOARDHISTORY_PANEL, - NPPIDM_EDIT_AUTOCOMPLETE_PATH = IDM_EDIT_AUTOCOMPLETE_PATH, - NPPIDM_SEARCH_INVERSEMARKS = IDM_SEARCH_INVERSEMARKS, - NPPIDM_SEARCH_DELETEUNMARKEDLINES = IDM_SEARCH_DELETEUNMARKEDLINES, - NPPIDM_SEARCH_FINDCHARINRANGE = IDM_SEARCH_FINDCHARINRANGE, - NPPIDM_SEARCH_SELECTMATCHINGBRACES = IDM_SEARCH_SELECTMATCHINGBRACES, - NPPIDM_SEARCH_MARK = IDM_SEARCH_MARK, - NPPIDM_FILESWITCHER_FILESCLOSE = IDM_FILESWITCHER_FILESCLOSE, - NPPIDM_FILESWITCHER_FILESCLOSEOTHERS = IDM_FILESWITCHER_FILESCLOSEOTHERS, - NPPIDM_VIEW_LWDEF = IDM_VIEW_LWDEF, - NPPIDM_VIEW_LWALIGN = IDM_VIEW_LWALIGN, - NPPIDM_VIEW_LWINDENT = IDM_VIEW_LWINDENT, - NPPIDM_VIEW_SUMMARY = IDM_VIEW_SUMMARY, - NPPIDM_VIEW_FILESWITCHER_PANEL = IDM_VIEW_FILESWITCHER_PANEL, - NPPIDM_EXPORT_FUNC_LIST_AND_QUIT = IDM_EXPORT_FUNC_LIST_AND_QUIT, - NPPIDM_VIEW_DOC_MAP = IDM_VIEW_DOC_MAP, - NPPIDM_VIEW_PROJECT_PANEL_1 = IDM_VIEW_PROJECT_PANEL_1, - NPPIDM_VIEW_PROJECT_PANEL_2 = IDM_VIEW_PROJECT_PANEL_2, - NPPIDM_VIEW_PROJECT_PANEL_3 = IDM_VIEW_PROJECT_PANEL_3, - NPPIDM_VIEW_FUNC_LIST = IDM_VIEW_FUNC_LIST, - NPPIDM_VIEW_FILEBROWSER = IDM_VIEW_FILEBROWSER, - NPPIDM_VIEW_TAB1 = IDM_VIEW_TAB1, - NPPIDM_VIEW_TAB2 = IDM_VIEW_TAB2, - NPPIDM_VIEW_TAB3 = IDM_VIEW_TAB3, - NPPIDM_VIEW_TAB4 = IDM_VIEW_TAB4, - NPPIDM_VIEW_TAB5 = IDM_VIEW_TAB5, - NPPIDM_VIEW_TAB6 = IDM_VIEW_TAB6, - NPPIDM_VIEW_TAB7 = IDM_VIEW_TAB7, - NPPIDM_VIEW_TAB8 = IDM_VIEW_TAB8, - NPPIDM_VIEW_TAB9 = IDM_VIEW_TAB9, - NPPIDM_VIEW_TAB_NEXT = IDM_VIEW_TAB_NEXT, - NPPIDM_VIEW_TAB_PREV = IDM_VIEW_TAB_PREV, - NPPIDM_VIEW_MONITORING = IDM_VIEW_MONITORING, - NPPIDM_VIEW_TAB_MOVEFORWARD = IDM_VIEW_TAB_MOVEFORWARD, - NPPIDM_VIEW_TAB_MOVEBACKWARD = IDM_VIEW_TAB_MOVEBACKWARD, - NPPIDM_VIEW_IN_FIREFOX = IDM_VIEW_IN_FIREFOX, - NPPIDM_VIEW_IN_CHROME = IDM_VIEW_IN_CHROME, - NPPIDM_VIEW_IN_EDGE = IDM_VIEW_IN_EDGE, - NPPIDM_VIEW_IN_IE = IDM_VIEW_IN_IE, NPPIDM_LANG_COFFEESCRIPT = IDM_LANG_COFFEESCRIPT, NPPIDM_LANG_JSON = IDM_LANG_JSON, NPPIDM_LANG_FORTRAN_77 = IDM_LANG_FORTRAN_77, @@ -533,7 +548,7 @@ enum MenuCommands NPPIDM_LANG_FORTH = IDM_LANG_FORTH, NPPIDM_LANG_LATEX = IDM_LANG_LATEX, NPPIDM_LANG_MMIXAL = IDM_LANG_MMIXAL, - NPPIDM_LANG_NIMROD = IDM_LANG_NIMROD, + NPPIDM_LANG_NIM = IDM_LANG_NIM, NPPIDM_LANG_NNCRONTAB = IDM_LANG_NNCRONTAB, NPPIDM_LANG_OSCRIPT = IDM_LANG_OSCRIPT, NPPIDM_LANG_REBOL = IDM_LANG_REBOL, @@ -542,16 +557,50 @@ enum MenuCommands NPPIDM_LANG_SPICE = IDM_LANG_SPICE, NPPIDM_LANG_TXT2TAGS = IDM_LANG_TXT2TAGS, NPPIDM_LANG_VISUALPROLOG = IDM_LANG_VISUALPROLOG, + NPPIDM_LANG_TYPESCRIPT = IDM_LANG_TYPESCRIPT, + NPPIDM_LANG_EXTERNAL = IDM_LANG_EXTERNAL, + NPPIDM_LANG_EXTERNAL_LIMIT = IDM_LANG_EXTERNAL_LIMIT, + NPPIDM_LANG_USER = IDM_LANG_USER, + NPPIDM_LANG_USER_LIMIT = IDM_LANG_USER_LIMIT, NPPIDM_LANG_USER_DLG = IDM_LANG_USER_DLG, + NPPIDM_LANG_OPENUDLDIR = IDM_LANG_OPENUDLDIR, + NPPIDM_LANG_UDLCOLLECTION_PROJECT_SITE = IDM_LANG_UDLCOLLECTION_PROJECT_SITE, + NPPIDM_ABOUT = IDM_ABOUT, + NPPIDM_HOMESWEETHOME = IDM_HOMESWEETHOME, + NPPIDM_PROJECTPAGE = IDM_PROJECTPAGE, + NPPIDM_ONLINEDOCUMENT = IDM_ONLINEDOCUMENT, + NPPIDM_FORUM = IDM_FORUM, + NPPIDM_UPDATE_NPP = IDM_UPDATE_NPP, + NPPIDM_WIKIFAQ = IDM_WIKIFAQ, + NPPIDM_CONFUPDATERPROXY = IDM_CONFUPDATERPROXY, + NPPIDM_CMDLINEARGUMENTS = IDM_CMDLINEARGUMENTS, + NPPIDM_DEBUGINFO = IDM_DEBUGINFO, + NPPIDM_SETTING = IDM_SETTING, + NPPIDM_SETTING_IMPORTPLUGIN = IDM_SETTING_IMPORTPLUGIN, + NPPIDM_SETTING_IMPORTSTYLETHEMS = IDM_SETTING_IMPORTSTYLETHEMS, + NPPIDM_SETTING_TRAYICON = IDM_SETTING_TRAYICON, + NPPIDM_SETTING_SHORTCUT_MAPPER = IDM_SETTING_SHORTCUT_MAPPER, + NPPIDM_SETTING_REMEMBER_LAST_SESSION = IDM_SETTING_REMEMBER_LAST_SESSION, + NPPIDM_SETTING_PREFERENCE = IDM_SETTING_PREFERENCE, + NPPIDM_SETTING_OPENPLUGINSDIR = IDM_SETTING_OPENPLUGINSDIR, + NPPIDM_SETTING_PLUGINADM = IDM_SETTING_PLUGINADM, NPPIDM_SETTING_SHORTCUT_MAPPER_MACRO = IDM_SETTING_SHORTCUT_MAPPER_MACRO, NPPIDM_SETTING_SHORTCUT_MAPPER_RUN = IDM_SETTING_SHORTCUT_MAPPER_RUN, NPPIDM_SETTING_EDITCONTEXTMENU = IDM_SETTING_EDITCONTEXTMENU, + NPPIDM_TOOL = IDM_TOOL, NPPIDM_TOOL_MD5_GENERATE = IDM_TOOL_MD5_GENERATE, NPPIDM_TOOL_MD5_GENERATEFROMFILE = IDM_TOOL_MD5_GENERATEFROMFILE, NPPIDM_TOOL_MD5_GENERATEINTOCLIPBOARD = IDM_TOOL_MD5_GENERATEINTOCLIPBOARD, NPPIDM_TOOL_SHA256_GENERATE = IDM_TOOL_SHA256_GENERATE, NPPIDM_TOOL_SHA256_GENERATEFROMFILE = IDM_TOOL_SHA256_GENERATEFROMFILE, - NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD + NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD = IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD, + NPPIDM_EXECUTE = IDM_EXECUTE, + NPPIDM_SYSTRAYPOPUP = IDM_SYSTRAYPOPUP, + NPPIDM_SYSTRAYPOPUP_ACTIVATE = IDM_SYSTRAYPOPUP_ACTIVATE, + NPPIDM_SYSTRAYPOPUP_NEWDOC = IDM_SYSTRAYPOPUP_NEWDOC, + NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE = IDM_SYSTRAYPOPUP_NEW_AND_PASTE, + NPPIDM_SYSTRAYPOPUP_OPENFILE = IDM_SYSTRAYPOPUP_OPENFILE, + NPPIDM_SYSTRAYPOPUP_CLOSE = IDM_SYSTRAYPOPUP_CLOSE }; @@ -677,7 +726,9 @@ class NotepadPlusWrapper bool isDocSwitcherShown(); - void docSwitcherDisableColumn(bool disableOrNot); + void docSwitcherDisableExtColumn(bool disableOrNot); + + void docSwitcherDisablePathColumn(bool disableOrNot); intptr_t getCurrentNativeLangEncoding(); diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index 1028385c..91731bcc 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -102,7 +102,8 @@ void export_notepad() .def("saveFile", &NotepadPlusWrapper::saveFile, boost::python::args("filename"), "Saves the provided file - must not be the active one") .def("showDocSwitcher", &NotepadPlusWrapper::showDocSwitcher, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") .def("isDocSwitcherShown", &NotepadPlusWrapper::isDocSwitcherShown, "Returns True if document switcher is shown else False") - .def("docSwitcherDisableColumn", &NotepadPlusWrapper::docSwitcherDisableColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") + .def("docSwitcherDisableExtColumn", &NotepadPlusWrapper::docSwitcherDisableExtColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") + .def("docSwitcherDisablePathColumn", &NotepadPlusWrapper::docSwitcherDisablePathColumn, boost::python::args("boolean"), "True if it should be hidden, False if it should be shown") .def("getCurrentNativeLangEncoding", &NotepadPlusWrapper::getCurrentNativeLangEncoding, "Returns the current native language encoding") .def("getLanguageName", &NotepadPlusWrapper::getLanguageName, boost::python::args("langType"), "Get programming language name from the given language type") .def("getLanguageDesc", &NotepadPlusWrapper::getLanguageDesc, boost::python::args("langType"), "Get programming language short description from the given language type") @@ -199,7 +200,7 @@ void export_notepad() .value("FORTH", L_FORTH) .value("LATEX", L_LATEX) .value("MMIXAL", L_MMIXAL) - .value("NIMROD", L_NIMROD) + .value("NIM", L_NIM) .value("NNCRONTAB", L_NNCRONTAB) .value("OSCRIPT", L_OSCRIPT) .value("REBOL", L_REBOL) @@ -207,7 +208,8 @@ void export_notepad() .value("RUST", L_RUST) .value("SPICE", L_SPICE) .value("TXT2TAGS", L_TXT2TAGS) - .value("VISUALPROLOG", L_VISUALPROLOG); + .value("VISUALPROLOG", L_VISUALPROLOG) + .value("TYPESCRIPT", L_TYPESCRIPT); boost::python::enum_("WINVER") .value("UNKNOWN", WV_UNKNOWN) @@ -315,6 +317,7 @@ void export_notepad() boost::python::enum_("MENUCOMMAND") + .value("FILE", NPPIDM_FILE) .value("FILE_NEW", NPPIDM_FILE_NEW) .value("FILE_OPEN", NPPIDM_FILE_OPEN) .value("FILE_CLOSE", NPPIDM_FILE_CLOSE) @@ -323,6 +326,7 @@ void export_notepad() .value("FILE_SAVE", NPPIDM_FILE_SAVE) .value("FILE_SAVEALL", NPPIDM_FILE_SAVEALL) .value("FILE_SAVEAS", NPPIDM_FILE_SAVEAS) + .value("FILE_CLOSEALL_TOLEFT", NPPIDM_FILE_CLOSEALL_TOLEFT) .value("FILE_PRINT", NPPIDM_FILE_PRINT) .value("FILE_PRINTNOW", NPPIDM_FILE_PRINTNOW) .value("FILE_EXIT", NPPIDM_FILE_EXIT) @@ -332,6 +336,17 @@ void export_notepad() .value("FILE_SAVECOPYAS", NPPIDM_FILE_SAVECOPYAS) .value("FILE_DELETE", NPPIDM_FILE_DELETE) .value("FILE_RENAME", NPPIDM_FILE_RENAME) + .value("FILE_CLOSEALL_TORIGHT", NPPIDM_FILE_CLOSEALL_TORIGHT) + .value("FILE_OPEN_FOLDER", NPPIDM_FILE_OPEN_FOLDER) + .value("FILE_OPEN_CMD", NPPIDM_FILE_OPEN_CMD) + .value("FILE_RESTORELASTCLOSEDFILE", NPPIDM_FILE_RESTORELASTCLOSEDFILE) + .value("FILE_OPENFOLDERASWORSPACE", NPPIDM_FILE_OPENFOLDERASWORSPACE) + .value("FILE_OPEN_DEFAULT_VIEWER", NPPIDM_FILE_OPEN_DEFAULT_VIEWER) + .value("FILE_CLOSEALL_UNCHANGED", NPPIDM_FILE_CLOSEALL_UNCHANGED) + .value("FILE_CONTAININGFOLDERASWORKSPACE", NPPIDM_FILE_CONTAININGFOLDERASWORKSPACE) + .value("FILEMENU_LASTONE", NPPIDM_FILEMENU_LASTONE) + .value("FILEMENU_EXISTCMDPOSITION", NPPIDM_FILEMENU_EXISTCMDPOSITION) + .value("EDIT", NPPIDM_EDIT) .value("EDIT_CUT", NPPIDM_EDIT_CUT) .value("EDIT_COPY", NPPIDM_EDIT_COPY) .value("EDIT_UNDO", NPPIDM_EDIT_UNDO) @@ -342,7 +357,6 @@ void export_notepad() .value("EDIT_INS_TAB", NPPIDM_EDIT_INS_TAB) .value("EDIT_RMV_TAB", NPPIDM_EDIT_RMV_TAB) .value("EDIT_DUP_LINE", NPPIDM_EDIT_DUP_LINE) - .value("EDIT_REMOVE_DUP_LINES", NPPIDM_EDIT_REMOVE_DUP_LINES) .value("EDIT_TRANSPOSE_LINE", NPPIDM_EDIT_TRANSPOSE_LINE) .value("EDIT_SPLIT_LINES", NPPIDM_EDIT_SPLIT_LINES) .value("EDIT_JOIN_LINES", NPPIDM_EDIT_JOIN_LINES) @@ -352,6 +366,7 @@ void export_notepad() .value("EDIT_LOWERCASE", NPPIDM_EDIT_LOWERCASE) .value("MACRO_STARTRECORDINGMACRO", NPPIDM_MACRO_STARTRECORDINGMACRO) .value("MACRO_STOPRECORDINGMACRO", NPPIDM_MACRO_STOPRECORDINGMACRO) + .value("EDIT_BEGINENDSELECT", NPPIDM_EDIT_BEGINENDSELECT) .value("MACRO_PLAYBACKRECORDEDMACRO", NPPIDM_MACRO_PLAYBACKRECORDEDMACRO) .value("EDIT_BLOCK_COMMENT", NPPIDM_EDIT_BLOCK_COMMENT) .value("EDIT_STREAM_COMMENT", NPPIDM_EDIT_STREAM_COMMENT) @@ -368,11 +383,63 @@ void export_notepad() .value("EDIT_COLUMNMODE", NPPIDM_EDIT_COLUMNMODE) .value("EDIT_BLOCK_COMMENT_SET", NPPIDM_EDIT_BLOCK_COMMENT_SET) .value("EDIT_BLOCK_UNCOMMENT", NPPIDM_EDIT_BLOCK_UNCOMMENT) + .value("EDIT_COLUMNMODETIP", NPPIDM_EDIT_COLUMNMODETIP) + .value("EDIT_PASTE_AS_HTML", NPPIDM_EDIT_PASTE_AS_HTML) + .value("EDIT_PASTE_AS_RTF", NPPIDM_EDIT_PASTE_AS_RTF) + .value("OPEN_ALL_RECENT_FILE", NPPIDM_OPEN_ALL_RECENT_FILE) + .value("CLEAN_RECENT_FILE_LIST", NPPIDM_CLEAN_RECENT_FILE_LIST) + .value("EDIT_TRIMLINEHEAD", NPPIDM_EDIT_TRIMLINEHEAD) + .value("EDIT_TRIM_BOTH", NPPIDM_EDIT_TRIM_BOTH) + .value("EDIT_EOL2WS", NPPIDM_EDIT_EOL2WS) + .value("EDIT_TRIMALL", NPPIDM_EDIT_TRIMALL) + .value("EDIT_TAB2SW", NPPIDM_EDIT_TAB2SW) + .value("EDIT_STREAM_UNCOMMENT", NPPIDM_EDIT_STREAM_UNCOMMENT) + .value("EDIT_COPY_BINARY", NPPIDM_EDIT_COPY_BINARY) + .value("EDIT_CUT_BINARY", NPPIDM_EDIT_CUT_BINARY) + .value("EDIT_PASTE_BINARY", NPPIDM_EDIT_PASTE_BINARY) + .value("EDIT_CHAR_PANEL", NPPIDM_EDIT_CHAR_PANEL) + .value("EDIT_CLIPBOARDHISTORY_PANEL", NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL) + .value("EDIT_SW2TAB_LEADING", NPPIDM_EDIT_SW2TAB_LEADING) + .value("EDIT_SW2TAB_ALL", NPPIDM_EDIT_SW2TAB_ALL) + .value("EDIT_REMOVEEMPTYLINES", NPPIDM_EDIT_REMOVEEMPTYLINES) + .value("EDIT_REMOVEEMPTYLINESWITHBLANK", NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK) + .value("EDIT_BLANKLINEABOVECURRENT", NPPIDM_EDIT_BLANKLINEABOVECURRENT) + .value("EDIT_BLANKLINEBELOWCURRENT", NPPIDM_EDIT_BLANKLINEBELOWCURRENT) + .value("EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING) + .value("EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING) + .value("EDIT_SORTLINES_INTEGER_ASCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING) + .value("EDIT_SORTLINES_INTEGER_DESCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING) + .value("EDIT_SORTLINES_DECIMALCOMMA_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING) + .value("EDIT_SORTLINES_DECIMALCOMMA_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING) + .value("EDIT_SORTLINES_DECIMALDOT_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING) + .value("EDIT_SORTLINES_DECIMALDOT_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING) + .value("EDIT_PROPERCASE_FORCE", NPPIDM_EDIT_PROPERCASE_FORCE) + .value("EDIT_PROPERCASE_BLEND", NPPIDM_EDIT_PROPERCASE_BLEND) + .value("EDIT_SENTENCECASE_FORCE", NPPIDM_EDIT_SENTENCECASE_FORCE) + .value("EDIT_SENTENCECASE_BLEND", NPPIDM_EDIT_SENTENCECASE_BLEND) + .value("EDIT_INVERTCASE", NPPIDM_EDIT_INVERTCASE) + .value("EDIT_RANDOMCASE", NPPIDM_EDIT_RANDOMCASE) + .value("EDIT_OPENASFILE", NPPIDM_EDIT_OPENASFILE) + .value("EDIT_OPENINFOLDER", NPPIDM_EDIT_OPENINFOLDER) + .value("EDIT_SEARCHONINTERNET", NPPIDM_EDIT_SEARCHONINTERNET) + .value("EDIT_CHANGESEARCHENGINE", NPPIDM_EDIT_CHANGESEARCHENGINE) + .value("EDIT_REMOVE_CONSECUTIVE_DUP_LINES", NPPIDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES) + .value("EDIT_SORTLINES_RANDOMLY", NPPIDM_EDIT_SORTLINES_RANDOMLY) + .value("EDIT_REMOVE_ANY_DUP_LINES", NPPIDM_EDIT_REMOVE_ANY_DUP_LINES) + .value("EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING", NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING) + .value("EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING", NPPIDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING) + .value("EDIT_COPY_LINK", NPPIDM_EDIT_COPY_LINK) + .value("EDIT_SORTLINES_REVERSE_ORDER", NPPIDM_EDIT_SORTLINES_REVERSE_ORDER) + .value("EDIT_INSERT_DATETIME_SHORT", NPPIDM_EDIT_INSERT_DATETIME_SHORT) + .value("EDIT_INSERT_DATETIME_LONG", NPPIDM_EDIT_INSERT_DATETIME_LONG) + .value("EDIT_INSERT_DATETIME_CUSTOMIZED", NPPIDM_EDIT_INSERT_DATETIME_CUSTOMIZED) + .value("EDIT_COPY_ALL_NAMES", NPPIDM_EDIT_COPY_ALL_NAMES) + .value("EDIT_COPY_ALL_PATHS", NPPIDM_EDIT_COPY_ALL_PATHS) .value("EDIT_AUTOCOMPLETE", NPPIDM_EDIT_AUTOCOMPLETE) .value("EDIT_AUTOCOMPLETE_CURRENTFILE", NPPIDM_EDIT_AUTOCOMPLETE_CURRENTFILE) .value("EDIT_FUNCCALLTIP", NPPIDM_EDIT_FUNCCALLTIP) - .value("OPEN_ALL_RECENT_FILE", NPPIDM_OPEN_ALL_RECENT_FILE) - .value("CLEAN_RECENT_FILE_LIST", NPPIDM_CLEAN_RECENT_FILE_LIST) + .value("EDIT_AUTOCOMPLETE_PATH", NPPIDM_EDIT_AUTOCOMPLETE_PATH) + .value("SEARCH", NPPIDM_SEARCH) .value("SEARCH_FIND", NPPIDM_SEARCH_FIND) .value("SEARCH_FINDNEXT", NPPIDM_SEARCH_FINDNEXT) .value("SEARCH_REPLACE", NPPIDM_SEARCH_REPLACE) @@ -419,6 +486,29 @@ void export_notepad() .value("SEARCH_GOTOPREVFOUND", NPPIDM_SEARCH_GOTOPREVFOUND) .value("SEARCH_SETANDFINDNEXT", NPPIDM_SEARCH_SETANDFINDNEXT) .value("SEARCH_SETANDFINDPREV", NPPIDM_SEARCH_SETANDFINDPREV) + .value("SEARCH_INVERSEMARKS", NPPIDM_SEARCH_INVERSEMARKS) + .value("SEARCH_DELETEUNMARKEDLINES", NPPIDM_SEARCH_DELETEUNMARKEDLINES) + .value("SEARCH_FINDCHARINRANGE", NPPIDM_SEARCH_FINDCHARINRANGE) + .value("SEARCH_SELECTMATCHINGBRACES", NPPIDM_SEARCH_SELECTMATCHINGBRACES) + .value("SEARCH_MARK", NPPIDM_SEARCH_MARK) + .value("SEARCH_STYLE1TOCLIP", NPPIDM_SEARCH_STYLE1TOCLIP) + .value("SEARCH_STYLE2TOCLIP", NPPIDM_SEARCH_STYLE2TOCLIP) + .value("SEARCH_STYLE3TOCLIP", NPPIDM_SEARCH_STYLE3TOCLIP) + .value("SEARCH_STYLE4TOCLIP", NPPIDM_SEARCH_STYLE4TOCLIP) + .value("SEARCH_STYLE5TOCLIP", NPPIDM_SEARCH_STYLE5TOCLIP) + .value("SEARCH_ALLSTYLESTOCLIP", NPPIDM_SEARCH_ALLSTYLESTOCLIP) + .value("SEARCH_MARKEDTOCLIP", NPPIDM_SEARCH_MARKEDTOCLIP) + .value("SEARCH_MARKONEEXT1", NPPIDM_SEARCH_MARKONEEXT1) + .value("SEARCH_MARKONEEXT2", NPPIDM_SEARCH_MARKONEEXT2) + .value("SEARCH_MARKONEEXT3", NPPIDM_SEARCH_MARKONEEXT3) + .value("SEARCH_MARKONEEXT4", NPPIDM_SEARCH_MARKONEEXT4) + .value("SEARCH_MARKONEEXT5", NPPIDM_SEARCH_MARKONEEXT5) + .value("MISC", NPPIDM_MISC) + .value("DOCLIST_FILESCLOSE", NPPIDM_DOCLIST_FILESCLOSE) + .value("DOCLIST_FILESCLOSEOTHERS", NPPIDM_DOCLIST_FILESCLOSEOTHERS) + .value("DOCLIST_COPYNAMES", NPPIDM_DOCLIST_COPYNAMES) + .value("DOCLIST_COPYPATHS", NPPIDM_DOCLIST_COPYPATHS) + .value("VIEW", NPPIDM_VIEW) .value("VIEW_TOOLBAR_REDUCE", NPPIDM_VIEW_TOOLBAR_REDUCE) .value("VIEW_TOOLBAR_ENLARGE", NPPIDM_VIEW_TOOLBAR_ENLARGE) .value("VIEW_TOOLBAR_STANDARD", NPPIDM_VIEW_TOOLBAR_STANDARD) @@ -428,6 +518,7 @@ void export_notepad() .value("VIEW_DRAWTABBAR_INACIVETAB", NPPIDM_VIEW_DRAWTABBAR_INACIVETAB) .value("VIEW_POSTIT", NPPIDM_VIEW_POSTIT) .value("VIEW_TOGGLE_FOLDALL", NPPIDM_VIEW_TOGGLE_FOLDALL) + .value("VIEW_DISTRACTIONFREE", NPPIDM_VIEW_DISTRACTIONFREE) .value("VIEW_LINENUMBER", NPPIDM_VIEW_LINENUMBER) .value("VIEW_SYMBOLMARGIN", NPPIDM_VIEW_SYMBOLMARGIN) .value("VIEW_FOLDERMAGIN", NPPIDM_VIEW_FOLDERMAGIN) @@ -443,8 +534,8 @@ void export_notepad() .value("VIEW_ZOOMOUT", NPPIDM_VIEW_ZOOMOUT) .value("VIEW_TAB_SPACE", NPPIDM_VIEW_TAB_SPACE) .value("VIEW_EOL", NPPIDM_VIEW_EOL) - .value("VIEW_EDGELINE", NPPIDM_VIEW_EDGELINE) - .value("VIEW_EDGEBACKGROUND", NPPIDM_VIEW_EDGEBACKGROUND) + .value("VIEW_TOOLBAR_REDUCE_SET2", NPPIDM_VIEW_TOOLBAR_REDUCE_SET2) + .value("VIEW_TOOLBAR_ENLARGE_SET2", NPPIDM_VIEW_TOOLBAR_ENLARGE_SET2) .value("VIEW_TOGGLE_UNFOLDALL", NPPIDM_VIEW_TOGGLE_UNFOLDALL) .value("VIEW_FOLD_CURRENT", NPPIDM_VIEW_FOLD_CURRENT) .value("VIEW_UNFOLD_CURRENT", NPPIDM_VIEW_UNFOLD_CURRENT) @@ -453,7 +544,6 @@ void export_notepad() .value("VIEW_ALWAYSONTOP", NPPIDM_VIEW_ALWAYSONTOP) .value("VIEW_SYNSCROLLV", NPPIDM_VIEW_SYNSCROLLV) .value("VIEW_SYNSCROLLH", NPPIDM_VIEW_SYNSCROLLH) - .value("VIEW_EDGENONE", NPPIDM_VIEW_EDGENONE) .value("VIEW_DRAWTABBAR_CLOSEBOTTUN", NPPIDM_VIEW_DRAWTABBAR_CLOSEBOTTUN) .value("VIEW_DRAWTABBAR_DBCLK2CLOSE", NPPIDM_VIEW_DRAWTABBAR_DBCLK2CLOSE) .value("VIEW_REFRESHTABAR", NPPIDM_VIEW_REFRESHTABAR) @@ -462,6 +552,10 @@ void export_notepad() .value("VIEW_DRAWTABBAR_VERTICAL", NPPIDM_VIEW_DRAWTABBAR_VERTICAL) .value("VIEW_DRAWTABBAR_MULTILINE", NPPIDM_VIEW_DRAWTABBAR_MULTILINE) .value("VIEW_DOCCHANGEMARGIN", NPPIDM_VIEW_DOCCHANGEMARGIN) + .value("VIEW_LWDEF", NPPIDM_VIEW_LWDEF) + .value("VIEW_LWALIGN", NPPIDM_VIEW_LWALIGN) + .value("VIEW_LWINDENT", NPPIDM_VIEW_LWINDENT) + .value("VIEW_SUMMARY", NPPIDM_VIEW_SUMMARY) .value("VIEW_FOLD", NPPIDM_VIEW_FOLD) .value("VIEW_FOLD_1", NPPIDM_VIEW_FOLD_1) .value("VIEW_FOLD_2", NPPIDM_VIEW_FOLD_2) @@ -480,24 +574,57 @@ void export_notepad() .value("VIEW_UNFOLD_6", NPPIDM_VIEW_UNFOLD_6) .value("VIEW_UNFOLD_7", NPPIDM_VIEW_UNFOLD_7) .value("VIEW_UNFOLD_8", NPPIDM_VIEW_UNFOLD_8) + .value("VIEW_DOCLIST", NPPIDM_VIEW_DOCLIST) + .value("VIEW_SWITCHTO_OTHER_VIEW", NPPIDM_VIEW_SWITCHTO_OTHER_VIEW) + .value("EXPORT_FUNC_LIST_AND_QUIT", NPPIDM_EXPORT_FUNC_LIST_AND_QUIT) + .value("VIEW_DOC_MAP", NPPIDM_VIEW_DOC_MAP) + .value("VIEW_PROJECT_PANEL_1", NPPIDM_VIEW_PROJECT_PANEL_1) + .value("VIEW_PROJECT_PANEL_2", NPPIDM_VIEW_PROJECT_PANEL_2) + .value("VIEW_PROJECT_PANEL_3", NPPIDM_VIEW_PROJECT_PANEL_3) + .value("VIEW_FUNC_LIST", NPPIDM_VIEW_FUNC_LIST) + .value("VIEW_FILEBROWSER", NPPIDM_VIEW_FILEBROWSER) + .value("VIEW_TAB1", NPPIDM_VIEW_TAB1) + .value("VIEW_TAB2", NPPIDM_VIEW_TAB2) + .value("VIEW_TAB3", NPPIDM_VIEW_TAB3) + .value("VIEW_TAB4", NPPIDM_VIEW_TAB4) + .value("VIEW_TAB5", NPPIDM_VIEW_TAB5) + .value("VIEW_TAB6", NPPIDM_VIEW_TAB6) + .value("VIEW_TAB7", NPPIDM_VIEW_TAB7) + .value("VIEW_TAB8", NPPIDM_VIEW_TAB8) + .value("VIEW_TAB9", NPPIDM_VIEW_TAB9) + .value("VIEW_TAB_NEXT", NPPIDM_VIEW_TAB_NEXT) + .value("VIEW_TAB_PREV", NPPIDM_VIEW_TAB_PREV) + .value("VIEW_MONITORING", NPPIDM_VIEW_MONITORING) + .value("VIEW_TAB_MOVEFORWARD", NPPIDM_VIEW_TAB_MOVEFORWARD) + .value("VIEW_TAB_MOVEBACKWARD", NPPIDM_VIEW_TAB_MOVEBACKWARD) + .value("VIEW_IN_FIREFOX", NPPIDM_VIEW_IN_FIREFOX) + .value("VIEW_IN_CHROME", NPPIDM_VIEW_IN_CHROME) + .value("VIEW_IN_EDGE", NPPIDM_VIEW_IN_EDGE) + .value("VIEW_IN_IE", NPPIDM_VIEW_IN_IE) + .value("VIEW_SWITCHTO_PROJECT_PANEL_1", NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_1) + .value("VIEW_SWITCHTO_PROJECT_PANEL_2", NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_2) + .value("VIEW_SWITCHTO_PROJECT_PANEL_3", NPPIDM_VIEW_SWITCHTO_PROJECT_PANEL_3) + .value("VIEW_SWITCHTO_FILEBROWSER", NPPIDM_VIEW_SWITCHTO_FILEBROWSER) + .value("VIEW_SWITCHTO_FUNC_LIST", NPPIDM_VIEW_SWITCHTO_FUNC_LIST) + .value("VIEW_SWITCHTO_DOCLIST", NPPIDM_VIEW_SWITCHTO_DOCLIST) .value("VIEW_GOTO_ANOTHER_VIEW", NPPIDM_VIEW_GOTO_ANOTHER_VIEW) .value("VIEW_CLONE_TO_ANOTHER_VIEW", NPPIDM_VIEW_CLONE_TO_ANOTHER_VIEW) .value("VIEW_GOTO_NEW_INSTANCE", NPPIDM_VIEW_GOTO_NEW_INSTANCE) .value("VIEW_LOAD_IN_NEW_INSTANCE", NPPIDM_VIEW_LOAD_IN_NEW_INSTANCE) - .value("VIEW_SWITCHTO_OTHER_VIEW", NPPIDM_VIEW_SWITCHTO_OTHER_VIEW) + .value("FORMAT", NPPIDM_FORMAT) .value("FORMAT_TODOS", NPPIDM_FORMAT_TODOS) .value("FORMAT_TOUNIX", NPPIDM_FORMAT_TOUNIX) .value("FORMAT_TOMAC", NPPIDM_FORMAT_TOMAC) .value("FORMAT_ANSI", NPPIDM_FORMAT_ANSI) .value("FORMAT_UTF_8", NPPIDM_FORMAT_UTF_8) - .value("FORMAT_UCS_2BE", NPPIDM_FORMAT_UCS_2BE) - .value("FORMAT_UCS_2LE", NPPIDM_FORMAT_UCS_2LE) + .value("FORMAT_UTF_16BE", NPPIDM_FORMAT_UTF_16BE) + .value("FORMAT_UTF_16LE", NPPIDM_FORMAT_UTF_16LE) .value("FORMAT_AS_UTF_8", NPPIDM_FORMAT_AS_UTF_8) .value("FORMAT_CONV2_ANSI", NPPIDM_FORMAT_CONV2_ANSI) .value("FORMAT_CONV2_AS_UTF_8", NPPIDM_FORMAT_CONV2_AS_UTF_8) .value("FORMAT_CONV2_UTF_8", NPPIDM_FORMAT_CONV2_UTF_8) - .value("FORMAT_CONV2_UCS_2BE", NPPIDM_FORMAT_CONV2_UCS_2BE) - .value("FORMAT_CONV2_UCS_2LE", NPPIDM_FORMAT_CONV2_UCS_2LE) + .value("FORMAT_CONV2_UTF_16BE", NPPIDM_FORMAT_CONV2_UTF_16BE) + .value("FORMAT_CONV2_UTF_16LE", NPPIDM_FORMAT_CONV2_UTF_16LE) .value("FORMAT_ENCODE", NPPIDM_FORMAT_ENCODE) .value("FORMAT_WIN_1250", NPPIDM_FORMAT_WIN_1250) .value("FORMAT_WIN_1251", NPPIDM_FORMAT_WIN_1251) @@ -546,6 +673,7 @@ void export_notepad() .value("FORMAT_KOI8U_CYRILLIC", NPPIDM_FORMAT_KOI8U_CYRILLIC) .value("FORMAT_KOI8R_CYRILLIC", NPPIDM_FORMAT_KOI8R_CYRILLIC) .value("FORMAT_ENCODE_END", NPPIDM_FORMAT_ENCODE_END) + .value("LANG", NPPIDM_LANG) .value("LANGSTYLE_CONFIG_DLG", NPPIDM_LANGSTYLE_CONFIG_DLG) .value("LANG_C", NPPIDM_LANG_C) .value("LANG_CPP", NPPIDM_LANG_CPP) @@ -601,117 +729,6 @@ void export_notepad() .value("LANG_POWERSHELL", NPPIDM_LANG_POWERSHELL) .value("LANG_R", NPPIDM_LANG_R) .value("LANG_JSP", NPPIDM_LANG_JSP) - .value("LANG_EXTERNAL", NPPIDM_LANG_EXTERNAL) - .value("LANG_EXTERNAL_LIMIT", NPPIDM_LANG_EXTERNAL_LIMIT) - .value("LANG_USER", NPPIDM_LANG_USER) - .value("LANG_USER_LIMIT", NPPIDM_LANG_USER_LIMIT) - .value("HOMESWEETHOME", NPPIDM_HOMESWEETHOME) - .value("PROJECTPAGE", NPPIDM_PROJECTPAGE) - .value("ONLINEHELP", NPPIDM_ONLINEHELP) - .value("FORUM", NPPIDM_FORUM) - .value("UPDATE_NPP", NPPIDM_UPDATE_NPP) - .value("WIKIFAQ", NPPIDM_WIKIFAQ) - .value("HELP", NPPIDM_HELP) - .value("SETTING_IMPORTPLUGIN", NPPIDM_SETTING_IMPORTPLUGIN) - .value("SETTING_IMPORTSTYLETHEMS", NPPIDM_SETTING_IMPORTSTYLETHEMS) - .value("SETTING_TRAYICON", NPPIDM_SETTING_TRAYICON) - .value("SETTING_SHORTCUT_MAPPER", NPPIDM_SETTING_SHORTCUT_MAPPER) - .value("SETTING_REMEMBER_LAST_SESSION", NPPIDM_SETTING_REMEMBER_LAST_SESSION) - .value("SETTING_PREFERENCE", NPPIDM_SETTING_PREFERENCE) - .value("SETTING_OPENPLUGINSDIR", NPPIDM_SETTING_OPENPLUGINSDIR) - .value("SETTING_PLUGINADM", NPPIDM_SETTING_PLUGINADM) - .value("SYSTRAYPOPUP_ACTIVATE", NPPIDM_SYSTRAYPOPUP_ACTIVATE) - .value("SYSTRAYPOPUP_NEWDOC", NPPIDM_SYSTRAYPOPUP_NEWDOC) - .value("SYSTRAYPOPUP_NEW_AND_PASTE", NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE) - .value("SYSTRAYPOPUP_OPENFILE", NPPIDM_SYSTRAYPOPUP_OPENFILE) - .value("SYSTRAYPOPUP_CLOSE", NPPIDM_SYSTRAYPOPUP_CLOSE) - .value("FILE_CLOSEALL_TOLEFT", NPPIDM_FILE_CLOSEALL_TOLEFT) - .value("FILE_CLOSEALL_TORIGHT", NPPIDM_FILE_CLOSEALL_TORIGHT) - .value("FILE_OPEN_FOLDER", NPPIDM_FILE_OPEN_FOLDER) - .value("FILE_OPEN_CMD", NPPIDM_FILE_OPEN_CMD) - .value("FILE_RESTORELASTCLOSEDFILE", NPPIDM_FILE_RESTORELASTCLOSEDFILE) - .value("FILE_OPENFOLDERASWORSPACE", NPPIDM_FILE_OPENFOLDERASWORSPACE) - .value("FILE_OPEN_DEFAULT_VIEWER", NPPIDM_FILE_OPEN_DEFAULT_VIEWER) - .value("FILE_CLOSEALL_UNCHANGED", NPPIDM_FILE_CLOSEALL_UNCHANGED) - .value("FILEMENU_LASTONE", NPPIDM_FILEMENU_LASTONE) - .value("FILEMENU_EXISTCMDPOSITION", NPPIDM_FILEMENU_EXISTCMDPOSITION) - .value("EDIT_BEGINENDSELECT", NPPIDM_EDIT_BEGINENDSELECT) - .value("EDIT_PROPERCASE_FORCE", NPPIDM_EDIT_PROPERCASE_FORCE) - .value("EDIT_PROPERCASE_BLEND", NPPIDM_EDIT_PROPERCASE_BLEND) - .value("EDIT_SENTENCECASE_FORCE", NPPIDM_EDIT_SENTENCECASE_FORCE) - .value("EDIT_SENTENCECASE_BLEND", NPPIDM_EDIT_SENTENCECASE_BLEND) - .value("EDIT_INVERTCASE", NPPIDM_EDIT_INVERTCASE) - .value("EDIT_RANDOMCASE", NPPIDM_EDIT_RANDOMCASE) - .value("EDIT_REMOVEEMPTYLINES", NPPIDM_EDIT_REMOVEEMPTYLINES) - .value("EDIT_REMOVEEMPTYLINESWITHBLANK", NPPIDM_EDIT_REMOVEEMPTYLINESWITHBLANK) - .value("EDIT_BLANKLINEABOVECURRENT", NPPIDM_EDIT_BLANKLINEABOVECURRENT) - .value("EDIT_BLANKLINEBELOWCURRENT", NPPIDM_EDIT_BLANKLINEBELOWCURRENT) - .value("EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING) - .value("EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING", NPPIDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING) - .value("EDIT_SORTLINES_INTEGER_ASCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_ASCENDING) - .value("EDIT_SORTLINES_INTEGER_DESCENDING", NPPIDM_EDIT_SORTLINES_INTEGER_DESCENDING) - .value("EDIT_SORTLINES_DECIMALCOMMA_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING) - .value("EDIT_SORTLINES_DECIMALCOMMA_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING) - .value("EDIT_SORTLINES_DECIMALDOT_ASCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING) - .value("EDIT_SORTLINES_DECIMALDOT_DESCENDING", NPPIDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING) - .value("EDIT_OPENASFILE", NPPIDM_EDIT_OPENASFILE) - .value("EDIT_OPENINFOLDER", NPPIDM_EDIT_OPENINFOLDER) - .value("EDIT_SEARCHONINTERNET", NPPIDM_EDIT_SEARCHONINTERNET) - .value("EDIT_CHANGESEARCHENGINE", NPPIDM_EDIT_CHANGESEARCHENGINE) - .value("EDIT_TRIMLINEHEAD", NPPIDM_EDIT_TRIMLINEHEAD) - .value("EDIT_TRIM_BOTH", NPPIDM_EDIT_TRIM_BOTH) - .value("EDIT_EOL2WS", NPPIDM_EDIT_EOL2WS) - .value("EDIT_TRIMALL", NPPIDM_EDIT_TRIMALL) - .value("EDIT_TAB2SW", NPPIDM_EDIT_TAB2SW) - .value("EDIT_SW2TAB_LEADING", NPPIDM_EDIT_SW2TAB_LEADING) - .value("EDIT_SW2TAB_ALL", NPPIDM_EDIT_SW2TAB_ALL) - .value("EDIT_STREAM_UNCOMMENT", NPPIDM_EDIT_STREAM_UNCOMMENT) - .value("EDIT_COLUMNMODETIP", NPPIDM_EDIT_COLUMNMODETIP) - .value("EDIT_PASTE_AS_HTML", NPPIDM_EDIT_PASTE_AS_HTML) - .value("EDIT_PASTE_AS_RTF", NPPIDM_EDIT_PASTE_AS_RTF) - .value("EDIT_COPY_BINARY", NPPIDM_EDIT_COPY_BINARY) - .value("EDIT_CUT_BINARY", NPPIDM_EDIT_CUT_BINARY) - .value("EDIT_PASTE_BINARY", NPPIDM_EDIT_PASTE_BINARY) - .value("EDIT_CHAR_PANEL", NPPIDM_EDIT_CHAR_PANEL) - .value("EDIT_CLIPBOARDHISTORY_PANEL", NPPIDM_EDIT_CLIPBOARDHISTORY_PANEL) - .value("EDIT_AUTOCOMPLETE_PATH", NPPIDM_EDIT_AUTOCOMPLETE_PATH) - .value("SEARCH_INVERSEMARKS", NPPIDM_SEARCH_INVERSEMARKS) - .value("SEARCH_DELETEUNMARKEDLINES", NPPIDM_SEARCH_DELETEUNMARKEDLINES) - .value("SEARCH_FINDCHARINRANGE", NPPIDM_SEARCH_FINDCHARINRANGE) - .value("SEARCH_SELECTMATCHINGBRACES", NPPIDM_SEARCH_SELECTMATCHINGBRACES) - .value("SEARCH_MARK", NPPIDM_SEARCH_MARK) - .value("FILESWITCHER_FILESCLOSE", NPPIDM_FILESWITCHER_FILESCLOSE) - .value("FILESWITCHER_FILESCLOSEOTHERS", NPPIDM_FILESWITCHER_FILESCLOSEOTHERS) - .value("VIEW_LWDEF", NPPIDM_VIEW_LWDEF) - .value("VIEW_LWALIGN", NPPIDM_VIEW_LWALIGN) - .value("VIEW_LWINDENT", NPPIDM_VIEW_LWINDENT) - .value("VIEW_SUMMARY", NPPIDM_VIEW_SUMMARY) - .value("VIEW_FILESWITCHER_PANEL", NPPIDM_VIEW_FILESWITCHER_PANEL) - .value("EXPORT_FUNC_LIST_AND_QUIT", NPPIDM_EXPORT_FUNC_LIST_AND_QUIT) - .value("VIEW_DOC_MAP", NPPIDM_VIEW_DOC_MAP) - .value("VIEW_PROJECT_PANEL_1", NPPIDM_VIEW_PROJECT_PANEL_1) - .value("VIEW_PROJECT_PANEL_2", NPPIDM_VIEW_PROJECT_PANEL_2) - .value("VIEW_PROJECT_PANEL_3", NPPIDM_VIEW_PROJECT_PANEL_3) - .value("VIEW_FUNC_LIST", NPPIDM_VIEW_FUNC_LIST) - .value("VIEW_FILEBROWSER", NPPIDM_VIEW_FILEBROWSER) - .value("VIEW_TAB1", NPPIDM_VIEW_TAB1) - .value("VIEW_TAB2", NPPIDM_VIEW_TAB2) - .value("VIEW_TAB3", NPPIDM_VIEW_TAB3) - .value("VIEW_TAB4", NPPIDM_VIEW_TAB4) - .value("VIEW_TAB5", NPPIDM_VIEW_TAB5) - .value("VIEW_TAB6", NPPIDM_VIEW_TAB6) - .value("VIEW_TAB7", NPPIDM_VIEW_TAB7) - .value("VIEW_TAB8", NPPIDM_VIEW_TAB8) - .value("VIEW_TAB9", NPPIDM_VIEW_TAB9) - .value("VIEW_TAB_NEXT", NPPIDM_VIEW_TAB_NEXT) - .value("VIEW_TAB_PREV", NPPIDM_VIEW_TAB_PREV) - .value("VIEW_MONITORING", NPPIDM_VIEW_MONITORING) - .value("VIEW_TAB_MOVEFORWARD", NPPIDM_VIEW_TAB_MOVEFORWARD) - .value("VIEW_TAB_MOVEBACKWARD", NPPIDM_VIEW_TAB_MOVEBACKWARD) - .value("VIEW_IN_FIREFOX", NPPIDM_VIEW_IN_FIREFOX) - .value("VIEW_IN_CHROME", NPPIDM_VIEW_IN_CHROME) - .value("VIEW_IN_EDGE", NPPIDM_VIEW_IN_EDGE) - .value("VIEW_IN_IE", NPPIDM_VIEW_IN_IE) .value("LANG_COFFEESCRIPT", NPPIDM_LANG_COFFEESCRIPT) .value("LANG_JSON", NPPIDM_LANG_JSON) .value("LANG_FORTRAN_77", NPPIDM_LANG_FORTRAN_77) @@ -731,7 +748,7 @@ void export_notepad() .value("LANG_FORTH", NPPIDM_LANG_FORTH) .value("LANG_LATEX", NPPIDM_LANG_LATEX) .value("LANG_MMIXAL", NPPIDM_LANG_MMIXAL) - .value("LANG_NIMROD", NPPIDM_LANG_NIMROD) + .value("LANG_NIM", NPPIDM_LANG_NIM) .value("LANG_NNCRONTAB", NPPIDM_LANG_NNCRONTAB) .value("LANG_OSCRIPT", NPPIDM_LANG_OSCRIPT) .value("LANG_REBOL", NPPIDM_LANG_REBOL) @@ -740,16 +757,50 @@ void export_notepad() .value("LANG_SPICE", NPPIDM_LANG_SPICE) .value("LANG_TXT2TAGS", NPPIDM_LANG_TXT2TAGS) .value("LANG_VISUALPROLOG", NPPIDM_LANG_VISUALPROLOG) + .value("LANG_TYPESCRIPT", NPPIDM_LANG_TYPESCRIPT) + .value("LANG_EXTERNAL", NPPIDM_LANG_EXTERNAL) + .value("LANG_EXTERNAL_LIMIT", NPPIDM_LANG_EXTERNAL_LIMIT) + .value("LANG_USER", NPPIDM_LANG_USER) + .value("LANG_USER_LIMIT", NPPIDM_LANG_USER_LIMIT) .value("LANG_USER_DLG", NPPIDM_LANG_USER_DLG) + .value("LANG_OPENUDLDIR", NPPIDM_LANG_OPENUDLDIR) + .value("LANG_UDLCOLLECTION_PROJECT_SITE", NPPIDM_LANG_UDLCOLLECTION_PROJECT_SITE) + .value("ABOUT", NPPIDM_ABOUT) + .value("HOMESWEETHOME", NPPIDM_HOMESWEETHOME) + .value("PROJECTPAGE", NPPIDM_PROJECTPAGE) + .value("ONLINEDOCUMENT", NPPIDM_ONLINEDOCUMENT) + .value("FORUM", NPPIDM_FORUM) + .value("UPDATE_NPP", NPPIDM_UPDATE_NPP) + .value("WIKIFAQ", NPPIDM_WIKIFAQ) + .value("CONFUPDATERPROXY", NPPIDM_CONFUPDATERPROXY) + .value("CMDLINEARGUMENTS", NPPIDM_CMDLINEARGUMENTS) + .value("DEBUGINFO", NPPIDM_DEBUGINFO) + .value("SETTING", NPPIDM_SETTING) + .value("SETTING_IMPORTPLUGIN", NPPIDM_SETTING_IMPORTPLUGIN) + .value("SETTING_IMPORTSTYLETHEMS", NPPIDM_SETTING_IMPORTSTYLETHEMS) + .value("SETTING_TRAYICON", NPPIDM_SETTING_TRAYICON) + .value("SETTING_SHORTCUT_MAPPER", NPPIDM_SETTING_SHORTCUT_MAPPER) + .value("SETTING_REMEMBER_LAST_SESSION", NPPIDM_SETTING_REMEMBER_LAST_SESSION) + .value("SETTING_PREFERENCE", NPPIDM_SETTING_PREFERENCE) + .value("SETTING_OPENPLUGINSDIR", NPPIDM_SETTING_OPENPLUGINSDIR) + .value("SETTING_PLUGINADM", NPPIDM_SETTING_PLUGINADM) .value("SETTING_SHORTCUT_MAPPER_MACRO", NPPIDM_SETTING_SHORTCUT_MAPPER_MACRO) .value("SETTING_SHORTCUT_MAPPER_RUN", NPPIDM_SETTING_SHORTCUT_MAPPER_RUN) .value("SETTING_EDITCONTEXTMENU", NPPIDM_SETTING_EDITCONTEXTMENU) + .value("TOOL", NPPIDM_TOOL) .value("TOOL_MD5_GENERATE", NPPIDM_TOOL_MD5_GENERATE) .value("TOOL_MD5_GENERATEFROMFILE", NPPIDM_TOOL_MD5_GENERATEFROMFILE) .value("TOOL_MD5_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_MD5_GENERATEINTOCLIPBOARD) .value("TOOL_SHA256_GENERATE", NPPIDM_TOOL_SHA256_GENERATE) .value("TOOL_SHA256_GENERATEFROMFILE", NPPIDM_TOOL_SHA256_GENERATEFROMFILE) - .value("TOOL_SHA256_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD); + .value("TOOL_SHA256_GENERATEINTOCLIPBOARD", NPPIDM_TOOL_SHA256_GENERATEINTOCLIPBOARD) + .value("EXECUTE", NPPIDM_EXECUTE) + .value("SYSTRAYPOPUP", NPPIDM_SYSTRAYPOPUP) + .value("SYSTRAYPOPUP_ACTIVATE", NPPIDM_SYSTRAYPOPUP_ACTIVATE) + .value("SYSTRAYPOPUP_NEWDOC", NPPIDM_SYSTRAYPOPUP_NEWDOC) + .value("SYSTRAYPOPUP_NEW_AND_PASTE", NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE) + .value("SYSTRAYPOPUP_OPENFILE", NPPIDM_SYSTRAYPOPUP_OPENFILE) + .value("SYSTRAYPOPUP_CLOSE", NPPIDM_SYSTRAYPOPUP_CLOSE); //lint +e1793 } diff --git a/PythonScript/src/SciLexer.h b/PythonScript/src/SciLexer.h index 0419299e..2eb7c8c3 100644 --- a/PythonScript/src/SciLexer.h +++ b/PythonScript/src/SciLexer.h @@ -142,12 +142,15 @@ #define SCLEX_CIL 127 #define SCLEX_X12 128 #define SCLEX_DATAFLEX 129 +#define SCLEX_HOLLYWOOD 130 +#define SCLEX_RAKU 131 #define SCLEX_SEARCHRESULT 150 #define SCLEX_OBJC 151 #define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 + //For All lexer #define SCE_UNIVERSAL_FOUND_STYLE 31 #define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 @@ -226,7 +229,6 @@ #define SCE_USER_STYLE_IDENTIFIER 24 #define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER #define SCE_USER_STYLE_MAPPER_TOTAL 17 -#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle #define SCE_USER_MASK_NESTING_NONE 0 #define SCE_USER_MASK_NESTING_DELIMITER1 0x1 @@ -257,6 +259,7 @@ #define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 #define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -334,7 +337,7 @@ #define SCE_SEARCHRESULT_FILE_HEADER 2 #define SCE_SEARCHRESULT_LINE_NUMBER 3 #define SCE_SEARCHRESULT_WORD2SEARCH 4 -#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 +//#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 // (no use anymore) #define SCE_SEARCHRESULT_CURRENT_LINE 6 #define SCE_OBJC_DIRECTIVE 20 #define SCE_OBJC_QUALIFIER 21 @@ -639,6 +642,7 @@ #define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_ERR_ESCSEQ 23 #define SCE_ERR_ESCSEQ_UNKNOWN 24 +#define SCE_ERR_GCC_EXCERPT 25 #define SCE_ERR_ES_BLACK 40 #define SCE_ERR_ES_RED 41 #define SCE_ERR_ES_GREEN 42 @@ -2036,6 +2040,50 @@ #define SCE_DF_SCOPEWORD 12 #define SCE_DF_OPERATOR 13 #define SCE_DF_ICODE 14 +#define SCE_HOLLYWOOD_DEFAULT 0 +#define SCE_HOLLYWOOD_COMMENT 1 +#define SCE_HOLLYWOOD_COMMENTBLOCK 2 +#define SCE_HOLLYWOOD_NUMBER 3 +#define SCE_HOLLYWOOD_KEYWORD 4 +#define SCE_HOLLYWOOD_STDAPI 5 +#define SCE_HOLLYWOOD_PLUGINAPI 6 +#define SCE_HOLLYWOOD_PLUGINMETHOD 7 +#define SCE_HOLLYWOOD_STRING 8 +#define SCE_HOLLYWOOD_STRINGBLOCK 9 +#define SCE_HOLLYWOOD_PREPROCESSOR 10 +#define SCE_HOLLYWOOD_OPERATOR 11 +#define SCE_HOLLYWOOD_IDENTIFIER 12 +#define SCE_HOLLYWOOD_CONSTANT 13 +#define SCE_HOLLYWOOD_HEXNUMBER 14 +#define SCE_RAKU_DEFAULT 0 +#define SCE_RAKU_ERROR 1 +#define SCE_RAKU_COMMENTLINE 2 +#define SCE_RAKU_COMMENTEMBED 3 +#define SCE_RAKU_POD 4 +#define SCE_RAKU_CHARACTER 5 +#define SCE_RAKU_HEREDOC_Q 6 +#define SCE_RAKU_HEREDOC_QQ 7 +#define SCE_RAKU_STRING 8 +#define SCE_RAKU_STRING_Q 9 +#define SCE_RAKU_STRING_QQ 10 +#define SCE_RAKU_STRING_Q_LANG 11 +#define SCE_RAKU_STRING_VAR 12 +#define SCE_RAKU_REGEX 13 +#define SCE_RAKU_REGEX_VAR 14 +#define SCE_RAKU_ADVERB 15 +#define SCE_RAKU_NUMBER 16 +#define SCE_RAKU_PREPROCESSOR 17 +#define SCE_RAKU_OPERATOR 18 +#define SCE_RAKU_WORD 19 +#define SCE_RAKU_FUNCTION 20 +#define SCE_RAKU_IDENTIFIER 21 +#define SCE_RAKU_TYPEDEF 22 +#define SCE_RAKU_MU 23 +#define SCE_RAKU_POSITIONAL 24 +#define SCE_RAKU_ASSOCIATIVE 25 +#define SCE_RAKU_CALLABLE 26 +#define SCE_RAKU_GRAMMAR 27 +#define SCE_RAKU_CLASS 28 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/PythonScript/src/Sci_Position.h b/PythonScript/src/Sci_Position.h index abd0f340..bad91b44 100644 --- a/PythonScript/src/Sci_Position.h +++ b/PythonScript/src/Sci_Position.h @@ -15,10 +15,12 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold +// Definitions of common types typedef size_t Sci_PositionU; + // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE -typedef long Sci_PositionCR; +typedef intptr_t Sci_PositionCR; #ifdef _WIN32 #define SCI_METHOD __stdcall diff --git a/PythonScript/src/Scintilla.h b/PythonScript/src/Scintilla.h index 4e20a190..201d49e0 100644 --- a/PythonScript/src/Scintilla.h +++ b/PythonScript/src/Scintilla.h @@ -38,6 +38,8 @@ typedef intptr_t sptr_t; typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +#ifndef SCI_DISABLE_AUTOGENERATED + /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 #define SCI_START 2000 @@ -63,6 +65,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 +#define SCI_MARKERHANDLEFROMLINE 2732 +#define SCI_MARKERNUMBERFROMLINE 2733 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 @@ -93,6 +97,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 +#define SCI_SETTABMINIMUMWIDTH 2724 +#define SCI_GETTABMINIMUMWIDTH 2725 #define SCI_CLEARTABSTOPS 2675 #define SCI_ADDTABSTOP 2676 #define SCI_GETNEXTTABSTOP 2677 @@ -102,6 +108,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 #define SCI_SETIMEINTERACTION 2679 +#define SC_ALPHA_TRANSPARENT 0 +#define SC_ALPHA_OPAQUE 255 +#define SC_ALPHA_NOALPHA 256 +#define SC_CURSORNORMAL -1 +#define SC_CURSORARROW 2 +#define SC_CURSORWAIT 4 +#define SC_CURSORREVERSEARROW 7 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -293,6 +306,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_POINTCHARACTER 19 #define INDIC_GRADIENT 20 #define INDIC_GRADIENTCENTRE 21 +#define INDIC_EXPLORERLINK 22 #define INDIC_CONTAINER 8 #define INDIC_IME 32 #define INDIC_IME_MAX 35 @@ -449,8 +463,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETSTARTVIRTUALSPACE 2728 +#define SCI_GETTARGETSTARTVIRTUALSPACE 2729 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETENDVIRTUALSPACE 2730 +#define SCI_GETTARGETENDVIRTUALSPACE 2731 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 #define SCI_TARGETFROMSELECTION 2287 @@ -668,6 +686,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 +#define SCI_BRACEMATCHNEXT 2369 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 @@ -685,6 +704,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETEDGECOLOUR 2365 #define SCI_MULTIEDGEADDLINE 2694 #define SCI_MULTIEDGECLEARALL 2695 +#define SCI_GETMULTIEDGECOLUMN 2749 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 @@ -719,10 +739,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SCI_SETMOUSEWHEELCAPTURES 2696 #define SCI_GETMOUSEWHEELCAPTURES 2697 -#define SC_CURSORNORMAL -1 -#define SC_CURSORARROW 2 -#define SC_CURSORWAIT 4 -#define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 @@ -817,18 +833,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 -#define SCI_GETCARETSTICKY 2457 -#define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 -#define SC_ALPHA_TRANSPARENT 0 -#define SC_ALPHA_OPAQUE 255 -#define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 @@ -929,7 +942,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 +#define SCI_GETSELECTIONNSTARTVIRTUALSPACE 2726 #define SCI_SETSELECTIONNEND 2586 +#define SCI_GETSELECTIONNENDVIRTUALSPACE 2727 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 @@ -993,6 +1008,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_EOLANNOTATIONSETTEXT 2740 +#define SCI_EOLANNOTATIONGETTEXT 2741 +#define SCI_EOLANNOTATIONSETSTYLE 2742 +#define SCI_EOLANNOTATIONGETSTYLE 2743 +#define SCI_EOLANNOTATIONCLEARALL 2744 +#define EOLANNOTATION_HIDDEN 0 +#define EOLANNOTATION_STANDARD 1 +#define EOLANNOTATION_BOXED 2 +#define SCI_EOLANNOTATIONSETVISIBLE 2745 +#define SCI_EOLANNOTATIONGETVISIBLE 2746 +#define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 +#define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 @@ -1030,6 +1057,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_NAMEOFSTYLE 4030 #define SCI_TAGSOFSTYLE 4031 #define SCI_DESCRIPTIONOFSTYLE 4032 +#define SCI_SETILEXER 4033 #define SC_MOD_NONE 0x0 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 @@ -1053,8 +1081,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_LEXERSTATE 0x80000 #define SC_MOD_INSERTCHECK 0x100000 #define SC_MOD_CHANGETABSTOPS 0x200000 -#define SC_MODEVENTMASKALL 0x3FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 +#define SC_MOD_CHANGEEOLANNOTATION 0x400000 +#define SC_MODEVENTMASKALL 0x7FFFFF +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1144,11 +1173,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDEXPOSITIONFROMLINE 2714 #endif +#define SCI_GETBOOSTREGEXERRMSG 5000 + #define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#endif + /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ @@ -1246,12 +1279,12 @@ struct SCNotification { }; struct SearchResultMarking { - long _start; - long _end; + intptr_t _start; + intptr_t _end; }; struct SearchResultMarkings { - long _length; + intptr_t _length; SearchResultMarking *_markings; }; diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index 261cdfb1..815e9c3f 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -151,11 +151,17 @@ fun position GetStyledText=2015(, textrange tr) fun bool CanRedo=2016(,) # Retrieve the line number at which a particular marker is located. -fun int MarkerLineFromHandle=2017(int markerHandle,) +fun line MarkerLineFromHandle=2017(int markerHandle,) # Delete a marker. fun void MarkerDeleteHandle=2018(int markerHandle,) +# Retrieve marker handles of a line +fun int MarkerHandleFromLine=2732(line line, int which) + +# Retrieve marker number of a marker handle +fun int MarkerNumberFromLine=2733(line line, int which) + # Is undo history being collected? get bool GetUndoCollection=2019(,) @@ -252,6 +258,12 @@ set void SetTabWidth=2036(int tabWidth,) # Retrieve the visible size of a tab. get int GetTabWidth=2121(,) +# Set the minimum visual width of a tab. +set void SetTabMinimumWidth=2724(int pixels,) + +# Get the minimum visual width of a tab. +get int GetTabMinimumWidth=2725(,) + # Clear explicit tabstops on a line. fun void ClearTabStops=2675(line line,) @@ -276,9 +288,24 @@ val SC_IME_INLINE=1 # Is the IME displayed in a window or inline? get IMEInteraction GetIMEInteraction=2678(,) -# Choose to display the the IME in a window or inline. +# Choose to display the IME in a window or inline. set void SetIMEInteraction=2679(IMEInteraction imeInteraction,) +enu Alpha=SC_ALPHA_ +val SC_ALPHA_TRANSPARENT=0 +val SC_ALPHA_OPAQUE=255 +val SC_ALPHA_NOALPHA=256 + +ali SC_ALPHA_NOALPHA=NO_ALPHA + +enu CursorShape=SC_CURSOR +val SC_CURSORNORMAL=-1 +val SC_CURSORARROW=2 +val SC_CURSORWAIT=4 +val SC_CURSORREVERSEARROW=7 + +ali SC_CURSORREVERSEARROW=REVERSE_ARROW + enu MarkerSymbol=SC_MARK_ val MARKER_MAX=31 val SC_MARK_CIRCLE=0 @@ -376,7 +403,7 @@ set void MarkerSetBack=2042(int markerNumber, colour back) # Set the background colour used for a particular marker number when its folding block is selected. set void MarkerSetBackSelected=2292(int markerNumber, colour back) -# Enable/disable highlight for current folding bloc (smallest one that contains the caret) +# Enable/disable highlight for current folding block (smallest one that contains the caret) fun void MarkerEnableHighlight=2293(bool enabled,) # Add a marker to a line, returning an ID which can be used to find or delete the marker. @@ -1202,6 +1229,12 @@ set void SetTargetStart=2190(position start,) # Get the position that starts the target. get position GetTargetStart=2191(,) +# Sets the virtual space of the target start +set void SetTargetStartVirtualSpace=2728(position space,) + +# Get the virtual space of the target start +get position GetTargetStartVirtualSpace=2729(,) + # Sets the position that ends the target which is used for updating the # document without affecting the scroll position. set void SetTargetEnd=2192(position end,) @@ -1209,6 +1242,12 @@ set void SetTargetEnd=2192(position end,) # Get the position that ends the target. get position GetTargetEnd=2193(,) +# Sets the virtual space of the target end +set void SetTargetEndVirtualSpace=2730(position space,) + +# Get the virtual space of the target end +get position GetTargetEndVirtualSpace=2731(,) + # Sets both the start and end of the target in one call. fun void SetTargetRange=2686(position start, position end) @@ -1261,7 +1300,7 @@ fun position CallTipPosStart=2203(,) set void CallTipSetPosStart=2214(position posStart,) # Highlight a segment of the definition. -fun void CallTipSetHlt=2204(int highlightStart, int highlightEnd) +fun void CallTipSetHlt=2204(position highlightStart, position highlightEnd) # Set the background colour for the call tip. set void CallTipSetBack=2205(colour back,) @@ -1837,6 +1876,9 @@ fun void BraceBadLightIndicator=2499(bool useSetting, int indicator) # The maxReStyle must be 0 for now. It may be defined in a future release. fun position BraceMatch=2353(position pos, int maxReStyle) +# Similar to BraceMatch, but matching starts at the explicit start position. +fun position BraceMatchNext=2369(position pos, position startPos) + # Are the end of line characters visible? get bool GetViewEOL=2355(,) @@ -1886,6 +1928,9 @@ fun void MultiEdgeAddLine=2694(position column, colour edgeColour) # Clear all vertical edges. fun void MultiEdgeClearAll=2695(,) +# Get multi edge positions. +get position GetMultiEdgeColumn=2749(int which,) + # Sets the current caret position to be the search anchor. fun void SearchAnchor=2366(,) @@ -1973,14 +2018,6 @@ set void SetMouseWheelCaptures=2696(bool captures,) # Get whether mouse wheel can be active outside the window. get bool GetMouseWheelCaptures=2697(,) -enu CursorShape=SC_CURSOR -val SC_CURSORNORMAL=-1 -val SC_CURSORARROW=2 -val SC_CURSORWAIT=4 -val SC_CURSORREVERSEARROW=7 - -ali SC_CURSORREVERSEARROW=REVERSE_ARROW - # Sets the cursor to one of the SC_CURSOR* values. set void SetCursor=2386(CursorShape cursorType,) # Get cursor type. @@ -2007,6 +2044,7 @@ fun void WordPartRightExtend=2393(,) enu VisiblePolicy=VISIBLE_ val VISIBLE_SLOP=0x01 val VISIBLE_STRICT=0x04 + # Set the way the display area is determined when a particular line # is to be moved to by Find, FindNext, GotoLine, etc. fun void SetVisiblePolicy=2394(VisiblePolicy visiblePolicy, int visibleSlop) @@ -2093,10 +2131,13 @@ get bool GetHotspotSingleLine=2497(,) # Move caret down one paragraph (delimited by empty lines). fun void ParaDown=2413(,) + # Extend selection down one paragraph (delimited by empty lines). fun void ParaDownExtend=2414(,) + # Move caret up one paragraph (delimited by empty lines). fun void ParaUp=2415(,) + # Extend selection up one paragraph (delimited by empty lines). fun void ParaUpExtend=2416(,) @@ -2283,12 +2324,6 @@ fun position EncodedFromUTF8=2449(string utf8, stringresult encoded) # multi-byte characters. If beyond end of line, return line end position. fun position FindColumn=2456(line line, position column) -# Can the caret preferred x position only be changed by explicit movement commands? -get CaretSticky GetCaretSticky=2457(,) - -# Stop the caret preferred x position changing when the user types. -set void SetCaretSticky=2458(CaretSticky useCaretStickyBehaviour,) - enu CaretSticky=SC_CARETSTICKY_ val SC_CARETSTICKY_OFF=0 val SC_CARETSTICKY_ON=1 @@ -2296,6 +2331,12 @@ val SC_CARETSTICKY_WHITESPACE=2 ali SC_CARETSTICKY_WHITESPACE=WHITE_SPACE +# Can the caret preferred x position only be changed by explicit movement commands? +get CaretSticky GetCaretSticky=2457(,) + +# Stop the caret preferred x position changing when the user types. +set void SetCaretSticky=2458(CaretSticky useCaretStickyBehaviour,) + # Switch between sticky and non-sticky: meant to be bound to a key. fun void ToggleCaretSticky=2459(,) @@ -2308,13 +2349,6 @@ get bool GetPasteConvertEndings=2468(,) # Duplicate the selection. If selection empty duplicate the line containing the caret. fun void SelectionDuplicate=2469(,) -enu Alpha=SC_ALPHA_ -val SC_ALPHA_TRANSPARENT=0 -val SC_ALPHA_OPAQUE=255 -val SC_ALPHA_NOALPHA=256 - -ali SC_ALPHA_NOALPHA=NO_ALPHA - # Set background alpha of the caret line. set void SetCaretLineBackAlpha=2470(Alpha alpha,) @@ -2361,10 +2395,10 @@ fun int IndicatorAllOnFor=2506(position pos,) fun int IndicatorValueAt=2507(int indicator, position pos) # Where does a particular indicator start? -fun int IndicatorStart=2508(int indicator, position pos) +fun position IndicatorStart=2508(int indicator, position pos) # Where does a particular indicator end? -fun int IndicatorEnd=2509(int indicator, position pos) +fun position IndicatorEnd=2509(int indicator, position pos) # Set number of entries in position cache set void SetPositionCache=2514(int size,) @@ -2572,18 +2606,25 @@ get int GetMainSelection=2575(,) # Set the caret position of the nth selection. set void SetSelectionNCaret=2576(int selection, position caret) + # Return the caret position of the nth selection. get position GetSelectionNCaret=2577(int selection,) + # Set the anchor position of the nth selection. set void SetSelectionNAnchor=2578(int selection, position anchor) + # Return the anchor position of the nth selection. get position GetSelectionNAnchor=2579(int selection,) + # Set the virtual space of the caret of the nth selection. set void SetSelectionNCaretVirtualSpace=2580(int selection, position space) + # Return the virtual space of the caret of the nth selection. get position GetSelectionNCaretVirtualSpace=2581(int selection,) + # Set the virtual space of the anchor of the nth selection. set void SetSelectionNAnchorVirtualSpace=2582(int selection, position space) + # Return the virtual space of the anchor of the nth selection. get position GetSelectionNAnchorVirtualSpace=2583(int selection,) @@ -2593,26 +2634,39 @@ set void SetSelectionNStart=2584(int selection, position anchor) # Returns the position at the start of the selection. get position GetSelectionNStart=2585(int selection,) +# Returns the virtual space at the start of the selection. +get position GetSelectionNStartVirtualSpace=2726(int selection,) + # Sets the position that ends the selection - this becomes the currentPosition. set void SetSelectionNEnd=2586(int selection, position caret) +# Returns the virtual space at the end of the selection. +get position GetSelectionNEndVirtualSpace=2727(int selection,) + # Returns the position at the end of the selection. get position GetSelectionNEnd=2587(int selection,) # Set the caret position of the rectangular selection. set void SetRectangularSelectionCaret=2588(position caret,) + # Return the caret position of the rectangular selection. get position GetRectangularSelectionCaret=2589(,) + # Set the anchor position of the rectangular selection. set void SetRectangularSelectionAnchor=2590(position anchor,) + # Return the anchor position of the rectangular selection. get position GetRectangularSelectionAnchor=2591(,) + # Set the virtual space of the caret of the rectangular selection. set void SetRectangularSelectionCaretVirtualSpace=2592(position space,) + # Return the virtual space of the caret of the rectangular selection. get position GetRectangularSelectionCaretVirtualSpace=2593(,) + # Set the virtual space of the anchor of the rectangular selection. set void SetRectangularSelectionAnchorVirtualSpace=2594(position space,) + # Return the virtual space of the anchor of the rectangular selection. get position GetRectangularSelectionAnchorVirtualSpace=2595(,) @@ -2628,6 +2682,7 @@ ali SCVS_NOWRAPLINESTART=NO_WRAP_LINE_START # Set options for virtual space behaviour. set void SetVirtualSpaceOptions=2596(VirtualSpace virtualSpaceOptions,) + # Return options for virtual space behaviour. get VirtualSpace GetVirtualSpaceOptions=2597(,) @@ -2788,6 +2843,38 @@ get int GetRepresentation=2666(string encodedCharacter, stringresult representat # Remove a character representation. fun void ClearRepresentation=2667(string encodedCharacter,) +# Set the end of line annotation text for a line +set void EOLAnnotationSetText=2740(line line, string text) + +# Get the end of line annotation text for a line +get int EOLAnnotationGetText=2741(line line, stringresult text) + +# Set the style number for the end of line annotations for a line +set void EOLAnnotationSetStyle=2742(line line, int style) + +# Get the style number for the end of line annotations for a line +get int EOLAnnotationGetStyle=2743(line line,) + +# Clear the end of annotations from all lines +fun void EOLAnnotationClearAll=2744(,) + +enu EOLAnnotationVisible=EOLANNOTATION_ +val EOLANNOTATION_HIDDEN=0 +val EOLANNOTATION_STANDARD=1 +val EOLANNOTATION_BOXED=2 + +# Set the visibility for the end of line annotations for a view +set void EOLAnnotationSetVisible=2745(EOLAnnotationVisible visible,) + +# Get the visibility for the end of line annotations for a view +get EOLAnnotationVisible EOLAnnotationGetVisible=2746(,) + +# Get the start of the range of style numbers used for end of line annotations +set void EOLAnnotationSetStyleOffset=2747(int style,) + +# Get the start of the range of style numbers used for end of line annotations +get int EOLAnnotationGetStyleOffset=2748(,) + # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) @@ -2907,6 +2994,9 @@ fun int TagsOfStyle=4031(int style, stringresult tags) # Result is NUL-terminated. fun int DescriptionOfStyle=4032(int style, stringresult description) +# Set the lexer from an ILexer*. +set void SetILexer=4033(, pointer ilexer) + # Notifications # Type of modification and the action which caused the modification. # These are defined as a bit mask to make it easy to specify which notifications are wanted. @@ -2935,7 +3025,8 @@ val SC_MOD_CONTAINER=0x40000 val SC_MOD_LEXERSTATE=0x80000 val SC_MOD_INSERTCHECK=0x100000 val SC_MOD_CHANGETABSTOPS=0x200000 -val SC_MODEVENTMASKALL=0x3FFFFF +val SC_MOD_CHANGEEOLANNOTATION=0x400000 +val SC_MODEVENTMASKALL=0x7FFFFF ali SC_MOD_INSERTTEXT=INSERT_TEXT ali SC_MOD_DELETETEXT=DELETE_TEXT @@ -2955,6 +3046,7 @@ ali SC_MOD_CHANGEANNOTATION=CHANGE_ANNOTATION ali SC_MOD_LEXERSTATE=LEXER_STATE ali SC_MOD_INSERTCHECK=INSERT_CHECK ali SC_MOD_CHANGETABSTOPS=CHANGE_TAB_STOPS +ali SC_MOD_CHANGEEOLANNOTATION=CHANGE_E_O_L_ANNOTATION ali SC_MODEVENTMASKALL=EVENT_MASK_ALL enu Update=SC_UPDATE_ @@ -3157,6 +3249,8 @@ val SCLEX_NIM=126 val SCLEX_CIL=127 val SCLEX_X12=128 val SCLEX_DATAFLEX=129 +val SCLEX_HOLLYWOOD=130 +val SCLEX_RAKU=131 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -3583,6 +3677,7 @@ val SCE_ERR_VALUE=21 val SCE_ERR_GCC_INCLUDED_FROM=22 val SCE_ERR_ESCSEQ=23 val SCE_ERR_ESCSEQ_UNKNOWN=24 +val SCE_ERR_GCC_EXCERPT=25 val SCE_ERR_ES_BLACK=40 val SCE_ERR_ES_RED=41 val SCE_ERR_ES_GREEN=42 @@ -5110,7 +5205,7 @@ val SCE_SAS_MACRO_KEYWORD=12 val SCE_SAS_BLOCK_KEYWORD=13 val SCE_SAS_MACRO_FUNCTION=14 val SCE_SAS_STATEMENT=15 -# Lexical states for SCLEX_NIM +# Lexical states for SCLEX_NIM lex Nim=SCLEX_NIM SCE_NIM_ val SCE_NIM_DEFAULT=0 val SCE_NIM_COMMENT=1 @@ -5170,6 +5265,54 @@ val SCE_DF_STRINGEOL=11 val SCE_DF_SCOPEWORD=12 val SCE_DF_OPERATOR=13 val SCE_DF_ICODE=14 +# Lexical states for SCLEX_HOLLYWOOD +lex Hollywood=SCLEX_HOLLYWOOD SCE_HOLLYWOOD_ +val SCE_HOLLYWOOD_DEFAULT=0 +val SCE_HOLLYWOOD_COMMENT=1 +val SCE_HOLLYWOOD_COMMENTBLOCK=2 +val SCE_HOLLYWOOD_NUMBER=3 +val SCE_HOLLYWOOD_KEYWORD=4 +val SCE_HOLLYWOOD_STDAPI=5 +val SCE_HOLLYWOOD_PLUGINAPI=6 +val SCE_HOLLYWOOD_PLUGINMETHOD=7 +val SCE_HOLLYWOOD_STRING=8 +val SCE_HOLLYWOOD_STRINGBLOCK=9 +val SCE_HOLLYWOOD_PREPROCESSOR=10 +val SCE_HOLLYWOOD_OPERATOR=11 +val SCE_HOLLYWOOD_IDENTIFIER=12 +val SCE_HOLLYWOOD_CONSTANT=13 +val SCE_HOLLYWOOD_HEXNUMBER=14 +# Lexical states for SCLEX_RAKU +lex Raku=SCLEX_RAKU SCE_RAKU_ +val SCE_RAKU_DEFAULT=0 +val SCE_RAKU_ERROR=1 +val SCE_RAKU_COMMENTLINE=2 +val SCE_RAKU_COMMENTEMBED=3 +val SCE_RAKU_POD=4 +val SCE_RAKU_CHARACTER=5 +val SCE_RAKU_HEREDOC_Q=6 +val SCE_RAKU_HEREDOC_QQ=7 +val SCE_RAKU_STRING=8 +val SCE_RAKU_STRING_Q=9 +val SCE_RAKU_STRING_QQ=10 +val SCE_RAKU_STRING_Q_LANG=11 +val SCE_RAKU_STRING_VAR=12 +val SCE_RAKU_REGEX=13 +val SCE_RAKU_REGEX_VAR=14 +val SCE_RAKU_ADVERB=15 +val SCE_RAKU_NUMBER=16 +val SCE_RAKU_PREPROCESSOR=17 +val SCE_RAKU_OPERATOR=18 +val SCE_RAKU_WORD=19 +val SCE_RAKU_FUNCTION=20 +val SCE_RAKU_IDENTIFIER=21 +val SCE_RAKU_TYPEDEF=22 +val SCE_RAKU_MU=23 +val SCE_RAKU_POSITIONAL=24 +val SCE_RAKU_ASSOCIATIVE=25 +val SCE_RAKU_CALLABLE=26 +val SCE_RAKU_GRAMMAR=27 +val SCE_RAKU_CLASS=28 # Events diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index 20fec5fc..f8b8a350 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -29,8 +29,8 @@ BOOST_PYTHON_MODULE(Npp) boost::python::class_, boost::noncopyable >("Editor", boost::python::no_init) .def("write", &ScintillaWrapper::AddText, "Add text to the document at current position (alias for addText).") - .def("callbackSync", &ScintillaWrapper::addSyncCallback, "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])") - .def("callback", &ScintillaWrapper::addAsyncCallback, "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])") + .def("callbackSync", &ScintillaWrapper::addSyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to a Python function when a Scintilla event occurs. See also callback() to register an asynchronous callback. Callbacks are called synchronously with the event, so try not to perform too much work in the event handler.\nCertain operations cannot be performed in a synchronous callback. setDocPointer, searchInTarget or findText calls are examples. Scintilla doesn't allow recursively modifying the text, so you can't modify the text in a SCINTILLANOTIFICATION.MODIFIED callback - use a standard Asynchronous callback to do this.\ne.g. editor.callbackSync(my_function, [SCINTILLANOTIFICATION.CHARADDED])") + .def("callback", &ScintillaWrapper::addAsyncCallback, boost::python::args("callable", "listOfNotifications"), "Registers a callback to call a Python function synchronously when a Scintilla event occurs. Events are queued up, and run in the order they arrive, one after the other, but asynchronously with the main GUI. See editor.callbackSync() to register a synchronous callback. e.g. editor.callback(my_function, [SCINTILLANOTIFICATION.CHARADDED])") .def("__getitem__", &ScintillaWrapper::GetLine, "Gets a line from the given (zero based) index") .def("__len__", &ScintillaWrapper::GetLength, "Gets the length (number of bytes) in the document") .def("forEachLine", &ScintillaWrapper::forEachLine, "Runs the function passed for each line in the current document. The function gets passed 3 arguments, the contents of the line, the line number (starting from zero), and the total number of lines. If the function returns a number, that number is added to the current line number for the next iteration.\nThat way, if you delete the current line, you should return 0, so as to stay on the current physical line.\n\nUnder normal circumstances, you do not need to return anything from the function (i.e. None)\n(Helper function)") @@ -41,9 +41,9 @@ BOOST_PYTHON_MODULE(Npp) .def("getUserLineSelection", &ScintillaWrapper::getUserLineSelection, "Gets the start and end (zero indexed) line numbers of the user selection, or the whole document if nothing is selected. (Helper function)") .def("getUserCharSelection", &ScintillaWrapper::getUserCharSelection, "Gets the start and end (zero indexed) byte numbers of the user selection, or the whole document if nothing is selected. (Helper function)") .def("clearCallbacks", &ScintillaWrapper::clearAllCallbacks, "Clears all callbacks") - .def("clearCallbacks", &ScintillaWrapper::clearCallbackFunction, "Clears all callbacks for a given function") - .def("clearCallbacks", &ScintillaWrapper::clearCallbackEvents, "Clears all callbacks for the given list of events") - .def("clearCallbacks", &ScintillaWrapper::clearCallback, "Clears the callback for the given callback function for the list of events") + .def("clearCallbacks", &ScintillaWrapper::clearCallbackFunction, boost::python::args("callable"), "Clears all callbacks for a given function") + .def("clearCallbacks", &ScintillaWrapper::clearCallbackEvents, boost::python::args("notificationList"), "Clears all callbacks for the given list of events") + .def("clearCallbacks", &ScintillaWrapper::clearCallback, boost::python::args("callable", "notificationList"), "Clears the callback for the given callback function for the list of events") .def("flash", &ScintillaWrapper::flash, "Flash the editor by reversing the foreground and background colours briefly") .def("flash", &ScintillaWrapper::flashMilliseconds, boost::python::args("milliseconds"), "Flash the editor by reversing the foreground and background colours briefly") .add_static_property("WHOLEDOC", &ScintillaWrapper::getWholeDocFlag) @@ -89,8 +89,6 @@ BOOST_PYTHON_MODULE(Npp) " def myIncrement(m):\n" " return int(m.group(1)) + 1\n\n" "And call rereplace('([0-9]+)', myIncrement) and it will increment all the integers.") - .def("pyreplace", boost::python::raw_function(&deprecated_replace_function), "Deprecated in this version of PythonScript for Notepad++. Use the new rereplace() instead") - .def("pymlreplace", boost::python::raw_function(&deprecated_replace_function), "Deprecated in this version of PythonScript for Notepad++. Use the new rereplace() instead") .def("getWord", &ScintillaWrapper::getWord, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") .def("getWord", &ScintillaWrapper::getWordNoFlags, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") .def("getWord", &ScintillaWrapper::getCurrentWord, "getWord([position[, useOnlyWordChars]])\nGets the word at position. If position is not given or None, the current caret position is used.\nuseOnlyWordChars is a bool that is passed to Scintilla - see Scintilla rules on what is match. If not given or None, it is assumed to be true.") @@ -131,6 +129,8 @@ BOOST_PYTHON_MODULE(Npp) .def("canRedo", &ScintillaWrapper::CanRedo, "Are there any redoable actions in the undo history?") .def("markerLineFromHandle", &ScintillaWrapper::MarkerLineFromHandle, boost::python::args("markerHandle"), "Retrieve the line number at which a particular marker is located.") .def("markerDeleteHandle", &ScintillaWrapper::MarkerDeleteHandle, boost::python::args("markerHandle"), "Delete a marker.") + .def("markerHandleFromLine", &ScintillaWrapper::MarkerHandleFromLine, boost::python::args("line", "which"), "Retrieve marker handles of a line") + .def("markerNumberFromLine", &ScintillaWrapper::MarkerNumberFromLine, boost::python::args("line", "which"), "Retrieve marker number of a marker handle") .def("getUndoCollection", &ScintillaWrapper::GetUndoCollection, "Is undo history being collected?") .def("getViewWS", &ScintillaWrapper::GetViewWS, "Are white space characters currently visible?\nReturns one of SCWS_* constants.") .def("setViewWS", &ScintillaWrapper::SetViewWS, boost::python::args("viewWS"), "Make white space characters invisible, always visible or visible outside indentation.") @@ -152,17 +152,19 @@ BOOST_PYTHON_MODULE(Npp) .def("setBufferedDraw", &ScintillaWrapper::SetBufferedDraw, boost::python::args("buffered"), "If drawing is buffered then each line of text is drawn into a bitmap buffer\nbefore drawing it to the screen to avoid flicker.") .def("setTabWidth", &ScintillaWrapper::SetTabWidth, boost::python::args("tabWidth"), "Change the visible size of a tab to be a multiple of the width of a space character.") .def("getTabWidth", &ScintillaWrapper::GetTabWidth, "Retrieve the visible size of a tab.") + .def("setTabMinimumWidth", &ScintillaWrapper::SetTabMinimumWidth, boost::python::args("pixels"), "Set the minimum visual width of a tab.") + .def("getTabMinimumWidth", &ScintillaWrapper::GetTabMinimumWidth, "Get the minimum visual width of a tab.") .def("clearTabStops", &ScintillaWrapper::ClearTabStops, boost::python::args("line"), "Clear explicit tabstops on a line.") .def("addTabStop", &ScintillaWrapper::AddTabStop, boost::python::args("line", "x"), "Add an explicit tab stop for a line.") .def("getNextTabStop", &ScintillaWrapper::GetNextTabStop, boost::python::args("line", "x"), "Find the next explicit tab stop position on a line after a position.") .def("setCodePage", &ScintillaWrapper::SetCodePage, boost::python::args("codePage"), "Set the code page used to interpret the bytes of the document as characters.\nThe SC_CP_UTF8 value can be used to enter Unicode mode.") .def("getIMEInteraction", &ScintillaWrapper::GetIMEInteraction, "Is the IME displayed in a window or inline?") - .def("setIMEInteraction", &ScintillaWrapper::SetIMEInteraction, boost::python::args("imeInteraction"), "Choose to display the the IME in a window or inline.") + .def("setIMEInteraction", &ScintillaWrapper::SetIMEInteraction, boost::python::args("imeInteraction"), "Choose to display the IME in a window or inline.") .def("markerDefine", &ScintillaWrapper::MarkerDefine, boost::python::args("markerNumber", "markerSymbol"), "Set the symbol used for a particular marker number.") .def("markerSetFore", &ScintillaWrapper::MarkerSetFore, boost::python::args("markerNumber", "fore"), "Set the foreground colour used for a particular marker number.") .def("markerSetBack", &ScintillaWrapper::MarkerSetBack, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number.") .def("markerSetBackSelected", &ScintillaWrapper::MarkerSetBackSelected, boost::python::args("markerNumber", "back"), "Set the background colour used for a particular marker number when its folding block is selected.") - .def("markerEnableHighlight", &ScintillaWrapper::MarkerEnableHighlight, boost::python::args("enabled"), "Enable/disable highlight for current folding bloc (smallest one that contains the caret)") + .def("markerEnableHighlight", &ScintillaWrapper::MarkerEnableHighlight, boost::python::args("enabled"), "Enable/disable highlight for current folding block (smallest one that contains the caret)") .def("markerAdd", &ScintillaWrapper::MarkerAdd, boost::python::args("line", "markerNumber"), "Add a marker to a line, returning an ID which can be used to find or delete the marker.") .def("markerDelete", &ScintillaWrapper::MarkerDelete, boost::python::args("line", "markerNumber"), "Delete a marker from a line.") .def("markerDeleteAll", &ScintillaWrapper::MarkerDeleteAll, boost::python::args("markerNumber"), "Delete all markers with a particular number from all lines.") @@ -363,8 +365,12 @@ BOOST_PYTHON_MODULE(Npp) .def("getCaretWidth", &ScintillaWrapper::GetCaretWidth, "Returns the width of the insert mode caret.") .def("setTargetStart", &ScintillaWrapper::SetTargetStart, boost::python::args("start"), "Sets the position that starts the target which is used for updating the\ndocument without affecting the scroll position.") .def("getTargetStart", &ScintillaWrapper::GetTargetStart, "Get the position that starts the target.") + .def("setTargetStartVirtualSpace", &ScintillaWrapper::SetTargetStartVirtualSpace, boost::python::args("space"), "Sets the virtual space of the target start") + .def("getTargetStartVirtualSpace", &ScintillaWrapper::GetTargetStartVirtualSpace, "Get the virtual space of the target start") .def("setTargetEnd", &ScintillaWrapper::SetTargetEnd, boost::python::args("end"), "Sets the position that ends the target which is used for updating the\ndocument without affecting the scroll position.") .def("getTargetEnd", &ScintillaWrapper::GetTargetEnd, "Get the position that ends the target.") + .def("setTargetEndVirtualSpace", &ScintillaWrapper::SetTargetEndVirtualSpace, boost::python::args("space"), "Sets the virtual space of the target end") + .def("getTargetEndVirtualSpace", &ScintillaWrapper::GetTargetEndVirtualSpace, "Get the virtual space of the target end") .def("setTargetRange", &ScintillaWrapper::SetTargetRange, boost::python::args("start", "end"), "Sets both the start and end of the target in one call.") .def("getTargetText", &ScintillaWrapper::GetTargetText, "Retrieve the text in the target.") .def("targetFromSelection", &ScintillaWrapper::TargetFromSelection, "Make the target range start and end be the same as the selection range start and end.") @@ -527,6 +533,7 @@ BOOST_PYTHON_MODULE(Npp) .def("braceBadLight", &ScintillaWrapper::BraceBadLight, boost::python::args("pos"), "Highlight the character at a position indicating there is no matching brace.") .def("braceBadLightIndicator", &ScintillaWrapper::BraceBadLightIndicator, boost::python::args("useSetting", "indicator"), "Use specified indicator to highlight non matching brace instead of changing its style.") .def("braceMatch", &ScintillaWrapper::BraceMatch, boost::python::args("pos", "maxReStyle"), "Find the position of a matching brace or INVALID_POSITION if no match.\nThe maxReStyle must be 0 for now. It may be defined in a future release.") + .def("braceMatchNext", &ScintillaWrapper::BraceMatchNext, boost::python::args("pos", "startPos"), "Similar to BraceMatch, but matching starts at the explicit start position.") .def("getViewEOL", &ScintillaWrapper::GetViewEOL, "Are the end of line characters visible?") .def("setViewEOL", &ScintillaWrapper::SetViewEOL, boost::python::args("visible"), "Make the end of line characters visible or invisible.") .def("getDocPointer", &ScintillaWrapper::GetDocPointer, "Retrieve a pointer to the document object.") @@ -540,6 +547,7 @@ BOOST_PYTHON_MODULE(Npp) .def("setEdgeColour", &ScintillaWrapper::SetEdgeColour, boost::python::args("edgeColour"), "Change the colour used in edge indication.") .def("multiEdgeAddLine", &ScintillaWrapper::MultiEdgeAddLine, boost::python::args("column", "edgeColour"), "Add a new vertical edge to the view.") .def("multiEdgeClearAll", &ScintillaWrapper::MultiEdgeClearAll, "Clear all vertical edges.") + .def("getMultiEdgeColumn", &ScintillaWrapper::GetMultiEdgeColumn, boost::python::args("which"), "Get multi edge positions.") .def("searchAnchor", &ScintillaWrapper::SearchAnchor, "Sets the current caret position to be the search anchor.") .def("searchNext", &ScintillaWrapper::SearchNext, boost::python::args("searchFlags", "text"), "Find some text starting at the search anchor.\nDoes not ensure the selection is visible.") .def("searchPrev", &ScintillaWrapper::SearchPrev, boost::python::args("searchFlags", "text"), "Find some text starting at the search anchor and moving backwards.\nDoes not ensure the selection is visible.") @@ -731,7 +739,9 @@ BOOST_PYTHON_MODULE(Npp) .def("getSelectionNAnchorVirtualSpace", &ScintillaWrapper::GetSelectionNAnchorVirtualSpace, boost::python::args("selection"), "Return the virtual space of the anchor of the nth selection.") .def("setSelectionNStart", &ScintillaWrapper::SetSelectionNStart, boost::python::args("selection", "anchor"), "Sets the position that starts the selection - this becomes the anchor.") .def("getSelectionNStart", &ScintillaWrapper::GetSelectionNStart, boost::python::args("selection"), "Returns the position at the start of the selection.") + .def("getSelectionNStartVirtualSpace", &ScintillaWrapper::GetSelectionNStartVirtualSpace, boost::python::args("selection"), "Returns the virtual space at the start of the selection.") .def("setSelectionNEnd", &ScintillaWrapper::SetSelectionNEnd, boost::python::args("selection", "caret"), "Sets the position that ends the selection - this becomes the currentPosition.") + .def("getSelectionNEndVirtualSpace", &ScintillaWrapper::GetSelectionNEndVirtualSpace, boost::python::args("selection"), "Returns the virtual space at the end of the selection.") .def("getSelectionNEnd", &ScintillaWrapper::GetSelectionNEnd, boost::python::args("selection"), "Returns the position at the end of the selection.") .def("setRectangularSelectionCaret", &ScintillaWrapper::SetRectangularSelectionCaret, boost::python::args("caret"), "Set the caret position of the rectangular selection.") .def("getRectangularSelectionCaret", &ScintillaWrapper::GetRectangularSelectionCaret, "Return the caret position of the rectangular selection.") @@ -785,6 +795,15 @@ BOOST_PYTHON_MODULE(Npp) .def("setRepresentation", &ScintillaWrapper::SetRepresentation, boost::python::args("encodedCharacter", "representation"), "Set the way a character is drawn.") .def("getRepresentation", &ScintillaWrapper::GetRepresentation, boost::python::args("encodedCharacter"), "Set the way a character is drawn.\nResult is NUL-terminated.") .def("clearRepresentation", &ScintillaWrapper::ClearRepresentation, boost::python::args("encodedCharacter"), "Remove a character representation.") + .def("eOLAnnotationSetText", &ScintillaWrapper::EOLAnnotationSetText, boost::python::args("line", "text"), "Set the end of line annotation text for a line") + .def("eOLAnnotationGetText", &ScintillaWrapper::EOLAnnotationGetText, boost::python::args("line"), "Get the end of line annotation text for a line") + .def("eOLAnnotationSetStyle", &ScintillaWrapper::EOLAnnotationSetStyle, boost::python::args("line", "style"), "Set the style number for the end of line annotations for a line") + .def("eOLAnnotationGetStyle", &ScintillaWrapper::EOLAnnotationGetStyle, boost::python::args("line"), "Get the style number for the end of line annotations for a line") + .def("eOLAnnotationClearAll", &ScintillaWrapper::EOLAnnotationClearAll, "Clear the end of annotations from all lines") + .def("eOLAnnotationSetVisible", &ScintillaWrapper::EOLAnnotationSetVisible, boost::python::args("visible"), "Set the visibility for the end of line annotations for a view") + .def("eOLAnnotationGetVisible", &ScintillaWrapper::EOLAnnotationGetVisible, "Get the visibility for the end of line annotations for a view") + .def("eOLAnnotationSetStyleOffset", &ScintillaWrapper::EOLAnnotationSetStyleOffset, boost::python::args("style"), "Get the start of the range of style numbers used for end of line annotations") + .def("eOLAnnotationGetStyleOffset", &ScintillaWrapper::EOLAnnotationGetStyleOffset, "Get the start of the range of style numbers used for end of line annotations") .def("startRecord", &ScintillaWrapper::StartRecord, "Start notifying the container of all key presses and commands.") .def("stopRecord", &ScintillaWrapper::StopRecord, "Stop notifying the container of all key presses and commands.") .def("setLexer", &ScintillaWrapper::SetLexer, boost::python::args("lexer"), "Set the lexing language of the document.") @@ -817,6 +836,7 @@ BOOST_PYTHON_MODULE(Npp) .def("nameOfStyle", &ScintillaWrapper::NameOfStyle, boost::python::args("style"), "Retrieve the name of a style.\nResult is NUL-terminated.") .def("tagsOfStyle", &ScintillaWrapper::TagsOfStyle, boost::python::args("style"), "Retrieve a ' ' separated list of style tags like \"literal quoted string\".\nResult is NUL-terminated.") .def("descriptionOfStyle", &ScintillaWrapper::DescriptionOfStyle, boost::python::args("style"), "Retrieve a description of a style.\nResult is NUL-terminated.") + .def("setILexer", &ScintillaWrapper::SetILexer, boost::python::args("ilexer"), "Set the lexer from an ILexer*.") .def("getBidirectional", &ScintillaWrapper::GetBidirectional, "Retrieve bidirectional text display state.") .def("setBidirectional", &ScintillaWrapper::SetBidirectional, boost::python::args("bidirectional"), "Set bidirectional text display state.") .def("getLineCharacterIndex", &ScintillaWrapper::GetLineCharacterIndex, "Retrieve line character index state.") diff --git a/PythonScript/src/ScintillaWrapper.cpp b/PythonScript/src/ScintillaWrapper.cpp index a240e582..d860ce14 100644 --- a/PythonScript/src/ScintillaWrapper.cpp +++ b/PythonScript/src/ScintillaWrapper.cpp @@ -340,20 +340,20 @@ void ScintillaWrapper::runCallbacks(std::shared_ptr args) DEBUG_TRACE(L"Finished consuming scintilla callbacks\n"); } -bool ScintillaWrapper::addSyncCallback(PyObject* callback, boost::python::list events) +bool ScintillaWrapper::addSyncCallback(boost::python::object callback, boost::python::list events) { return addCallbackImpl(callback, events, false); } -bool ScintillaWrapper::addAsyncCallback(PyObject* callback, boost::python::list events) +bool ScintillaWrapper::addAsyncCallback(boost::python::object callback, boost::python::list events) { return addCallbackImpl(callback, events, true); } -bool ScintillaWrapper::addCallbackImpl(PyObject* callback, boost::python::list events, bool isAsync) +bool ScintillaWrapper::addCallbackImpl(boost::python::object callback, boost::python::list events, bool isAsync) { - if (PyCallable_Check(callback)) + if (PyCallable_Check(callback.ptr())) { { @@ -362,9 +362,9 @@ bool ScintillaWrapper::addCallbackImpl(PyObject* callback, boost::python::list e size_t eventCount = _len(events); for(idx_t i = 0; i < eventCount; ++i) { - Py_INCREF(callback); + Py_INCREF(callback.ptr()); m_callbacks.insert(std::pair >(boost::python::extract(events[i]), - boost::shared_ptr(new ScintillaCallback(boost::python::object(boost::python::handle<>(callback)), isAsync)))); + boost::shared_ptr(new ScintillaCallback(callback, isAsync)))); } m_notificationsEnabled = true; } @@ -377,12 +377,12 @@ bool ScintillaWrapper::addCallbackImpl(PyObject* callback, boost::python::list e } } -void ScintillaWrapper::clearCallbackFunction(PyObject* callback) +void ScintillaWrapper::clearCallbackFunction(boost::python::object callback) { NppPythonScript::MutexHolder hold(m_callbackMutex); for(callbackT::iterator it = m_callbacks.begin(); it != m_callbacks.end();) { - if (callback == it->second->getCallback().ptr()) + if (callback == it->second->getCallback()) { it = m_callbacks.erase(it); } @@ -421,13 +421,13 @@ void ScintillaWrapper::clearCallbackEvents(boost::python::list events) } -void ScintillaWrapper::clearCallback(PyObject* callback, boost::python::list events) +void ScintillaWrapper::clearCallback(boost::python::object callback, boost::python::list events) { NppPythonScript::MutexHolder hold(m_callbackMutex); for(callbackT::iterator it = m_callbacks.begin(); it != m_callbacks.end(); ) { - if(it->second->getCallback().ptr() == callback && boost::python::extract(events.contains(it->first))) + if(it->second->getCallback() == callback && boost::python::extract(events.contains(it->first))) { it = m_callbacks.erase(it); } @@ -653,7 +653,7 @@ const char *ScintillaWrapper::getCurrentAnsiCodePageName() } } -std::string ScintillaWrapper::extractEncodedString(boost::python::object str, int toCodePage) +std::string ScintillaWrapper::extractEncodedString(boost::python::object str, intptr_t toCodePage) { std::string resultStr; int searchLength; @@ -842,7 +842,7 @@ void ScintillaWrapper::replaceImpl(boost::python::object searchStr, boost::pytho BeginUndoAction(); - CommunicationInfo commInfo; + CommunicationInfo commInfo{}; commInfo.internalMsg = PYSCR_RUNREPLACE; commInfo.srcModuleName = _T("PythonScript.dll"); TCHAR pluginName[] = _T("PythonScript.dll"); @@ -969,509 +969,6 @@ void ScintillaWrapper::searchImpl(boost::python::object searchStr, } -/* -void ScintillaWrapper::replace(boost::python::object searchStr, boost::python::object replaceStr, boost::python::object flags) -{ - int start = 0; - int end = GetLength(); - int iFlags = 0; - - - if (!flags.is_none()) - { - iFlags |= boost::python::extract(flags); - } - - - const char *replaceChars = boost::python::extract(replaceStr.attr("__str__")()); - - size_t replaceLength = strlen(replaceChars); - - Sci_TextToFind src; - - src.lpstrText = const_cast((const char *)boost::python::extract(searchStr.attr("__str__")())); - int originalEventMask = callScintilla(SCI_GETMODEVENTMASK); - callScintilla(SCI_SETMODEVENTMASK, 0); - BeginUndoAction(); - int result = 0; - std::wstringstream debug; - while(result != -1) - { - src.chrg.cpMin = start; - src.chrg.cpMax = end; - debug.str(std::wstring()); - debug << L"Searching "; - debug << start << L" " << end; - - - OutputDebugString(debug.str().c_str()); - result = callScintilla(SCI_FINDTEXT, iFlags, reinterpret_cast(&src)); - - // If nothing found, then just finish - if (-1 == result) - { - OutputDebugString(L"Got -1, no more matches"); - break; - } - else - { - // Replace the location found with the replacement text - SetTargetStart(src.chrgText.cpMin); - SetTargetEnd(src.chrgText.cpMax); - debug.str(std::wstring()); - debug << L"Got result "; - debug << src.chrgText.cpMin << L" " << src.chrgText.cpMax; - OutputDebugString(debug.str().c_str()); - callScintilla(SCI_REPLACETARGET, replaceLength, reinterpret_cast(replaceChars)); - start = src.chrgText.cpMin + (int)replaceLength; - end = end + ((int)replaceLength - (src.chrgText.cpMax - src.chrgText.cpMin)); - } - - } - callScintilla(SCI_SETMODEVENTMASK, originalEventMask); - EndUndoAction(); -} - -void ScintillaWrapper::rereplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object flags) -{ - int start = 0; - int end = GetLength(); - int iFlags = SCFIND_REGEXP | SCFIND_POSIX; - if (!flags.is_none()) - { - iFlags |= boost::python::extract(flags); - } - - const char *replaceChars = boost::python::extract(replaceStr.attr("__str__")()); - - size_t replaceLength = strlen(replaceChars); - - Sci_TextToFind src; - - src.lpstrText = const_cast((const char *)boost::python::extract(searchExp.attr("__str__")())); - - BeginUndoAction(); - int result = 0; - while(result != -1) - { - src.chrg.cpMin = start; - src.chrg.cpMax = end; - result = callScintilla(SCI_FINDTEXT, iFlags, reinterpret_cast(&src)); - - // If nothing found, then just finish - if (-1 == result) - { - break; - } - else - { - // Replace the location found with the replacement text - SetTargetStart(src.chrgText.cpMin); - SetTargetEnd(src.chrgText.cpMax); - int replacementLength = callScintilla(SCI_REPLACETARGETRE, replaceLength, reinterpret_cast(replaceChars)); - start = src.chrgText.cpMin + replacementLength; - end = end + ((int)replaceLength - (src.chrgText.cpMax - src.chrgText.cpMin)); - } - - } - - EndUndoAction(); -} - - - -void ScintillaWrapper::pymlreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition) -{ - boost::python::str contents; - offset_t currentOffset = 0; - - if (startPosition.is_none() && endPosition.is_none()) - { - contents = GetCharacterPointer(); - } - - else - { - Sci_TextRange range; - if (!startPosition.is_none()) - { - range.chrg.cpMin = boost::python::extract(startPosition); - } - else - { - range.chrg.cpMin = 0; - } - - if (!endPosition.is_none()) - { - range.chrg.cpMax = boost::python::extract(endPosition); - } - else - { - range.chrg.cpMax = GetLength(); - } - - currentOffset = (offset_t)range.chrg.cpMin; - - range.lpstrText = new char[size_t((range.chrg.cpMax - range.chrg.cpMin) + 1)]; - callScintilla(SCI_GETTEXTRANGE, 0, reinterpret_cast(&range)); - contents = boost::python::str(const_cast(range.lpstrText)); - delete[] range.lpstrText; - } - - - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - - int iFlags = 0; - int iCount = 0; - if (!flags.is_none()) - { - iFlags = boost::python::extract(flags); - } - if (!count.is_none()) - { - iCount = boost::python::extract(count); - } - - if (0 == iCount) - iCount = -1; - - - - boost::python::object re = re_module.attr("compile")(searchExp, iFlags | boost::python::extract(re_module.attr("MULTILINE"))); - if (!re_module.is_none()) - { - boost::python::object match; - BeginUndoAction(); - boost::python::object oreplacement; - size_t replacementLength; - idx_t matchStart, matchEnd; - idx_t startPos = 0; - - - do - { - match = re.attr("search")(contents, startPos); - if (!match.is_none()) - { - // Get expanded replacement string - oreplacement = match.attr("expand")(replaceStr); - - - // Calculate offsets - matchStart = (idx_t)boost::python::extract(match.attr("start")()); - matchEnd = (idx_t)boost::python::extract(match.attr("end")()); - - - // Extract text replacement - const char *replacement = boost::python::extract(oreplacement); - replacementLength = _len(oreplacement); - - // Replace text in Scintilla - callScintilla(SCI_SETTARGETSTART, static_cast(matchStart) + currentOffset); - callScintilla(SCI_SETTARGETEND, static_cast(matchEnd) + currentOffset); - callScintilla(SCI_REPLACETARGET, replacementLength, reinterpret_cast(replacement)); - - - // Calculate the difference between the old string, - // and the new replacement, and add it to the currentOffset - currentOffset += static_cast(replacementLength - (matchEnd - matchStart)); - - - // Set startPos to the end of the last match - startPos is with the original document - startPos = matchEnd; - - - } - } while(!match.is_none() && (iCount == -1 || --iCount > 0)); - - EndUndoAction(); - } - -} - - - -void ScintillaWrapper::pyreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine, boost::python::object endLine) -{ - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - if (!re_module.is_none()) - { - BeginUndoAction(); - const char *strCount = boost::python::extract(count.attr("__str__")()); - int iCount; - int iFlags = 0; - - if (!flags.is_none()) - { - iFlags = boost::python::extract(flags); - } - - int start = 0; - if (!startLine.is_none()) - { - start = boost::python::extract(startLine); - } - - int end = -1; - if (!startLine.is_none()) - { - end = boost::python::extract(endLine); - } - - iCount = atoi(strCount); - bool ignoreCount = (iCount == 0); - bool includeLineEndings = (iFlags & RE_INCLUDELINEENDINGS) == RE_INCLUDELINEENDINGS; - - long lineCount = GetLineCount(); - boost::python::object re = re_module.attr("compile")(searchExp, flags); - - size_t bufferLength = 0; - Sci_TextRange range; - range.chrg.cpMin = 0; - range.lpstrText = NULL; - boost::python::tuple result; - idx_t currentStartPosition; - int infiniteLoopCheck = 0; - int previousLine = -1; - for(int line = start; line < lineCount && (ignoreCount || iCount > 0) && (-1 == end || line <= end); ++line) - { - if (line == previousLine) - { - if (++infiniteLoopCheck >= 1000) - { - EndUndoAction(); - PyErr_SetString(PyExc_SystemError, "Infinite loop detected in pyreplace"); - if (range.lpstrText) - { - delete[] range.lpstrText; - } - - throw boost::python::error_already_set(); - } - } - previousLine = line; - - if (includeLineEndings) - { - result = boost::python::extract(re.attr("subn")(replaceStr, GetLine(line), ignoreCount ? 0 : iCount)); - } - else - { - range.chrg.cpMin = PositionFromLine(line); - range.chrg.cpMax = GetLineEndPosition(line); - - if (bufferLength < (size_t)((range.chrg.cpMax - range.chrg.cpMin) + 1)) - { - if (range.lpstrText) - delete [] range.lpstrText; - bufferLength = (size_t)((range.chrg.cpMax - range.chrg.cpMin) + 1); - range.lpstrText = new char[bufferLength + 1]; - } - - callScintilla(SCI_GETTEXTRANGE, 0, reinterpret_cast(&range)); - - result = boost::python::extract(re.attr("subn")(replaceStr, const_cast(range.lpstrText), ignoreCount ? 0 : iCount)); - } - - int numSubs = boost::python::extract(result[1]); - if (numSubs != 0) - { - size_t resultLength = _len(result[0]); - if (includeLineEndings) - { - currentStartPosition = (idx_t)PositionFromLine(line); - replaceWholeLine(line, result[0]); - } - else - { - currentStartPosition = (idx_t)range.chrg.cpMin; - replaceLine(line, result[0]); - } - - int newLine = LineFromPosition((int)(currentStartPosition + resultLength)); - - // If the line number has moved on more than one - // there must have been one or more new lines in the - // replacement, or no newline, hence the lines have become less - if ((newLine - line) != (includeLineEndings ? 1 : 0)) - { - line = newLine - (includeLineEndings ? 1 : 0); - lineCount = GetLineCount(); - } - iCount -= numSubs; - } - } - - if (range.lpstrText) - delete[] range.lpstrText; - EndUndoAction(); - } - -} - - - -void ScintillaWrapper::pysearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine, boost::python::object endLine) -{ - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - if (!re_module.is_none()) - { - - int start = 0; - if (!startLine.is_none()) - { - start = boost::python::extract(startLine); - } - - int end; - int lineCount = GetLineCount(); - bool endFixed = false; - - if (!endLine.is_none()) - { - endFixed = true; - end = boost::python::extract(endLine); - } - else - { - - end = lineCount - 1; - } - - boost::python::object re = re_module.attr("compile")(searchExp, flags); - bool called; - boost::python::object match; - - for(int line = start; line <= end && line < lineCount; ++line) - { - int pos = 0; - - called = false; - do - { - - match = re.attr("search")(GetLine(line), pos); - - // If nothing found, then continue to next line - if (!match.is_none()) - { - - boost::python::object result = callback(line, match); - - // If return value was false, then stop the search - if (!result.is_none() && !boost::python::extract(result)) - { - return; - } - pos = boost::python::extract(match.attr("end")()); - called = true; - } - - } while (!match.is_none()); - - // If we called the user function, update the lineCount - // (...Who knows what they've done!) :) - if (called) - { - lineCount = GetLineCount(); - if (!endFixed) - end = lineCount - 1; - } - } // end line loop - - } // end re_module check - - -} - - - - -void ScintillaWrapper::pymlsearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition) -{ - - boost::python::object re_module( (boost::python::handle<>(PyImport_ImportModule("re"))) ); - if (!re_module.is_none()) - { - boost::python::str contents; - - contents = GetText(); - - int iFlags = 0; - if (!flags.is_none()) - { - iFlags = boost::python::extract(flags); - } - - iFlags |= boost::python::extract(re_module.attr("MULTILINE")); - - boost::python::object re = re_module.attr("compile")(searchExp, iFlags); - boost::python::object match; - - int pos = 0; - if (!startPosition.is_none()) - { - pos = boost::python::extract(startPosition); - } - - int endPos = 0; - - if (!endPosition.is_none()) - { - endPos = boost::python::extract(endPosition); - } - - bool endPosFixed = true; - - if (endPos == 0) - { - endPos = GetLength(); - endPosFixed = false; - } - - - - int line; - do - { - match = re.attr("search")(contents, pos, endPos); - - // If nothing found, then skip - if (!match.is_none()) - { - pos = boost::python::extract(match.attr("start")()); - line = LineFromPosition(pos); - boost::python::object result = callback(line, match); - - // If return value was false, then stop the search - if (!result.is_none() && !boost::python::extract(result)) - { - return; - } - - if (!endPosFixed) - { - endPos = GetLength(); - } - - pos = boost::python::extract(match.attr("end")()); - } - - } while (!match.is_none()); - - } // end re_module check - - -} - - -*/ - - boost::python::str ScintillaWrapper::getWord(boost::python::object position, boost::python::object useOnlyWordChars /* = true */) { intptr_t pos; @@ -1496,7 +993,7 @@ boost::python::str ScintillaWrapper::getWord(boost::python::object position, boo intptr_t startPos = callScintilla(SCI_WORDSTARTPOSITION, pos, wordChars); intptr_t endPos = callScintilla(SCI_WORDENDPOSITION, pos, wordChars); - Sci_TextRange tr; + Sci_TextRange tr{}; tr.chrg.cpMin = startPos; tr.chrg.cpMax = endPos; tr.lpstrText = new char[size_t((endPos - startPos) + 1)]; @@ -1519,7 +1016,8 @@ void ScintillaWrapper::notAllowedInCallback(const char *message) void ScintillaWrapper::swapColours() { - int foreground, background; + intptr_t foreground = 0; + intptr_t background = 0; SendMessage(m_handle, WM_SETREDRAW, FALSE, 0); for(int i = 255; i >= 0; --i) { diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index 822c6e1a..ba6735a4 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -59,14 +59,14 @@ class ScintillaWrapper : public PyProducerConsumer void invalidateHandle() { m_handle = NULL; }; void notify(SCNotification *notifyCode); - bool addSyncCallback(PyObject* callback, boost::python::list events); - bool addAsyncCallback(PyObject *callback, boost::python::list events); - bool addCallbackImpl(PyObject *callback, boost::python::list events, bool isAsync); + bool addSyncCallback(boost::python::object callback, boost::python::list events); + bool addAsyncCallback(boost::python::object callback, boost::python::list events); + bool addCallbackImpl(boost::python::object callback, boost::python::list events, bool isAsync); void clearAllCallbacks(); - void clearCallbackFunction(PyObject* callback); + void clearCallbackFunction(boost::python::object callback); void clearCallbackEvents(boost::python::list events); - void clearCallback(PyObject* callback, boost::python::list events); + void clearCallback(boost::python::object callback, boost::python::list events); /* Helper functions * These functions are designed to make life easier for scripting, @@ -115,46 +115,6 @@ class ScintillaWrapper : public PyProducerConsumer void searchPlainImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, int flags, int startPosition, int endPosition); void searchImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, python_re_flags flags, int startPosition, int endPosition); - //static const int RE_INCLUDELINEENDINGS = 65536; - /* - void pyreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine, boost::python::object endLine); - void pyreplaceNoFlagsNoCount(boost::python::object searchExp, boost::python::object replaceStr) - { pyreplace(searchExp, replaceStr, boost::python::object(0), boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pyreplaceNoFlags(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count) - { pyreplace(searchExp, replaceStr, count, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pyreplaceNoStartEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags) - { pyreplace(searchExp, replaceStr, count, flags, boost::python::object(), boost::python::object()); }; - void pyreplaceNoEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine) - { pyreplace(searchExp, replaceStr, count, flags, startLine, boost::python::object()); }; - - - void pymlreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition); - void pymlreplaceNoFlagsNoCount(boost::python::object searchExp, boost::python::object replaceStr) - { pymlreplace(searchExp, replaceStr, boost::python::object(0), boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pymlreplaceNoFlags(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count) - { pymlreplace(searchExp, replaceStr, count, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pymlreplaceNoStartEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags) - { pymlreplace(searchExp, replaceStr, count, flags, boost::python::object(), boost::python::object()); }; - void pymlreplaceNoEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition) - { pymlreplace(searchExp, replaceStr, count, flags, startPosition, boost::python::object()); }; - - void pysearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine, boost::python::object endLine); - void pysearchNoFlags(boost::python::object searchExp, boost::python::object callback) - { pysearch(searchExp, callback, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pysearchNoStartEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags) - { pysearch(searchExp, callback, flags, boost::python::object(), boost::python::object()); }; - void pysearchNoEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine) - { pysearch(searchExp, callback, flags, startLine, boost::python::object()); }; - - void pymlsearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition); - void pymlsearchNoFlags(boost::python::object searchExp, boost::python::object callback) - { pymlsearch(searchExp, callback, boost::python::object(0), boost::python::object(), boost::python::object()); }; - void pymlsearchNoStartEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags) - { pymlsearch(searchExp, callback, flags, boost::python::object(), boost::python::object()); }; - void pymlsearchNoEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition) - { pymlsearch(searchExp, callback, flags, startPosition, boost::python::object()); }; - */ - boost::python::str getWord(boost::python::object position, boost::python::object useOnlyWordChars); boost::python::str getWordNoFlags(boost::python::object position) { return getWord(position, boost::python::object(true)); }; @@ -183,7 +143,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Insert string at a position. */ - void InsertText(intptr_t pos, boost::python::object text); + void InsertText(Sci_Position pos, boost::python::object text); /** Change the text that is being inserted in response to SC_MOD_INSERTCHECK */ @@ -195,7 +155,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Delete a range of text in the document. */ - void DeleteRange(intptr_t start, intptr_t lengthDelete); + void DeleteRange(Sci_Position start, Sci_Position lengthDelete); /** Set all style bytes to 0, remove all folding information. */ @@ -207,7 +167,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Returns the character byte at the position. */ - intptr_t GetCharAt(intptr_t pos); + intptr_t GetCharAt(Sci_Position pos); /** Returns the position of the caret. */ @@ -219,7 +179,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Returns the style byte at the position. */ - intptr_t GetStyleAt(intptr_t pos); + intptr_t GetStyleAt(Sci_Position pos); /** Redoes the next action on the undo history. */ @@ -242,7 +202,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve a buffer of cells. * Returns the number of bytes in the buffer not including terminating NULs. */ - boost::python::tuple GetStyledText(int start, int end); + boost::python::tuple GetStyledText(Sci_PositionCR start, Sci_PositionCR end); /** Are there any redoable actions in the undo history? */ @@ -256,6 +216,14 @@ class ScintillaWrapper : public PyProducerConsumer */ void MarkerDeleteHandle(int markerHandle); + /** Retrieve marker handles of a line + */ + intptr_t MarkerHandleFromLine(intptr_t line, int which); + + /** Retrieve marker number of a marker handle + */ + intptr_t MarkerNumberFromLine(intptr_t line, int which); + /** Is undo history being collected? */ bool GetUndoCollection(); @@ -293,12 +261,12 @@ class ScintillaWrapper : public PyProducerConsumer /** Set caret to a position and ensure it is visible. */ - void GotoPos(intptr_t caret); + void GotoPos(Sci_Position caret); /** Set the selection anchor to a position. The anchor is the opposite * end of the selection from the caret. */ - void SetAnchor(intptr_t anchor); + void SetAnchor(Sci_Position anchor); /** Retrieve the text of the line containing the caret. * Returns the index of the caret on the line. @@ -325,12 +293,12 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the current styling position to start. * The unused parameter is no longer used and should be set to 0. */ - void StartStyling(intptr_t start, int unused); + void StartStyling(Sci_Position start, int unused); /** Change style from current styling position for length characters to a style * and move the current styling position to after this newly styled segment. */ - void SetStyling(intptr_t length, int style); + void SetStyling(Sci_Position length, int style); /** Is drawing done first into a buffer or direct to the screen? */ @@ -349,6 +317,14 @@ class ScintillaWrapper : public PyProducerConsumer */ intptr_t GetTabWidth(); + /** Set the minimum visual width of a tab. + */ + void SetTabMinimumWidth(int pixels); + + /** Get the minimum visual width of a tab. + */ + intptr_t GetTabMinimumWidth(); + /** Clear explicit tabstops on a line. */ void ClearTabStops(intptr_t line); @@ -370,7 +346,7 @@ class ScintillaWrapper : public PyProducerConsumer */ int GetIMEInteraction(); - /** Choose to display the the IME in a window or inline. + /** Choose to display the IME in a window or inline. */ void SetIMEInteraction(int imeInteraction); @@ -390,7 +366,7 @@ class ScintillaWrapper : public PyProducerConsumer */ void MarkerSetBackSelected(int markerNumber, boost::python::tuple back); - /** Enable/disable highlight for current folding bloc (smallest one that contains the caret) + /** Enable/disable highlight for current folding block (smallest one that contains the caret) */ void MarkerEnableHighlight(bool enabled); @@ -804,7 +780,7 @@ class ScintillaWrapper : public PyProducerConsumer * The lengthEntered parameter indicates how many characters before * the caret should be used to provide context. */ - void AutoCShow(intptr_t lengthEntered, boost::python::object itemList); + void AutoCShow(Sci_Position lengthEntered, boost::python::object itemList); /** Remove the auto-completion list from the screen. */ @@ -957,15 +933,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve the column number of a position, taking tab width into account. */ - intptr_t GetColumn(intptr_t pos); + intptr_t GetColumn(Sci_Position pos); /** Count characters between two positions. */ - intptr_t CountCharacters(intptr_t start, intptr_t end); + intptr_t CountCharacters(Sci_Position start, Sci_Position end); /** Count code units between two positions. */ - intptr_t CountCodeUnits(intptr_t start, intptr_t end); + intptr_t CountCodeUnits(Sci_Position start, Sci_Position end); /** Show or hide the horizontal scroll bar. */ @@ -986,7 +962,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the highlighted indentation guide column. * 0 = no highlighted guide. */ - void SetHighlightGuide(intptr_t column); + void SetHighlightGuide(Sci_Position column); /** Get the highlighted indentation guide column. */ @@ -1010,11 +986,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position of the caret. */ - void SetCurrentPos(intptr_t caret); + void SetCurrentPos(Sci_Position caret); /** Sets the position that starts the selection - this becomes the anchor. */ - void SetSelectionStart(intptr_t anchor); + void SetSelectionStart(Sci_Position anchor); /** Returns the position at the start of the selection. */ @@ -1022,7 +998,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position that ends the selection - this becomes the caret. */ - void SetSelectionEnd(intptr_t caret); + void SetSelectionEnd(Sci_Position caret); /** Returns the position at the end of the selection. */ @@ -1030,7 +1006,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set caret to a position, while removing any existing selection. */ - void SetEmptySelection(intptr_t caret); + void SetEmptySelection(Sci_Position caret); /** Sets the print magnification added to the point size of each style for printing. */ @@ -1050,7 +1026,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Find some text in the document. */ - boost::python::object FindText(int searchFlags, int start, int end, boost::python::object ft); + boost::python::object FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft); /** Retrieve the display line at the top of the display. */ @@ -1087,7 +1063,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Select a range of text. */ - void SetSel(intptr_t anchor, intptr_t caret); + void SetSel(Sci_Position anchor, Sci_Position caret); /** Retrieve the selected text. * Return the length of the text. @@ -1098,7 +1074,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve a range of text. * Return the length of the text. */ - boost::python::str GetTextRange(int start, int end); + boost::python::str GetTextRange(Sci_PositionCR start, Sci_PositionCR end); /** Draw the selection either highlighted or in normal (non-highlighted) style. */ @@ -1106,15 +1082,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve the x value of the point in the window where a position is displayed. */ - intptr_t PointXFromPosition(intptr_t pos); + intptr_t PointXFromPosition(Sci_Position pos); /** Retrieve the y value of the point in the window where a position is displayed. */ - intptr_t PointYFromPosition(intptr_t pos); + intptr_t PointYFromPosition(Sci_Position pos); /** Retrieve the line containing a position. */ - intptr_t LineFromPosition(intptr_t pos); + intptr_t LineFromPosition(Sci_Position pos); /** Retrieve the position at the start of a line. */ @@ -1122,7 +1098,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Scroll horizontally and vertically. */ - void LineScroll(intptr_t columns, intptr_t lines); + void LineScroll(Sci_Position columns, intptr_t lines); /** Ensure the caret is visible. */ @@ -1132,7 +1108,7 @@ class ScintillaWrapper : public PyProducerConsumer * priority to the primary position then the secondary position. * This may be used to make a search match visible. */ - void ScrollRange(intptr_t secondary, intptr_t primary); + void ScrollRange(Sci_Position secondary, Sci_Position primary); /** Replace the selected text with the argument text. */ @@ -1220,24 +1196,40 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position that starts the target which is used for updating the * document without affecting the scroll position. */ - void SetTargetStart(intptr_t start); + void SetTargetStart(Sci_Position start); /** Get the position that starts the target. */ intptr_t GetTargetStart(); + /** Sets the virtual space of the target start + */ + void SetTargetStartVirtualSpace(Sci_Position space); + + /** Get the virtual space of the target start + */ + intptr_t GetTargetStartVirtualSpace(); + /** Sets the position that ends the target which is used for updating the * document without affecting the scroll position. */ - void SetTargetEnd(intptr_t end); + void SetTargetEnd(Sci_Position end); /** Get the position that ends the target. */ intptr_t GetTargetEnd(); + /** Sets the virtual space of the target end + */ + void SetTargetEndVirtualSpace(Sci_Position space); + + /** Get the virtual space of the target end + */ + intptr_t GetTargetEndVirtualSpace(); + /** Sets both the start and end of the target in one call. */ - void SetTargetRange(intptr_t start, intptr_t end); + void SetTargetRange(Sci_Position start, Sci_Position end); /** Retrieve the text in the target. */ @@ -1282,7 +1274,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Show a call tip containing a definition near position pos. */ - void CallTipShow(intptr_t pos, boost::python::object definition); + void CallTipShow(Sci_Position pos, boost::python::object definition); /** Remove the call tip from the screen. */ @@ -1298,11 +1290,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the start position in order to change when backspacing removes the calltip. */ - void CallTipSetPosStart(intptr_t posStart); + void CallTipSetPosStart(Sci_Position posStart); /** Highlight a segment of the definition. */ - void CallTipSetHlt(int highlightStart, int highlightEnd); + void CallTipSetHlt(Sci_Position highlightStart, Sci_Position highlightEnd); /** Set the background colour for the call tip. */ @@ -1465,15 +1457,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Get position of start of word. */ - intptr_t WordStartPosition(intptr_t pos, bool onlyWordCharacters); + intptr_t WordStartPosition(Sci_Position pos, bool onlyWordCharacters); /** Get position of end of word. */ - intptr_t WordEndPosition(intptr_t pos, bool onlyWordCharacters); + intptr_t WordEndPosition(Sci_Position pos, bool onlyWordCharacters); /** Is the range start..end considered a word? */ - bool IsRangeWord(intptr_t start, intptr_t end); + bool IsRangeWord(Sci_Position start, Sci_Position end); /** Sets limits to idle styling. */ @@ -1898,7 +1890,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Highlight the characters at two positions. */ - void BraceHighlight(intptr_t posA, intptr_t posB); + void BraceHighlight(Sci_Position posA, Sci_Position posB); /** Use specified indicator to highlight matching braces instead of changing their style. */ @@ -1906,7 +1898,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Highlight the character at a position indicating there is no matching brace. */ - void BraceBadLight(intptr_t pos); + void BraceBadLight(Sci_Position pos); /** Use specified indicator to highlight non matching brace instead of changing its style. */ @@ -1915,7 +1907,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Find the position of a matching brace or INVALID_POSITION if no match. * The maxReStyle must be 0 for now. It may be defined in a future release. */ - intptr_t BraceMatch(intptr_t pos, int maxReStyle); + intptr_t BraceMatch(Sci_Position pos, int maxReStyle); + + /** Similar to BraceMatch, but matching starts at the explicit start position. + */ + intptr_t BraceMatchNext(Sci_Position pos, Sci_Position startPos); /** Are the end of line characters visible? */ @@ -1944,7 +1940,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the column number of the edge. * If text goes past the edge then it is highlighted. */ - void SetEdgeColumn(intptr_t column); + void SetEdgeColumn(Sci_Position column); /** Retrieve the edge highlight mode. */ @@ -1965,12 +1961,16 @@ class ScintillaWrapper : public PyProducerConsumer /** Add a new vertical edge to the view. */ - void MultiEdgeAddLine(intptr_t column, boost::python::tuple edgeColour); + void MultiEdgeAddLine(Sci_Position column, boost::python::tuple edgeColour); /** Clear all vertical edges. */ void MultiEdgeClearAll(); + /** Get multi edge positions. + */ + intptr_t GetMultiEdgeColumn(int which); + /** Sets the current caret position to be the search anchor. */ void SearchAnchor(); @@ -2010,7 +2010,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Create a new document object. * Starts with reference count of 1 and not selected into editor. */ - intptr_t CreateDocument(intptr_t bytes, int documentOptions); + intptr_t CreateDocument(Sci_Position bytes, int documentOptions); /** Extend life of document. */ @@ -2201,27 +2201,27 @@ class ScintillaWrapper : public PyProducerConsumer /** Given a valid document position, return the previous position taking code * page into account. Returns 0 if passed 0. */ - intptr_t PositionBefore(intptr_t pos); + intptr_t PositionBefore(Sci_Position pos); /** Given a valid document position, return the next position taking code * page into account. Maximum value returned is the last position in the document. */ - intptr_t PositionAfter(intptr_t pos); + intptr_t PositionAfter(Sci_Position pos); /** Given a valid document position, return a position that differs in a number * of characters. Returned value is always between 0 and last position in document. */ - intptr_t PositionRelative(intptr_t pos, intptr_t relative); + intptr_t PositionRelative(Sci_Position pos, Sci_Position relative); /** Given a valid document position, return a position that differs in a number * of UTF-16 code units. Returned value is always between 0 and last position in document. * The result may point half way (2 bytes) inside a non-BMP character. */ - intptr_t PositionRelativeCodeUnits(intptr_t pos, intptr_t relative); + intptr_t PositionRelativeCodeUnits(Sci_Position pos, Sci_Position relative); /** Copy a range of text to the clipboard. Positions are clipped into the document. */ - void CopyRange(intptr_t start, intptr_t end); + void CopyRange(Sci_Position start, Sci_Position end); /** Copy argument text to the clipboard. */ @@ -2376,7 +2376,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Enlarge the document to a particular size of text bytes. */ - void Allocate(intptr_t bytes); + void Allocate(Sci_Position bytes); /** Returns the target converted to UTF8. * Return the length in bytes. @@ -2386,7 +2386,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the length of the utf8 argument for calling EncodedFromUTF8. * Set to -1 and the string will be measured to the first nul. */ - void SetLengthForEncode(intptr_t bytes); + void SetLengthForEncode(Sci_Position bytes); /** Translates a UTF8 string into the document encoding. * Return the length of the result in bytes. @@ -2397,7 +2397,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Find the position of a column on a line taking into account tabs and * multi-byte characters. If beyond end of line, return line end position. */ - intptr_t FindColumn(intptr_t line, intptr_t column); + intptr_t FindColumn(intptr_t line, Sci_Position column); /** Can the caret preferred x position only be changed by explicit movement commands? */ @@ -2457,27 +2457,27 @@ class ScintillaWrapper : public PyProducerConsumer /** Turn a indicator on over a range. */ - void IndicatorFillRange(intptr_t start, intptr_t lengthFill); + void IndicatorFillRange(Sci_Position start, Sci_Position lengthFill); /** Turn a indicator off over a range. */ - void IndicatorClearRange(intptr_t start, intptr_t lengthClear); + void IndicatorClearRange(Sci_Position start, Sci_Position lengthClear); /** Are any indicators present at pos? */ - intptr_t IndicatorAllOnFor(intptr_t pos); + intptr_t IndicatorAllOnFor(Sci_Position pos); /** What value does a particular indicator have at a position? */ - intptr_t IndicatorValueAt(int indicator, intptr_t pos); + intptr_t IndicatorValueAt(int indicator, Sci_Position pos); /** Where does a particular indicator start? */ - intptr_t IndicatorStart(int indicator, intptr_t pos); + intptr_t IndicatorStart(int indicator, Sci_Position pos); /** Where does a particular indicator end? */ - intptr_t IndicatorEnd(int indicator, intptr_t pos); + intptr_t IndicatorEnd(int indicator, Sci_Position pos); /** Set number of entries in position cache */ @@ -2710,11 +2710,11 @@ class ScintillaWrapper : public PyProducerConsumer /** Set a simple selection */ - void SetSelection(intptr_t caret, intptr_t anchor); + void SetSelection(Sci_Position caret, Sci_Position anchor); /** Add a selection */ - void AddSelection(intptr_t caret, intptr_t anchor); + void AddSelection(Sci_Position caret, Sci_Position anchor); /** Drop one selection */ @@ -2730,7 +2730,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the caret position of the nth selection. */ - void SetSelectionNCaret(int selection, intptr_t caret); + void SetSelectionNCaret(int selection, Sci_Position caret); /** Return the caret position of the nth selection. */ @@ -2738,7 +2738,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the anchor position of the nth selection. */ - void SetSelectionNAnchor(int selection, intptr_t anchor); + void SetSelectionNAnchor(int selection, Sci_Position anchor); /** Return the anchor position of the nth selection. */ @@ -2746,7 +2746,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the caret of the nth selection. */ - void SetSelectionNCaretVirtualSpace(int selection, intptr_t space); + void SetSelectionNCaretVirtualSpace(int selection, Sci_Position space); /** Return the virtual space of the caret of the nth selection. */ @@ -2754,7 +2754,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the anchor of the nth selection. */ - void SetSelectionNAnchorVirtualSpace(int selection, intptr_t space); + void SetSelectionNAnchorVirtualSpace(int selection, Sci_Position space); /** Return the virtual space of the anchor of the nth selection. */ @@ -2762,15 +2762,23 @@ class ScintillaWrapper : public PyProducerConsumer /** Sets the position that starts the selection - this becomes the anchor. */ - void SetSelectionNStart(int selection, intptr_t anchor); + void SetSelectionNStart(int selection, Sci_Position anchor); /** Returns the position at the start of the selection. */ intptr_t GetSelectionNStart(int selection); + /** Returns the virtual space at the start of the selection. + */ + intptr_t GetSelectionNStartVirtualSpace(int selection); + /** Sets the position that ends the selection - this becomes the currentPosition. */ - void SetSelectionNEnd(int selection, intptr_t caret); + void SetSelectionNEnd(int selection, Sci_Position caret); + + /** Returns the virtual space at the end of the selection. + */ + intptr_t GetSelectionNEndVirtualSpace(int selection); /** Returns the position at the end of the selection. */ @@ -2778,7 +2786,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the caret position of the rectangular selection. */ - void SetRectangularSelectionCaret(intptr_t caret); + void SetRectangularSelectionCaret(Sci_Position caret); /** Return the caret position of the rectangular selection. */ @@ -2786,7 +2794,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the anchor position of the rectangular selection. */ - void SetRectangularSelectionAnchor(intptr_t anchor); + void SetRectangularSelectionAnchor(Sci_Position anchor); /** Return the anchor position of the rectangular selection. */ @@ -2794,7 +2802,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the caret of the rectangular selection. */ - void SetRectangularSelectionCaretVirtualSpace(intptr_t space); + void SetRectangularSelectionCaretVirtualSpace(Sci_Position space); /** Return the virtual space of the caret of the rectangular selection. */ @@ -2802,7 +2810,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Set the virtual space of the anchor of the rectangular selection. */ - void SetRectangularSelectionAnchorVirtualSpace(intptr_t space); + void SetRectangularSelectionAnchorVirtualSpace(Sci_Position space); /** Return the virtual space of the anchor of the rectangular selection. */ @@ -2874,7 +2882,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Indicate that the internal state of a lexer has changed over a range and therefore * there may be a need to redraw. */ - intptr_t ChangeLexerState(intptr_t start, intptr_t end); + intptr_t ChangeLexerState(Sci_Position start, Sci_Position end); /** Find the next line at or after lineStart that is a contracted fold header line. * Return -1 when no more lines. @@ -2941,15 +2949,15 @@ class ScintillaWrapper : public PyProducerConsumer /** Create an ILoader*. */ - intptr_t CreateLoader(intptr_t bytes, int documentOptions); + intptr_t CreateLoader(Sci_Position bytes, int documentOptions); /** On OS X, show a find indicator. */ - void FindIndicatorShow(intptr_t start, intptr_t end); + void FindIndicatorShow(Sci_Position start, Sci_Position end); /** On OS X, flash a find indicator, then fade out. */ - void FindIndicatorFlash(intptr_t start, intptr_t end); + void FindIndicatorFlash(Sci_Position start, Sci_Position end); /** On OS X, hide the find indicator. */ @@ -2997,6 +3005,42 @@ class ScintillaWrapper : public PyProducerConsumer */ void ClearRepresentation(boost::python::object encodedCharacter); + /** Set the end of line annotation text for a line + */ + void EOLAnnotationSetText(intptr_t line, boost::python::object text); + + /** Get the end of line annotation text for a line + */ + boost::python::str EOLAnnotationGetText(intptr_t line); + + /** Set the style number for the end of line annotations for a line + */ + void EOLAnnotationSetStyle(intptr_t line, int style); + + /** Get the style number for the end of line annotations for a line + */ + intptr_t EOLAnnotationGetStyle(intptr_t line); + + /** Clear the end of annotations from all lines + */ + void EOLAnnotationClearAll(); + + /** Set the visibility for the end of line annotations for a view + */ + void EOLAnnotationSetVisible(int visible); + + /** Get the visibility for the end of line annotations for a view + */ + int EOLAnnotationGetVisible(); + + /** Get the start of the range of style numbers used for end of line annotations + */ + void EOLAnnotationSetStyleOffset(int style); + + /** Get the start of the range of style numbers used for end of line annotations + */ + intptr_t EOLAnnotationGetStyleOffset(); + /** Start notifying the container of all key presses and commands. */ void StartRecord(); @@ -3015,7 +3059,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Colourise a segment of the document using the current lexing language. */ - void Colourise(intptr_t start, intptr_t end); + void Colourise(Sci_Position start, Sci_Position end); /** Set up a value that may be used by a lexer for some optional feature. */ @@ -3140,6 +3184,10 @@ class ScintillaWrapper : public PyProducerConsumer */ boost::python::str DescriptionOfStyle(int style); + /** Set the lexer from an ILexer*. + */ + void SetILexer(intptr_t ilexer); + /** Retrieve bidirectional text display state. */ int GetBidirectional(); @@ -3162,7 +3210,7 @@ class ScintillaWrapper : public PyProducerConsumer /** Retrieve the document line containing a position measured in index units. */ - intptr_t LineFromIndexPosition(intptr_t pos, int lineCharacterIndex); + intptr_t LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex); /** Retrieve the position measured in index units at the start of a document line. */ @@ -3203,7 +3251,7 @@ class ScintillaWrapper : public PyProducerConsumer static void runCallbacks(CallbackExecArgs *args); void runCallbacks(std::shared_ptr args); - std::string extractEncodedString(boost::python::object str, int toCodePage); + std::string extractEncodedString(boost::python::object str, intptr_t toCodePage); static ReplaceEntry *convertWithPython(const char *text, Match *match, void *state); static bool searchPythonHandler(const char * /* text */, Match *match, void *state); boost::python::object m_pythonReplaceFunction; diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index 311320a8..4b051b5f 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -58,7 +58,7 @@ intptr_t ScintillaWrapper::AddStyledText(ScintillaCells c) /** Insert string at a position. */ -void ScintillaWrapper::InsertText(intptr_t pos, boost::python::object text) +void ScintillaWrapper::InsertText(Sci_Position pos, boost::python::object text) { DEBUG_TRACE(L"ScintillaWrapper::InsertText\n"); std::string stringtext = getStringFromObject(text); @@ -84,7 +84,7 @@ void ScintillaWrapper::ClearAll() /** Delete a range of text in the document. */ -void ScintillaWrapper::DeleteRange(intptr_t start, intptr_t lengthDelete) +void ScintillaWrapper::DeleteRange(Sci_Position start, Sci_Position lengthDelete) { DEBUG_TRACE(L"ScintillaWrapper::DeleteRange\n"); callScintilla(SCI_DELETERANGE, start, lengthDelete); @@ -108,7 +108,7 @@ intptr_t ScintillaWrapper::GetLength() /** Returns the character byte at the position. */ -intptr_t ScintillaWrapper::GetCharAt(intptr_t pos) +intptr_t ScintillaWrapper::GetCharAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetCharAt\n"); return callScintilla(SCI_GETCHARAT, pos); @@ -132,7 +132,7 @@ intptr_t ScintillaWrapper::GetAnchor() /** Returns the style byte at the position. */ -intptr_t ScintillaWrapper::GetStyleAt(intptr_t pos) +intptr_t ScintillaWrapper::GetStyleAt(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetStyleAt\n"); return callScintilla(SCI_GETSTYLEAT, pos); @@ -175,13 +175,13 @@ void ScintillaWrapper::SetSavePoint() /** Retrieve a buffer of cells. * Returns the number of bytes in the buffer not including terminating NULs. */ -boost::python::tuple ScintillaWrapper::GetStyledText(int start, int end) +boost::python::tuple ScintillaWrapper::GetStyledText(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetStyledText\n"); Sci_TextRange src; if (end < start) { - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; } @@ -225,6 +225,22 @@ void ScintillaWrapper::MarkerDeleteHandle(int markerHandle) callScintilla(SCI_MARKERDELETEHANDLE, markerHandle); } +/** Retrieve marker handles of a line + */ +intptr_t ScintillaWrapper::MarkerHandleFromLine(intptr_t line, int which) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerHandleFromLine\n"); + return callScintilla(SCI_MARKERHANDLEFROMLINE, line, which); +} + +/** Retrieve marker number of a marker handle + */ +intptr_t ScintillaWrapper::MarkerNumberFromLine(intptr_t line, int which) +{ + DEBUG_TRACE(L"ScintillaWrapper::MarkerNumberFromLine\n"); + return callScintilla(SCI_MARKERNUMBERFROMLINE, line, which); +} + /** Is undo history being collected? */ bool ScintillaWrapper::GetUndoCollection() @@ -294,7 +310,7 @@ void ScintillaWrapper::GotoLine(intptr_t line) /** Set caret to a position and ensure it is visible. */ -void ScintillaWrapper::GotoPos(intptr_t caret) +void ScintillaWrapper::GotoPos(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::GotoPos\n"); callScintilla(SCI_GOTOPOS, caret); @@ -303,7 +319,7 @@ void ScintillaWrapper::GotoPos(intptr_t caret) /** Set the selection anchor to a position. The anchor is the opposite * end of the selection from the caret. */ -void ScintillaWrapper::SetAnchor(intptr_t anchor) +void ScintillaWrapper::SetAnchor(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetAnchor\n"); callScintilla(SCI_SETANCHOR, anchor); @@ -358,7 +374,7 @@ void ScintillaWrapper::SetEOLMode(int eolMode) /** Set the current styling position to start. * The unused parameter is no longer used and should be set to 0. */ -void ScintillaWrapper::StartStyling(intptr_t start, int unused) +void ScintillaWrapper::StartStyling(Sci_Position start, int unused) { DEBUG_TRACE(L"ScintillaWrapper::StartStyling\n"); callScintilla(SCI_STARTSTYLING, start, unused); @@ -367,7 +383,7 @@ void ScintillaWrapper::StartStyling(intptr_t start, int unused) /** Change style from current styling position for length characters to a style * and move the current styling position to after this newly styled segment. */ -void ScintillaWrapper::SetStyling(intptr_t length, int style) +void ScintillaWrapper::SetStyling(Sci_Position length, int style) { DEBUG_TRACE(L"ScintillaWrapper::SetStyling\n"); callScintilla(SCI_SETSTYLING, length, style); @@ -406,6 +422,22 @@ intptr_t ScintillaWrapper::GetTabWidth() return callScintilla(SCI_GETTABWIDTH); } +/** Set the minimum visual width of a tab. + */ +void ScintillaWrapper::SetTabMinimumWidth(int pixels) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetTabMinimumWidth\n"); + callScintilla(SCI_SETTABMINIMUMWIDTH, pixels); +} + +/** Get the minimum visual width of a tab. + */ +intptr_t ScintillaWrapper::GetTabMinimumWidth() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTabMinimumWidth\n"); + return callScintilla(SCI_GETTABMINIMUMWIDTH); +} + /** Clear explicit tabstops on a line. */ void ScintillaWrapper::ClearTabStops(intptr_t line) @@ -447,7 +479,7 @@ int ScintillaWrapper::GetIMEInteraction() return callScintilla(SCI_GETIMEINTERACTION); } -/** Choose to display the the IME in a window or inline. +/** Choose to display the IME in a window or inline. */ void ScintillaWrapper::SetIMEInteraction(int imeInteraction) { @@ -490,7 +522,7 @@ void ScintillaWrapper::MarkerSetBackSelected(int markerNumber, boost::python::tu callScintilla(SCI_MARKERSETBACKSELECTED, markerNumber, static_cast(rgbback)); } -/** Enable/disable highlight for current folding bloc (smallest one that contains the caret) +/** Enable/disable highlight for current folding block (smallest one that contains the caret) */ void ScintillaWrapper::MarkerEnableHighlight(bool enabled) { @@ -1329,7 +1361,7 @@ void ScintillaWrapper::StyleSetChangeable(int style, bool changeable) * The lengthEntered parameter indicates how many characters before * the caret should be used to provide context. */ -void ScintillaWrapper::AutoCShow(intptr_t lengthEntered, boost::python::object itemList) +void ScintillaWrapper::AutoCShow(Sci_Position lengthEntered, boost::python::object itemList) { DEBUG_TRACE(L"ScintillaWrapper::AutoCShow\n"); std::string stringitemList = getStringFromObject(itemList); @@ -1632,7 +1664,7 @@ intptr_t ScintillaWrapper::GetLineIndentPosition(intptr_t line) /** Retrieve the column number of a position, taking tab width into account. */ -intptr_t ScintillaWrapper::GetColumn(intptr_t pos) +intptr_t ScintillaWrapper::GetColumn(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::GetColumn\n"); return callScintilla(SCI_GETCOLUMN, pos); @@ -1640,7 +1672,7 @@ intptr_t ScintillaWrapper::GetColumn(intptr_t pos) /** Count characters between two positions. */ -intptr_t ScintillaWrapper::CountCharacters(intptr_t start, intptr_t end) +intptr_t ScintillaWrapper::CountCharacters(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CountCharacters\n"); return callScintilla(SCI_COUNTCHARACTERS, start, end); @@ -1648,7 +1680,7 @@ intptr_t ScintillaWrapper::CountCharacters(intptr_t start, intptr_t end) /** Count code units between two positions. */ -intptr_t ScintillaWrapper::CountCodeUnits(intptr_t start, intptr_t end) +intptr_t ScintillaWrapper::CountCodeUnits(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CountCodeUnits\n"); return callScintilla(SCI_COUNTCODEUNITS, start, end); @@ -1689,7 +1721,7 @@ int ScintillaWrapper::GetIndentationGuides() /** Set the highlighted indentation guide column. * 0 = no highlighted guide. */ -void ScintillaWrapper::SetHighlightGuide(intptr_t column) +void ScintillaWrapper::SetHighlightGuide(Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::SetHighlightGuide\n"); callScintilla(SCI_SETHIGHLIGHTGUIDE, column); @@ -1738,7 +1770,7 @@ bool ScintillaWrapper::GetReadOnly() /** Sets the position of the caret. */ -void ScintillaWrapper::SetCurrentPos(intptr_t caret) +void ScintillaWrapper::SetCurrentPos(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetCurrentPos\n"); callScintilla(SCI_SETCURRENTPOS, caret); @@ -1746,7 +1778,7 @@ void ScintillaWrapper::SetCurrentPos(intptr_t caret) /** Sets the position that starts the selection - this becomes the anchor. */ -void ScintillaWrapper::SetSelectionStart(intptr_t anchor) +void ScintillaWrapper::SetSelectionStart(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionStart\n"); callScintilla(SCI_SETSELECTIONSTART, anchor); @@ -1762,7 +1794,7 @@ intptr_t ScintillaWrapper::GetSelectionStart() /** Sets the position that ends the selection - this becomes the caret. */ -void ScintillaWrapper::SetSelectionEnd(intptr_t caret) +void ScintillaWrapper::SetSelectionEnd(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionEnd\n"); callScintilla(SCI_SETSELECTIONEND, caret); @@ -1778,7 +1810,7 @@ intptr_t ScintillaWrapper::GetSelectionEnd() /** Set caret to a position, while removing any existing selection. */ -void ScintillaWrapper::SetEmptySelection(intptr_t caret) +void ScintillaWrapper::SetEmptySelection(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetEmptySelection\n"); callScintilla(SCI_SETEMPTYSELECTION, caret); @@ -1818,7 +1850,7 @@ int ScintillaWrapper::GetPrintColourMode() /** Find some text in the document. */ -boost::python::object ScintillaWrapper::FindText(int searchFlags, int start, int end, boost::python::object ft) +boost::python::object ScintillaWrapper::FindText(int searchFlags, Sci_PositionCR start, Sci_PositionCR end, boost::python::object ft) { DEBUG_TRACE(L"ScintillaWrapper::FindText\n"); notAllowedInCallback("findText is not allowed in a synchronous callback. Use an asynchronous callback or one of the editor.search(), editor.research(), editor.replace(), editor.rereplace() methods."); @@ -1916,7 +1948,7 @@ bool ScintillaWrapper::GetModify() /** Select a range of text. */ -void ScintillaWrapper::SetSel(intptr_t anchor, intptr_t caret) +void ScintillaWrapper::SetSel(Sci_Position anchor, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSel\n"); callScintilla(SCI_SETSEL, anchor, caret); @@ -1937,7 +1969,7 @@ boost::python::str ScintillaWrapper::GetSelText() /** Retrieve a range of text. * Return the length of the text. */ -boost::python::str ScintillaWrapper::GetTextRange(int start, int end) +boost::python::str ScintillaWrapper::GetTextRange(Sci_PositionCR start, Sci_PositionCR end) { DEBUG_TRACE(L"ScintillaWrapper::GetTextRange\n"); Sci_TextRange src; @@ -1948,7 +1980,7 @@ boost::python::str ScintillaWrapper::GetTextRange(int start, int end) if (end < start) { - int temp = start; + Sci_PositionCR temp = start; start = end; end = temp; } @@ -1970,7 +2002,7 @@ void ScintillaWrapper::HideSelection(bool hide) /** Retrieve the x value of the point in the window where a position is displayed. */ -intptr_t ScintillaWrapper::PointXFromPosition(intptr_t pos) +intptr_t ScintillaWrapper::PointXFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PointXFromPosition\n"); return callScintilla(SCI_POINTXFROMPOSITION, 0, pos); @@ -1978,7 +2010,7 @@ intptr_t ScintillaWrapper::PointXFromPosition(intptr_t pos) /** Retrieve the y value of the point in the window where a position is displayed. */ -intptr_t ScintillaWrapper::PointYFromPosition(intptr_t pos) +intptr_t ScintillaWrapper::PointYFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PointYFromPosition\n"); return callScintilla(SCI_POINTYFROMPOSITION, 0, pos); @@ -1986,7 +2018,7 @@ intptr_t ScintillaWrapper::PointYFromPosition(intptr_t pos) /** Retrieve the line containing a position. */ -intptr_t ScintillaWrapper::LineFromPosition(intptr_t pos) +intptr_t ScintillaWrapper::LineFromPosition(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::LineFromPosition\n"); return callScintilla(SCI_LINEFROMPOSITION, pos); @@ -2002,7 +2034,7 @@ intptr_t ScintillaWrapper::PositionFromLine(intptr_t line) /** Scroll horizontally and vertically. */ -void ScintillaWrapper::LineScroll(intptr_t columns, intptr_t lines) +void ScintillaWrapper::LineScroll(Sci_Position columns, intptr_t lines) { DEBUG_TRACE(L"ScintillaWrapper::LineScroll\n"); callScintilla(SCI_LINESCROLL, columns, lines); @@ -2020,7 +2052,7 @@ void ScintillaWrapper::ScrollCaret() * priority to the primary position then the secondary position. * This may be used to make a search match visible. */ -void ScintillaWrapper::ScrollRange(intptr_t secondary, intptr_t primary) +void ScintillaWrapper::ScrollRange(Sci_Position secondary, Sci_Position primary) { DEBUG_TRACE(L"ScintillaWrapper::ScrollRange\n"); callScintilla(SCI_SCROLLRANGE, secondary, primary); @@ -2198,7 +2230,7 @@ intptr_t ScintillaWrapper::GetCaretWidth() /** Sets the position that starts the target which is used for updating the * document without affecting the scroll position. */ -void ScintillaWrapper::SetTargetStart(intptr_t start) +void ScintillaWrapper::SetTargetStart(Sci_Position start) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetStart\n"); callScintilla(SCI_SETTARGETSTART, start); @@ -2212,10 +2244,26 @@ intptr_t ScintillaWrapper::GetTargetStart() return callScintilla(SCI_GETTARGETSTART); } +/** Sets the virtual space of the target start + */ +void ScintillaWrapper::SetTargetStartVirtualSpace(Sci_Position space) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetTargetStartVirtualSpace\n"); + callScintilla(SCI_SETTARGETSTARTVIRTUALSPACE, space); +} + +/** Get the virtual space of the target start + */ +intptr_t ScintillaWrapper::GetTargetStartVirtualSpace() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTargetStartVirtualSpace\n"); + return callScintilla(SCI_GETTARGETSTARTVIRTUALSPACE); +} + /** Sets the position that ends the target which is used for updating the * document without affecting the scroll position. */ -void ScintillaWrapper::SetTargetEnd(intptr_t end) +void ScintillaWrapper::SetTargetEnd(Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetEnd\n"); callScintilla(SCI_SETTARGETEND, end); @@ -2229,9 +2277,25 @@ intptr_t ScintillaWrapper::GetTargetEnd() return callScintilla(SCI_GETTARGETEND); } +/** Sets the virtual space of the target end + */ +void ScintillaWrapper::SetTargetEndVirtualSpace(Sci_Position space) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetTargetEndVirtualSpace\n"); + callScintilla(SCI_SETTARGETENDVIRTUALSPACE, space); +} + +/** Get the virtual space of the target end + */ +intptr_t ScintillaWrapper::GetTargetEndVirtualSpace() +{ + DEBUG_TRACE(L"ScintillaWrapper::GetTargetEndVirtualSpace\n"); + return callScintilla(SCI_GETTARGETENDVIRTUALSPACE); +} + /** Sets both the start and end of the target in one call. */ -void ScintillaWrapper::SetTargetRange(intptr_t start, intptr_t end) +void ScintillaWrapper::SetTargetRange(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::SetTargetRange\n"); callScintilla(SCI_SETTARGETRANGE, start, end); @@ -2318,7 +2382,7 @@ int ScintillaWrapper::GetSearchFlags() /** Show a call tip containing a definition near position pos. */ -void ScintillaWrapper::CallTipShow(intptr_t pos, boost::python::object definition) +void ScintillaWrapper::CallTipShow(Sci_Position pos, boost::python::object definition) { DEBUG_TRACE(L"ScintillaWrapper::CallTipShow\n"); std::string stringdefinition = getStringFromObject(definition); @@ -2351,7 +2415,7 @@ intptr_t ScintillaWrapper::CallTipPosStart() /** Set the start position in order to change when backspacing removes the calltip. */ -void ScintillaWrapper::CallTipSetPosStart(intptr_t posStart) +void ScintillaWrapper::CallTipSetPosStart(Sci_Position posStart) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetPosStart\n"); callScintilla(SCI_CALLTIPSETPOSSTART, posStart); @@ -2359,7 +2423,7 @@ void ScintillaWrapper::CallTipSetPosStart(intptr_t posStart) /** Highlight a segment of the definition. */ -void ScintillaWrapper::CallTipSetHlt(int highlightStart, int highlightEnd) +void ScintillaWrapper::CallTipSetHlt(Sci_Position highlightStart, Sci_Position highlightEnd) { DEBUG_TRACE(L"ScintillaWrapper::CallTipSetHlt\n"); callScintilla(SCI_CALLTIPSETHLT, highlightStart, highlightEnd); @@ -2689,7 +2753,7 @@ intptr_t ScintillaWrapper::GetMouseDwellTime() /** Get position of start of word. */ -intptr_t ScintillaWrapper::WordStartPosition(intptr_t pos, bool onlyWordCharacters) +intptr_t ScintillaWrapper::WordStartPosition(Sci_Position pos, bool onlyWordCharacters) { DEBUG_TRACE(L"ScintillaWrapper::WordStartPosition\n"); return callScintilla(SCI_WORDSTARTPOSITION, pos, onlyWordCharacters); @@ -2697,7 +2761,7 @@ intptr_t ScintillaWrapper::WordStartPosition(intptr_t pos, bool onlyWordCharacte /** Get position of end of word. */ -intptr_t ScintillaWrapper::WordEndPosition(intptr_t pos, bool onlyWordCharacters) +intptr_t ScintillaWrapper::WordEndPosition(Sci_Position pos, bool onlyWordCharacters) { DEBUG_TRACE(L"ScintillaWrapper::WordEndPosition\n"); return callScintilla(SCI_WORDENDPOSITION, pos, onlyWordCharacters); @@ -2705,7 +2769,7 @@ intptr_t ScintillaWrapper::WordEndPosition(intptr_t pos, bool onlyWordCharacters /** Is the range start..end considered a word? */ -bool ScintillaWrapper::IsRangeWord(intptr_t start, intptr_t end) +bool ScintillaWrapper::IsRangeWord(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::IsRangeWord\n"); return 0 != (callScintilla(SCI_ISRANGEWORD, start, end)); @@ -3540,7 +3604,7 @@ intptr_t ScintillaWrapper::LineLength(intptr_t line) /** Highlight the characters at two positions. */ -void ScintillaWrapper::BraceHighlight(intptr_t posA, intptr_t posB) +void ScintillaWrapper::BraceHighlight(Sci_Position posA, Sci_Position posB) { DEBUG_TRACE(L"ScintillaWrapper::BraceHighlight\n"); callScintilla(SCI_BRACEHIGHLIGHT, posA, posB); @@ -3556,7 +3620,7 @@ void ScintillaWrapper::BraceHighlightIndicator(bool useSetting, int indicator) /** Highlight the character at a position indicating there is no matching brace. */ -void ScintillaWrapper::BraceBadLight(intptr_t pos) +void ScintillaWrapper::BraceBadLight(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::BraceBadLight\n"); callScintilla(SCI_BRACEBADLIGHT, pos); @@ -3573,12 +3637,20 @@ void ScintillaWrapper::BraceBadLightIndicator(bool useSetting, int indicator) /** Find the position of a matching brace or INVALID_POSITION if no match. * The maxReStyle must be 0 for now. It may be defined in a future release. */ -intptr_t ScintillaWrapper::BraceMatch(intptr_t pos, int maxReStyle) +intptr_t ScintillaWrapper::BraceMatch(Sci_Position pos, int maxReStyle) { DEBUG_TRACE(L"ScintillaWrapper::BraceMatch\n"); return callScintilla(SCI_BRACEMATCH, pos, maxReStyle); } +/** Similar to BraceMatch, but matching starts at the explicit start position. + */ +intptr_t ScintillaWrapper::BraceMatchNext(Sci_Position pos, Sci_Position startPos) +{ + DEBUG_TRACE(L"ScintillaWrapper::BraceMatchNext\n"); + return callScintilla(SCI_BRACEMATCHNEXT, pos, startPos); +} + /** Are the end of line characters visible? */ bool ScintillaWrapper::GetViewEOL() @@ -3631,7 +3703,7 @@ intptr_t ScintillaWrapper::GetEdgeColumn() /** Set the column number of the edge. * If text goes past the edge then it is highlighted. */ -void ScintillaWrapper::SetEdgeColumn(intptr_t column) +void ScintillaWrapper::SetEdgeColumn(Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::SetEdgeColumn\n"); callScintilla(SCI_SETEDGECOLUMN, column); @@ -3674,7 +3746,7 @@ void ScintillaWrapper::SetEdgeColour(boost::python::tuple edgeColour) /** Add a new vertical edge to the view. */ -void ScintillaWrapper::MultiEdgeAddLine(intptr_t column, boost::python::tuple edgeColour) +void ScintillaWrapper::MultiEdgeAddLine(Sci_Position column, boost::python::tuple edgeColour) { DEBUG_TRACE(L"ScintillaWrapper::MultiEdgeAddLine\n"); COLORREF rgbedgeColour = MAKECOLOUR(edgeColour); @@ -3689,6 +3761,14 @@ void ScintillaWrapper::MultiEdgeClearAll() callScintilla(SCI_MULTIEDGECLEARALL); } +/** Get multi edge positions. + */ +intptr_t ScintillaWrapper::GetMultiEdgeColumn(int which) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetMultiEdgeColumn\n"); + return callScintilla(SCI_GETMULTIEDGECOLUMN, which); +} + /** Sets the current caret position to be the search anchor. */ void ScintillaWrapper::SearchAnchor() @@ -3762,7 +3842,7 @@ intptr_t ScintillaWrapper::GetZoom() /** Create a new document object. * Starts with reference count of 1 and not selected into editor. */ -intptr_t ScintillaWrapper::CreateDocument(intptr_t bytes, int documentOptions) +intptr_t ScintillaWrapper::CreateDocument(Sci_Position bytes, int documentOptions) { DEBUG_TRACE(L"ScintillaWrapper::CreateDocument\n"); return callScintilla(SCI_CREATEDOCUMENT, bytes, documentOptions); @@ -4141,7 +4221,7 @@ void ScintillaWrapper::ParaUpExtend() /** Given a valid document position, return the previous position taking code * page into account. Returns 0 if passed 0. */ -intptr_t ScintillaWrapper::PositionBefore(intptr_t pos) +intptr_t ScintillaWrapper::PositionBefore(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PositionBefore\n"); return callScintilla(SCI_POSITIONBEFORE, pos); @@ -4150,7 +4230,7 @@ intptr_t ScintillaWrapper::PositionBefore(intptr_t pos) /** Given a valid document position, return the next position taking code * page into account. Maximum value returned is the last position in the document. */ -intptr_t ScintillaWrapper::PositionAfter(intptr_t pos) +intptr_t ScintillaWrapper::PositionAfter(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::PositionAfter\n"); return callScintilla(SCI_POSITIONAFTER, pos); @@ -4159,7 +4239,7 @@ intptr_t ScintillaWrapper::PositionAfter(intptr_t pos) /** Given a valid document position, return a position that differs in a number * of characters. Returned value is always between 0 and last position in document. */ -intptr_t ScintillaWrapper::PositionRelative(intptr_t pos, intptr_t relative) +intptr_t ScintillaWrapper::PositionRelative(Sci_Position pos, Sci_Position relative) { DEBUG_TRACE(L"ScintillaWrapper::PositionRelative\n"); return callScintilla(SCI_POSITIONRELATIVE, pos, relative); @@ -4169,7 +4249,7 @@ intptr_t ScintillaWrapper::PositionRelative(intptr_t pos, intptr_t relative) * of UTF-16 code units. Returned value is always between 0 and last position in document. * The result may point half way (2 bytes) inside a non-BMP character. */ -intptr_t ScintillaWrapper::PositionRelativeCodeUnits(intptr_t pos, intptr_t relative) +intptr_t ScintillaWrapper::PositionRelativeCodeUnits(Sci_Position pos, Sci_Position relative) { DEBUG_TRACE(L"ScintillaWrapper::PositionRelativeCodeUnits\n"); return callScintilla(SCI_POSITIONRELATIVECODEUNITS, pos, relative); @@ -4177,7 +4257,7 @@ intptr_t ScintillaWrapper::PositionRelativeCodeUnits(intptr_t pos, intptr_t rela /** Copy a range of text to the clipboard. Positions are clipped into the document. */ -void ScintillaWrapper::CopyRange(intptr_t start, intptr_t end) +void ScintillaWrapper::CopyRange(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::CopyRange\n"); callScintilla(SCI_COPYRANGE, start, end); @@ -4489,7 +4569,7 @@ int ScintillaWrapper::AutoCGetOrder() /** Enlarge the document to a particular size of text bytes. */ -void ScintillaWrapper::Allocate(intptr_t bytes) +void ScintillaWrapper::Allocate(Sci_Position bytes) { DEBUG_TRACE(L"ScintillaWrapper::Allocate\n"); callScintilla(SCI_ALLOCATE, bytes); @@ -4509,7 +4589,7 @@ boost::python::str ScintillaWrapper::TargetAsUTF8() /** Set the length of the utf8 argument for calling EncodedFromUTF8. * Set to -1 and the string will be measured to the first nul. */ -void ScintillaWrapper::SetLengthForEncode(intptr_t bytes) +void ScintillaWrapper::SetLengthForEncode(Sci_Position bytes) { DEBUG_TRACE(L"ScintillaWrapper::SetLengthForEncode\n"); callScintilla(SCI_SETLENGTHFORENCODE, bytes); @@ -4531,7 +4611,7 @@ boost::python::str ScintillaWrapper::EncodedFromUTF8(boost::python::object utf8) /** Find the position of a column on a line taking into account tabs and * multi-byte characters. If beyond end of line, return line end position. */ -intptr_t ScintillaWrapper::FindColumn(intptr_t line, intptr_t column) +intptr_t ScintillaWrapper::FindColumn(intptr_t line, Sci_Position column) { DEBUG_TRACE(L"ScintillaWrapper::FindColumn\n"); return callScintilla(SCI_FINDCOLUMN, line, column); @@ -4651,7 +4731,7 @@ intptr_t ScintillaWrapper::GetIndicatorValue() /** Turn a indicator on over a range. */ -void ScintillaWrapper::IndicatorFillRange(intptr_t start, intptr_t lengthFill) +void ScintillaWrapper::IndicatorFillRange(Sci_Position start, Sci_Position lengthFill) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorFillRange\n"); callScintilla(SCI_INDICATORFILLRANGE, start, lengthFill); @@ -4659,7 +4739,7 @@ void ScintillaWrapper::IndicatorFillRange(intptr_t start, intptr_t lengthFill) /** Turn a indicator off over a range. */ -void ScintillaWrapper::IndicatorClearRange(intptr_t start, intptr_t lengthClear) +void ScintillaWrapper::IndicatorClearRange(Sci_Position start, Sci_Position lengthClear) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorClearRange\n"); callScintilla(SCI_INDICATORCLEARRANGE, start, lengthClear); @@ -4667,7 +4747,7 @@ void ScintillaWrapper::IndicatorClearRange(intptr_t start, intptr_t lengthClear) /** Are any indicators present at pos? */ -intptr_t ScintillaWrapper::IndicatorAllOnFor(intptr_t pos) +intptr_t ScintillaWrapper::IndicatorAllOnFor(Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorAllOnFor\n"); return callScintilla(SCI_INDICATORALLONFOR, pos); @@ -4675,7 +4755,7 @@ intptr_t ScintillaWrapper::IndicatorAllOnFor(intptr_t pos) /** What value does a particular indicator have at a position? */ -intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, intptr_t pos) +intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorValueAt\n"); return callScintilla(SCI_INDICATORVALUEAT, indicator, pos); @@ -4683,7 +4763,7 @@ intptr_t ScintillaWrapper::IndicatorValueAt(int indicator, intptr_t pos) /** Where does a particular indicator start? */ -intptr_t ScintillaWrapper::IndicatorStart(int indicator, intptr_t pos) +intptr_t ScintillaWrapper::IndicatorStart(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorStart\n"); return callScintilla(SCI_INDICATORSTART, indicator, pos); @@ -4691,7 +4771,7 @@ intptr_t ScintillaWrapper::IndicatorStart(int indicator, intptr_t pos) /** Where does a particular indicator end? */ -intptr_t ScintillaWrapper::IndicatorEnd(int indicator, intptr_t pos) +intptr_t ScintillaWrapper::IndicatorEnd(int indicator, Sci_Position pos) { DEBUG_TRACE(L"ScintillaWrapper::IndicatorEnd\n"); return callScintilla(SCI_INDICATOREND, indicator, pos); @@ -5178,7 +5258,7 @@ void ScintillaWrapper::ClearSelections() /** Set a simple selection */ -void ScintillaWrapper::SetSelection(intptr_t caret, intptr_t anchor) +void ScintillaWrapper::SetSelection(Sci_Position caret, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelection\n"); callScintilla(SCI_SETSELECTION, caret, anchor); @@ -5186,7 +5266,7 @@ void ScintillaWrapper::SetSelection(intptr_t caret, intptr_t anchor) /** Add a selection */ -void ScintillaWrapper::AddSelection(intptr_t caret, intptr_t anchor) +void ScintillaWrapper::AddSelection(Sci_Position caret, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::AddSelection\n"); callScintilla(SCI_ADDSELECTION, caret, anchor); @@ -5218,7 +5298,7 @@ intptr_t ScintillaWrapper::GetMainSelection() /** Set the caret position of the nth selection. */ -void ScintillaWrapper::SetSelectionNCaret(int selection, intptr_t caret) +void ScintillaWrapper::SetSelectionNCaret(int selection, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNCaret\n"); callScintilla(SCI_SETSELECTIONNCARET, selection, caret); @@ -5234,7 +5314,7 @@ intptr_t ScintillaWrapper::GetSelectionNCaret(int selection) /** Set the anchor position of the nth selection. */ -void ScintillaWrapper::SetSelectionNAnchor(int selection, intptr_t anchor) +void ScintillaWrapper::SetSelectionNAnchor(int selection, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNAnchor\n"); callScintilla(SCI_SETSELECTIONNANCHOR, selection, anchor); @@ -5250,7 +5330,7 @@ intptr_t ScintillaWrapper::GetSelectionNAnchor(int selection) /** Set the virtual space of the caret of the nth selection. */ -void ScintillaWrapper::SetSelectionNCaretVirtualSpace(int selection, intptr_t space) +void ScintillaWrapper::SetSelectionNCaretVirtualSpace(int selection, Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNCaretVirtualSpace\n"); callScintilla(SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space); @@ -5266,7 +5346,7 @@ intptr_t ScintillaWrapper::GetSelectionNCaretVirtualSpace(int selection) /** Set the virtual space of the anchor of the nth selection. */ -void ScintillaWrapper::SetSelectionNAnchorVirtualSpace(int selection, intptr_t space) +void ScintillaWrapper::SetSelectionNAnchorVirtualSpace(int selection, Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNAnchorVirtualSpace\n"); callScintilla(SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space); @@ -5282,7 +5362,7 @@ intptr_t ScintillaWrapper::GetSelectionNAnchorVirtualSpace(int selection) /** Sets the position that starts the selection - this becomes the anchor. */ -void ScintillaWrapper::SetSelectionNStart(int selection, intptr_t anchor) +void ScintillaWrapper::SetSelectionNStart(int selection, Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNStart\n"); callScintilla(SCI_SETSELECTIONNSTART, selection, anchor); @@ -5296,14 +5376,30 @@ intptr_t ScintillaWrapper::GetSelectionNStart(int selection) return callScintilla(SCI_GETSELECTIONNSTART, selection); } +/** Returns the virtual space at the start of the selection. + */ +intptr_t ScintillaWrapper::GetSelectionNStartVirtualSpace(int selection) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNStartVirtualSpace\n"); + return callScintilla(SCI_GETSELECTIONNSTARTVIRTUALSPACE, selection); +} + /** Sets the position that ends the selection - this becomes the currentPosition. */ -void ScintillaWrapper::SetSelectionNEnd(int selection, intptr_t caret) +void ScintillaWrapper::SetSelectionNEnd(int selection, Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetSelectionNEnd\n"); callScintilla(SCI_SETSELECTIONNEND, selection, caret); } +/** Returns the virtual space at the end of the selection. + */ +intptr_t ScintillaWrapper::GetSelectionNEndVirtualSpace(int selection) +{ + DEBUG_TRACE(L"ScintillaWrapper::GetSelectionNEndVirtualSpace\n"); + return callScintilla(SCI_GETSELECTIONNENDVIRTUALSPACE, selection); +} + /** Returns the position at the end of the selection. */ intptr_t ScintillaWrapper::GetSelectionNEnd(int selection) @@ -5314,7 +5410,7 @@ intptr_t ScintillaWrapper::GetSelectionNEnd(int selection) /** Set the caret position of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionCaret(intptr_t caret) +void ScintillaWrapper::SetRectangularSelectionCaret(Sci_Position caret) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionCaret\n"); callScintilla(SCI_SETRECTANGULARSELECTIONCARET, caret); @@ -5330,7 +5426,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionCaret() /** Set the anchor position of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionAnchor(intptr_t anchor) +void ScintillaWrapper::SetRectangularSelectionAnchor(Sci_Position anchor) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionAnchor\n"); callScintilla(SCI_SETRECTANGULARSELECTIONANCHOR, anchor); @@ -5346,7 +5442,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionAnchor() /** Set the virtual space of the caret of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace(intptr_t space) +void ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionCaretVirtualSpace\n"); callScintilla(SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space); @@ -5362,7 +5458,7 @@ intptr_t ScintillaWrapper::GetRectangularSelectionCaretVirtualSpace() /** Set the virtual space of the anchor of the rectangular selection. */ -void ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace(intptr_t space) +void ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace(Sci_Position space) { DEBUG_TRACE(L"ScintillaWrapper::SetRectangularSelectionAnchorVirtualSpace\n"); callScintilla(SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space); @@ -5502,7 +5598,7 @@ void ScintillaWrapper::MultipleSelectAddEach() /** Indicate that the internal state of a lexer has changed over a range and therefore * there may be a need to redraw. */ -intptr_t ScintillaWrapper::ChangeLexerState(intptr_t start, intptr_t end) +intptr_t ScintillaWrapper::ChangeLexerState(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::ChangeLexerState\n"); return callScintilla(SCI_CHANGELEXERSTATE, start, end); @@ -5635,7 +5731,7 @@ int ScintillaWrapper::GetTechnology() /** Create an ILoader*. */ -intptr_t ScintillaWrapper::CreateLoader(intptr_t bytes, int documentOptions) +intptr_t ScintillaWrapper::CreateLoader(Sci_Position bytes, int documentOptions) { DEBUG_TRACE(L"ScintillaWrapper::CreateLoader\n"); return callScintilla(SCI_CREATELOADER, bytes, documentOptions); @@ -5643,7 +5739,7 @@ intptr_t ScintillaWrapper::CreateLoader(intptr_t bytes, int documentOptions) /** On OS X, show a find indicator. */ -void ScintillaWrapper::FindIndicatorShow(intptr_t start, intptr_t end) +void ScintillaWrapper::FindIndicatorShow(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorShow\n"); callScintilla(SCI_FINDINDICATORSHOW, start, end); @@ -5651,7 +5747,7 @@ void ScintillaWrapper::FindIndicatorShow(intptr_t start, intptr_t end) /** On OS X, flash a find indicator, then fade out. */ -void ScintillaWrapper::FindIndicatorFlash(intptr_t start, intptr_t end) +void ScintillaWrapper::FindIndicatorFlash(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::FindIndicatorFlash\n"); callScintilla(SCI_FINDINDICATORFLASH, start, end); @@ -5753,6 +5849,81 @@ void ScintillaWrapper::ClearRepresentation(boost::python::object encodedCharacte callScintilla(SCI_CLEARREPRESENTATION, reinterpret_cast(stringencodedCharacter.c_str())); } +/** Set the end of line annotation text for a line + */ +void ScintillaWrapper::EOLAnnotationSetText(intptr_t line, boost::python::object text) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetText\n"); + std::string stringtext = getStringFromObject(text); + callScintilla(SCI_EOLANNOTATIONSETTEXT, line, reinterpret_cast(stringtext.c_str())); +} + +/** Get the end of line annotation text for a line + */ +boost::python::str ScintillaWrapper::EOLAnnotationGetText(intptr_t line) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetText\n"); + PythonCompatibleStrBuffer result(callScintilla(SCI_EOLANNOTATIONGETTEXT, line)); + callScintilla(SCI_EOLANNOTATIONGETTEXT, line, reinterpret_cast(*result)); + return boost::python::str(result.c_str()); +} + +/** Set the style number for the end of line annotations for a line + */ +void ScintillaWrapper::EOLAnnotationSetStyle(intptr_t line, int style) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetStyle\n"); + callScintilla(SCI_EOLANNOTATIONSETSTYLE, line, style); +} + +/** Get the style number for the end of line annotations for a line + */ +intptr_t ScintillaWrapper::EOLAnnotationGetStyle(intptr_t line) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetStyle\n"); + return callScintilla(SCI_EOLANNOTATIONGETSTYLE, line); +} + +/** Clear the end of annotations from all lines + */ +void ScintillaWrapper::EOLAnnotationClearAll() +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationClearAll\n"); + callScintilla(SCI_EOLANNOTATIONCLEARALL); +} + +/** Set the visibility for the end of line annotations for a view + */ +void ScintillaWrapper::EOLAnnotationSetVisible(int visible) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetVisible\n"); + callScintilla(SCI_EOLANNOTATIONSETVISIBLE, visible); +} + +/** Get the visibility for the end of line annotations for a view + */ +int ScintillaWrapper::EOLAnnotationGetVisible() +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetVisible\n"); + return callScintilla(SCI_EOLANNOTATIONGETVISIBLE); +} + +/** Get the start of the range of style numbers used for end of line annotations + */ +void ScintillaWrapper::EOLAnnotationSetStyleOffset(int style) +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationSetStyleOffset\n"); + callScintilla(SCI_EOLANNOTATIONSETSTYLEOFFSET, style); +} + +/** Get the start of the range of style numbers used for end of line annotations + */ +intptr_t ScintillaWrapper::EOLAnnotationGetStyleOffset() +{ + DEBUG_TRACE(L"ScintillaWrapper::EOLAnnotationGetStyleOffset\n"); + return callScintilla(SCI_EOLANNOTATIONGETSTYLEOFFSET); +} + /** Start notifying the container of all key presses and commands. */ void ScintillaWrapper::StartRecord() @@ -5787,7 +5958,7 @@ intptr_t ScintillaWrapper::GetLexer() /** Colourise a segment of the document using the current lexing language. */ -void ScintillaWrapper::Colourise(intptr_t start, intptr_t end) +void ScintillaWrapper::Colourise(Sci_Position start, Sci_Position end) { DEBUG_TRACE(L"ScintillaWrapper::Colourise\n"); callScintilla(SCI_COLOURISE, start, end); @@ -6055,6 +6226,14 @@ boost::python::str ScintillaWrapper::DescriptionOfStyle(int style) return boost::python::str(result.c_str()); } +/** Set the lexer from an ILexer*. + */ +void ScintillaWrapper::SetILexer(intptr_t ilexer) +{ + DEBUG_TRACE(L"ScintillaWrapper::SetILexer\n"); + callScintilla(SCI_SETILEXER, 0, ilexer); +} + /** Retrieve bidirectional text display state. */ int ScintillaWrapper::GetBidirectional() @@ -6097,7 +6276,7 @@ void ScintillaWrapper::ReleaseLineCharacterIndex(int lineCharacterIndex) /** Retrieve the document line containing a position measured in index units. */ -intptr_t ScintillaWrapper::LineFromIndexPosition(intptr_t pos, int lineCharacterIndex) +intptr_t ScintillaWrapper::LineFromIndexPosition(Sci_Position pos, int lineCharacterIndex) { DEBUG_TRACE(L"ScintillaWrapper::LineFromIndexPosition\n"); return callScintilla(SCI_LINEFROMINDEXPOSITION, pos, lineCharacterIndex); diff --git a/PythonScript/src/UTF8Iterator.cpp b/PythonScript/src/UTF8Iterator.cpp index 5f1c7715..11b7af86 100644 --- a/PythonScript/src/UTF8Iterator.cpp +++ b/PythonScript/src/UTF8Iterator.cpp @@ -88,7 +88,7 @@ std::basic_string u32_regex_traits::genSortkey(const std::wstring& wstr, } else { // Remove unnecessary trailing null. - while (sortkey_byte_length > 0 && sortkey[sortkey_byte_length - 1] == 0) + while (sortkey_byte_length > 0 && sortkey[static_cast(sortkey_byte_length) - 1] == 0) sortkey_byte_length--; } sortkey.resize(sortkey_byte_length); @@ -98,7 +98,7 @@ string_type u32_regex_traits::convertSortkeyToInts(const std::basic_string`_ +.. method:: editor.markerHandleFromLine(line, which) -> int + + Retrieve marker handles of a line + + See Scintilla documentation for `SCI_MARKERHANDLEFROMLINE `_ + +.. method:: editor.markerNumberFromLine(line, which) -> int + + Retrieve marker number of a marker handle + + See Scintilla documentation for `SCI_MARKERNUMBERFROMLINE `_ + .. method:: editor.getUndoCollection() -> bool Is undo history being collected? @@ -316,6 +328,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTABWIDTH `_ +.. method:: editor.setTabMinimumWidth(pixels) + + Set the minimum visual width of a tab. + + See Scintilla documentation for `SCI_SETTABMINIMUMWIDTH `_ + +.. method:: editor.getTabMinimumWidth() -> int + + Get the minimum visual width of a tab. + + See Scintilla documentation for `SCI_GETTABMINIMUMWIDTH `_ + .. method:: editor.clearTabStops(line) Clear explicit tabstops on a line. @@ -349,7 +373,7 @@ Scintilla Methods .. method:: editor.setIMEInteraction(imeInteraction) - Choose to display the the IME in a window or inline. + Choose to display the IME in a window or inline. See Scintilla documentation for `SCI_SETIMEINTERACTION `_ @@ -379,7 +403,7 @@ Scintilla Methods .. method:: editor.markerEnableHighlight(enabled) - Enable/disable highlight for current folding bloc (smallest one that contains the caret) + Enable/disable highlight for current folding block (smallest one that contains the caret) See Scintilla documentation for `SCI_MARKERENABLEHIGHLIGHT `_ @@ -1615,6 +1639,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTARGETSTART `_ +.. method:: editor.setTargetStartVirtualSpace(space) + + Sets the virtual space of the target start + + See Scintilla documentation for `SCI_SETTARGETSTARTVIRTUALSPACE `_ + +.. method:: editor.getTargetStartVirtualSpace() -> int + + Get the virtual space of the target start + + See Scintilla documentation for `SCI_GETTARGETSTARTVIRTUALSPACE `_ + .. method:: editor.setTargetEnd(end) Sets the position that ends the target which is used for updating the @@ -1628,6 +1664,18 @@ Scintilla Methods See Scintilla documentation for `SCI_GETTARGETEND `_ +.. method:: editor.setTargetEndVirtualSpace(space) + + Sets the virtual space of the target end + + See Scintilla documentation for `SCI_SETTARGETENDVIRTUALSPACE `_ + +.. method:: editor.getTargetEndVirtualSpace() -> int + + Get the virtual space of the target end + + See Scintilla documentation for `SCI_GETTARGETENDVIRTUALSPACE `_ + .. method:: editor.setTargetRange(start, end) Sets both the start and end of the target in one call. @@ -2634,6 +2682,12 @@ Scintilla Methods See Scintilla documentation for `SCI_BRACEMATCH `_ +.. method:: editor.braceMatchNext(pos, startPos) -> int + + Similar to BraceMatch, but matching starts at the explicit start position. + + See Scintilla documentation for `SCI_BRACEMATCHNEXT `_ + .. method:: editor.getViewEOL() -> bool Are the end of line characters visible? @@ -2714,6 +2768,12 @@ Scintilla Methods See Scintilla documentation for `SCI_MULTIEDGECLEARALL `_ +.. method:: editor.getMultiEdgeColumn(which) -> int + + Get multi edge positions. + + See Scintilla documentation for `SCI_GETMULTIEDGECOLUMN `_ + .. method:: editor.searchAnchor() Sets the current caret position to be the search anchor. @@ -3893,12 +3953,24 @@ Scintilla Methods See Scintilla documentation for `SCI_GETSELECTIONNSTART `_ +.. method:: editor.getSelectionNStartVirtualSpace(selection) -> int + + Returns the virtual space at the start of the selection. + + See Scintilla documentation for `SCI_GETSELECTIONNSTARTVIRTUALSPACE `_ + .. method:: editor.setSelectionNEnd(selection, caret) Sets the position that ends the selection - this becomes the currentPosition. See Scintilla documentation for `SCI_SETSELECTIONNEND `_ +.. method:: editor.getSelectionNEndVirtualSpace(selection) -> int + + Returns the virtual space at the end of the selection. + + See Scintilla documentation for `SCI_GETSELECTIONNENDVIRTUALSPACE `_ + .. method:: editor.getSelectionNEnd(selection) -> int Returns the position at the end of the selection. @@ -4230,6 +4302,60 @@ Scintilla Methods See Scintilla documentation for `SCI_CLEARREPRESENTATION `_ +.. method:: editor.eOLAnnotationSetText(line, text) + + Set the end of line annotation text for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONSETTEXT `_ + +.. method:: editor.eOLAnnotationGetText(line) -> str + + Get the end of line annotation text for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONGETTEXT `_ + +.. method:: editor.eOLAnnotationSetStyle(line, style) + + Set the style number for the end of line annotations for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONSETSTYLE `_ + +.. method:: editor.eOLAnnotationGetStyle(line) -> int + + Get the style number for the end of line annotations for a line + + See Scintilla documentation for `SCI_EOLANNOTATIONGETSTYLE `_ + +.. method:: editor.eOLAnnotationClearAll() + + Clear the end of annotations from all lines + + See Scintilla documentation for `SCI_EOLANNOTATIONCLEARALL `_ + +.. method:: editor.eOLAnnotationSetVisible(visible) + + Set the visibility for the end of line annotations for a view + + See Scintilla documentation for `SCI_EOLANNOTATIONSETVISIBLE `_ + +.. method:: editor.eOLAnnotationGetVisible() -> int + + Get the visibility for the end of line annotations for a view + + See Scintilla documentation for `SCI_EOLANNOTATIONGETVISIBLE `_ + +.. method:: editor.eOLAnnotationSetStyleOffset(style) + + Get the start of the range of style numbers used for end of line annotations + + See Scintilla documentation for `SCI_EOLANNOTATIONSETSTYLEOFFSET `_ + +.. method:: editor.eOLAnnotationGetStyleOffset() -> int + + Get the start of the range of style numbers used for end of line annotations + + See Scintilla documentation for `SCI_EOLANNOTATIONGETSTYLEOFFSET `_ + .. method:: editor.startRecord() Start notifying the container of all key presses and commands. @@ -4437,6 +4563,12 @@ Scintilla Methods See Scintilla documentation for `SCI_DESCRIPTIONOFSTYLE `_ +.. method:: editor.setILexer(ilexer) + + Set the lexer from an ILexer*. + + See Scintilla documentation for `SCI_SETILEXER `_ + .. method:: editor.getBidirectional() -> int Retrieve bidirectional text display state. diff --git a/installer/PythonScript.wxs b/installer/PythonScript.wxs index 33688072..7766e3ab 100644 --- a/installer/PythonScript.wxs +++ b/installer/PythonScript.wxs @@ -48,9 +48,7 @@ - - - + diff --git a/installer/humanReadableSize.py b/installer/humanReadableSize.py index bb03bef0..f6ce080a 100644 --- a/installer/humanReadableSize.py +++ b/installer/humanReadableSize.py @@ -1,3 +1,4 @@ +from __future__ import print_function import sys, os # Stolen from http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size @@ -8,4 +9,4 @@ def sizeof_format(size): size /= 1024.0 return "%3.1f%s" % (size, 'TB') -print sizeof_format(os.stat(sys.argv[1]).st_size) +print(sizeof_format(os.stat(sys.argv[1]).st_size))