mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
+ fix: redo rebase/merge conflicts resolving failures
This commit is contained in:
parent
cef8995e77
commit
218ff0b63f
Binary file not shown.
@ -6710,7 +6710,7 @@ void EditHideNotMarkedLineRange(HWND hwnd, DocPos iStartPos, DocPos iEndPos, boo
|
||||
ObserveNotifyChangeEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
EditApplyLexerStyle(hwnd, 0, -1); // reset
|
||||
|
||||
// prepare hidde (folding) settings
|
||||
|
||||
197
src/Notepad3.c
197
src/Notepad3.c
@ -135,6 +135,10 @@ static WCHAR g_tchDefaultExtension[64] = { L'\0' };
|
||||
static WCHAR g_tchDefaultDir[MAX_PATH] = { L'\0' };
|
||||
static WCHAR g_tchToolbarButtons[MIDSZ_BUFFER] = { L'\0' };
|
||||
static WCHAR g_tchStatusbarSections[SMALL_BUFFER] = { L'\0' };
|
||||
static WCHAR g_tchStatusbarRelWidths[SMALL_BUFFER] = { L'\0' };
|
||||
static bool g_bStatusBarOptimizedSpace = false;
|
||||
static bool g_bUsrDefinedStatusbarWidth = false;
|
||||
|
||||
static WCHAR g_tchToolbarBitmap[MAX_PATH] = { L'\0' };
|
||||
static WCHAR g_tchToolbarBitmapHot[MAX_PATH] = { L'\0' };
|
||||
static WCHAR g_tchToolbarBitmapDisabled[MAX_PATH] = { L'\0' };
|
||||
@ -217,7 +221,6 @@ int iUpdateDelayHyperlinkStyling;
|
||||
int iUpdateDelayMarkAllCoccurrences;
|
||||
int iCurrentLineHorizontalSlop = 0;
|
||||
int iCurrentLineVerticalSlop = 0;
|
||||
bool bStatusBarOptimizedSpace = false;
|
||||
|
||||
const int DirectWriteTechnology[4] = {
|
||||
SC_TECHNOLOGY_DEFAULT
|
||||
@ -729,6 +732,94 @@ bool InitApplication(HINSTANCE hInstance)
|
||||
}
|
||||
|
||||
|
||||
static int g_aStatusbarSectionWidth[STATUS_SECTOR_COUNT];
|
||||
static int g_aSBSOrder[STATUS_SECTOR_COUNT];
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// _ReadVectorFromString()
|
||||
//
|
||||
//
|
||||
|
||||
static int __fastcall _ReadVectorFromString(LPCWSTR wchStrg, int* iVector, int iCount, int iMin, int iMax, int iDefault)
|
||||
{
|
||||
static WCHAR wchTmpBuff[SMALL_BUFFER];
|
||||
|
||||
StringCchCopyW(wchTmpBuff, COUNTOF(wchTmpBuff), wchStrg);
|
||||
TrimString(wchTmpBuff);
|
||||
// ensure single spaces only
|
||||
WCHAR *p = StrStr(wchTmpBuff, L" ");
|
||||
while (p) {
|
||||
MoveMemory((WCHAR*)p, (WCHAR*)p + 1, (lstrlen(p) + 1) * sizeof(WCHAR));
|
||||
p = StrStr(wchTmpBuff, L" "); // next
|
||||
}
|
||||
// separate values
|
||||
int const len = lstrlen(wchTmpBuff);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
if (wchTmpBuff[i] == L' ') { wchTmpBuff[i] = L'\0'; }
|
||||
}
|
||||
// fill default
|
||||
for (int i = 0; i < iCount; ++i) { iVector[i] = iDefault; }
|
||||
// insert values
|
||||
int n = 0;
|
||||
p = wchTmpBuff;
|
||||
while (*p) {
|
||||
int iValue;
|
||||
if (swscanf_s(p, L"%i", &iValue) == 1) {
|
||||
if ((n < iCount) && (iValue >= iMin) && (iValue <= iMax)) {
|
||||
iVector[n++] = iValue;
|
||||
}
|
||||
}
|
||||
p = StrEnd(p) + 1;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// _StatusbarSetSections()
|
||||
//
|
||||
//
|
||||
static void __fastcall _StatusbarSetSections(int cx)
|
||||
{
|
||||
static int lastCX = -1;
|
||||
if (!bShowStatusbar || (cx == lastCX)) { return; } // static calculation
|
||||
|
||||
// prepare sector array
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
g_aStatusbarSectionWidth[i] = -1;
|
||||
g_aSBSOrder[i] = -1;
|
||||
}
|
||||
|
||||
int vSections[STATUS_SECTOR_COUNT];
|
||||
_ReadVectorFromString(g_tchStatusbarSections, vSections, STATUS_SECTOR_COUNT, 0, (STATUS_SECTOR_COUNT - 1), -1);
|
||||
|
||||
int vWeights[STATUS_SECTOR_COUNT];
|
||||
_ReadVectorFromString(g_tchStatusbarRelWidths, vWeights, STATUS_SECTOR_COUNT, 0, (STATUS_SECTOR_COUNT - 1), 1);
|
||||
|
||||
int cnt = 0;
|
||||
int totalWeight = 0;
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
int const iID = vSections[i];
|
||||
if (iID != -1) {
|
||||
g_aStatusbarSectionWidth[iID] = (cx * vWeights[iID]);
|
||||
totalWeight += vWeights[iID];
|
||||
g_aSBSOrder[cnt++] = iID;
|
||||
}
|
||||
}
|
||||
// normalize
|
||||
if (totalWeight > 0) {
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
if (g_aStatusbarSectionWidth[i] > 0) {
|
||||
g_aStatusbarSectionWidth[i] /= totalWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
lastCX = cx;
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// _InitWindowPosition()
|
||||
@ -828,66 +919,7 @@ static void __fastcall _InitWindowPosition(HWND hwnd)
|
||||
g_WinInfo.x = mi.rcWork.right - g_WinInfo.cx - 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
//
|
||||
// _StatusbarSetSections()
|
||||
//
|
||||
//
|
||||
static int g_aStatusbarSectionWidth[STATUS_SECTOR_COUNT];
|
||||
|
||||
static void __fastcall _StatusbarSetSections(int cx)
|
||||
{
|
||||
static int lastCX = -1;
|
||||
if (!bShowStatusbar || (cx == lastCX)) { return; } // static calculation
|
||||
|
||||
// prepare sector array
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
g_aStatusbarSectionWidth[i] = -1;
|
||||
}
|
||||
|
||||
static WCHAR tchSectors[SMALL_BUFFER];
|
||||
|
||||
StringCchCopy(tchSectors, COUNTOF(tchSectors), g_tchStatusbarSections);
|
||||
TrimString(tchSectors);
|
||||
|
||||
// ensure single spaces only
|
||||
WCHAR *p = StrStr(tchSectors, L" ");
|
||||
while (p) {
|
||||
MoveMemory((WCHAR*)p, (WCHAR*)p + 1, (lstrlen(p) + 1) * sizeof(WCHAR));
|
||||
p = StrStr(tchSectors, L" "); // next
|
||||
}
|
||||
// separate IDs
|
||||
for (int i = 0; i < COUNTOF(tchSectors); ++i) {
|
||||
if (tchSectors[i] == L' ') { tchSectors[i] = L'\0'; }
|
||||
}
|
||||
|
||||
int const weight[STATUS_SECTOR_COUNT] = STATUSBAR_SECTOR_WEIGHTS;
|
||||
|
||||
// fill width
|
||||
int totalWeight = 1;
|
||||
p = tchSectors;
|
||||
while (*p) {
|
||||
int iID;
|
||||
if (swscanf_s(p, L"%i", &iID) == 1) {
|
||||
if ((iID >= 0) && (iID < STATUS_SECTOR_COUNT)) {
|
||||
g_aStatusbarSectionWidth[iID] = (bStatusBarOptimizedSpace ? 0 : (cx * weight[iID]));
|
||||
totalWeight += weight[iID];
|
||||
}
|
||||
}
|
||||
p = StrEnd(p) + 1;
|
||||
}
|
||||
// normalize
|
||||
if (!bStatusBarOptimizedSpace) {
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
if (g_aStatusbarSectionWidth[i] > 0) {
|
||||
g_aStatusbarSectionWidth[i] /= totalWeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
lastCX = cx;
|
||||
_StatusbarSetSections(g_WinInfo.cx);
|
||||
}
|
||||
|
||||
|
||||
@ -1115,8 +1147,6 @@ HWND InitInstance(HINSTANCE hInstance,LPSTR pszCmdLine,int nCmdShow)
|
||||
iReplacedOccurrences = 0;
|
||||
g_iMarkOccurrencesCount = (g_iMarkOccurrences > 0) ? 0 : -1;
|
||||
|
||||
_StatusbarSetSections(g_WinInfo.cx);
|
||||
|
||||
UpdateToolbar();
|
||||
UpdateStatusbar();
|
||||
UpdateLineNumberWidth();
|
||||
@ -5924,7 +5954,7 @@ LRESULT MsgNotify(HWND hwnd,WPARAM wParam,LPARAM lParam)
|
||||
int i;
|
||||
LPNMMOUSE pnmm = (LPNMMOUSE)lParam;
|
||||
|
||||
switch (pnmm->dwItemSpec)
|
||||
switch (g_aSBSOrder[pnmm->dwItemSpec])
|
||||
{
|
||||
case STATUS_DOCLINE:
|
||||
case STATUS_DOCCOLUMN:
|
||||
@ -6324,9 +6354,16 @@ void LoadSettings()
|
||||
iCurrentLineVerticalSlop = IniSectionGetInt(pIniSection, L"CurrentLineVerticalSlop", 5);
|
||||
iCurrentLineVerticalSlop = max(min(iCurrentLineVerticalSlop, 200), 0);
|
||||
|
||||
bStatusBarOptimizedSpace = IniSectionGetBool(pIniSection, L"StatusBarOptimizedSpace", false);
|
||||
g_bStatusBarOptimizedSpace = IniSectionGetBool(pIniSection, L"StatusBarOptimizedSpace", false);
|
||||
IniSectionGetString(pIniSection, L"StatusbarVisibleSections", STATUSBAR_DEFAULT_IDS, g_tchStatusbarSections, COUNTOF(g_tchStatusbarSections));
|
||||
|
||||
g_bUsrDefinedStatusbarWidth = true;
|
||||
IniSectionGetString(pIniSection, L"StatusbarSectionRelWidths", L"", g_tchStatusbarRelWidths, COUNTOF(g_tchStatusbarRelWidths));
|
||||
if (StringCchLenW(g_tchStatusbarRelWidths, COUNTOF(g_tchStatusbarRelWidths)) == 0) {
|
||||
g_bUsrDefinedStatusbarWidth = false;
|
||||
StringCchCopyW(g_tchStatusbarRelWidths, COUNTOF(g_tchStatusbarRelWidths), STATUSBAR_SECTION_WIDTH);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
LoadIniSection(L"Toolbar Images",pIniSection,cchIniSection);
|
||||
// --------------------------------------------------------------------------
|
||||
@ -7333,13 +7370,12 @@ FR_STATES g_FindReplaceMatchFoundState = FND_NOP;
|
||||
|
||||
void UpdateStatusbar()
|
||||
{
|
||||
static WCHAR tchStatusBar[STATUS_SECTOR_COUNT][txtWidth];
|
||||
if (!bShowStatusbar) { return; }
|
||||
|
||||
static WCHAR tchStatusBar[STATUS_SECTOR_COUNT][txtWidth];
|
||||
static WCHAR tchFRStatus[128] = { L'\0' };
|
||||
static WCHAR tchTmp[32] = { L'\0' };
|
||||
|
||||
if (!bShowStatusbar) { return; }
|
||||
|
||||
const DocPos iPos = SciCall_GetCurrentPos();
|
||||
const DocPos iTextLength = SciCall_GetTextLength();
|
||||
const int iEncoding = Encoding_Current(CPI_GET);
|
||||
@ -7470,13 +7506,25 @@ void UpdateStatusbar()
|
||||
}
|
||||
Style_GetCurrentLexerName(tchStatusBar[STATUS_LEXER], txtWidth);
|
||||
|
||||
// Statusbar width
|
||||
// Statusbar widths
|
||||
int aStatusbarSections[STATUS_SECTOR_COUNT];
|
||||
int cnt = 0;
|
||||
int totalWidth = 0;
|
||||
for (int id = 0; id < STATUS_SECTOR_COUNT; ++id) {
|
||||
if (g_aStatusbarSectionWidth[id] >= 0) {
|
||||
totalWidth += max(g_aStatusbarSectionWidth[id], StatusCalcPaneWidth(g_hwndStatus, tchStatusBar[id]));
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
int const id = g_aSBSOrder[i];
|
||||
if ((id >= 0) && (g_aStatusbarSectionWidth[id] >= 0))
|
||||
{
|
||||
if (g_bStatusBarOptimizedSpace)
|
||||
{
|
||||
if (g_bUsrDefinedStatusbarWidth)
|
||||
totalWidth += g_aStatusbarSectionWidth[id];
|
||||
else
|
||||
totalWidth += StatusCalcPaneWidth(g_hwndStatus, tchStatusBar[id]);
|
||||
}
|
||||
else // NOT optimized
|
||||
{
|
||||
totalWidth += max(g_aStatusbarSectionWidth[id], StatusCalcPaneWidth(g_hwndStatus, tchStatusBar[id]));
|
||||
}
|
||||
aStatusbarSections[cnt++] = totalWidth;
|
||||
}
|
||||
}
|
||||
@ -7487,8 +7535,9 @@ void UpdateStatusbar()
|
||||
SendMessage(g_hwndStatus, SB_SETPARTS, (WPARAM)cnt, (LPARAM)aStatusbarSections);
|
||||
|
||||
cnt = 0;
|
||||
for (int id = 0; id < STATUS_SECTOR_COUNT; ++id) {
|
||||
if (g_aStatusbarSectionWidth[id] >= 0) {
|
||||
for (int i = 0; i < STATUS_SECTOR_COUNT; ++i) {
|
||||
int const id = g_aSBSOrder[i];
|
||||
if ((id >= 0) && (g_aStatusbarSectionWidth[id] >= 0)) {
|
||||
StatusSetText(g_hwndStatus, cnt++, tchStatusBar[id]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ typedef enum {
|
||||
} STATUS_SECTOR_T;
|
||||
|
||||
#define STATUSBAR_DEFAULT_IDS L"0 1 2 3 4 5 6 7 8 9 10"
|
||||
#define STATUSBAR_SECTOR_WEIGHTS { 2, 2, 3, 2, 2, 2, 2, 1, 1, 1, 3 }
|
||||
#define STATUSBAR_SECTION_WIDTH L"2 2 3 2 2 2 2 1 1 1 3"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
// //////////////////////////////////////////////////////////
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 18
|
||||
#define VERSION_REV 422
|
||||
#define VERSION_BUILD 952
|
||||
#define VERSION_REV 424
|
||||
#define VERSION_BUILD 990
|
||||
#define SCINTILLA_VER 404
|
||||
#define ONIGMO_REGEX_VER 6.1.3
|
||||
#define VERSION_PATCH L" RC"
|
||||
#define VERSIONA_PATCH " RC"
|
||||
#define VERSION_PATCH L" develop"
|
||||
#define VERSIONA_PATCH " develop"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user