Use Scitilla default 64 bits symbol

This commit is contained in:
Don Ho 2022-10-30 01:09:28 +02:00
parent c3ffe35492
commit 513ee3e3fe
6 changed files with 39 additions and 39 deletions

View File

@ -1993,7 +1993,7 @@ bool Notepad_plus::findInCurrentFile(bool isEntireDoc)
int nbTotal = 0; int nbTotal = 0;
Buffer * pBuf = _pEditView->getCurrentBuffer(); Buffer * pBuf = _pEditView->getCurrentBuffer();
Sci_CharacterRange mainSelection = _pEditView->getSelection(); // remember selection before switching view Sci_CharacterRangeFull mainSelection = _pEditView->getSelection(); // remember selection before switching view
ScintillaEditView *pOldView = _pEditView; ScintillaEditView *pOldView = _pEditView;
_pEditView = &_invisibleEditView; _pEditView = &_invisibleEditView;

View File

@ -355,7 +355,7 @@ private:
bool _isFolding = false; bool _isFolding = false;
//For Dynamic selection highlight //For Dynamic selection highlight
Sci_CharacterRange _prevSelectedRange; Sci_CharacterRangeFull _prevSelectedRange;
//Synchronized Scolling //Synchronized Scolling
struct SyncInfo final struct SyncInfo final

View File

@ -1440,12 +1440,12 @@ void Notepad_plus::command(int id)
else // (id == IDM_SEARCH_MARKONEEXT5) else // (id == IDM_SEARCH_MARKONEEXT5)
styleID = SCE_UNIVERSAL_FOUND_STYLE_EXT5; styleID = SCE_UNIVERSAL_FOUND_STYLE_EXT5;
Sci_CharacterRange range = _pEditView->getSelection(); Sci_CharacterRangeFull range = _pEditView->getSelection();
if (range.cpMin == range.cpMax) if (range.cpMin == range.cpMax)
{ {
auto caretPos = _pEditView->execute(SCI_GETCURRENTPOS, 0, 0); auto caretPos = _pEditView->execute(SCI_GETCURRENTPOS, 0, 0);
range.cpMin = static_cast<Sci_PositionCR>(_pEditView->execute(SCI_WORDSTARTPOSITION, caretPos, true)); range.cpMin = _pEditView->execute(SCI_WORDSTARTPOSITION, caretPos, true);
range.cpMax = static_cast<Sci_PositionCR>(_pEditView->execute(SCI_WORDENDPOSITION, caretPos, true)); range.cpMax = _pEditView->execute(SCI_WORDENDPOSITION, caretPos, true);
} }
if (range.cpMax > range.cpMin) if (range.cpMax > range.cpMin)
{ {

View File

@ -1428,7 +1428,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
{ {
if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE) if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE)
{ {
Sci_CharacterRange cr = (*_ppEditView)->getSelection(); Sci_CharacterRangeFull cr = (*_ppEditView)->getSelection();
intptr_t nbSelected = cr.cpMax - cr.cpMin; intptr_t nbSelected = cr.cpMax - cr.cpMin;
_options._isInSelection = isCheckedOrNot(IDC_IN_SELECTION_CHECK)?1:0; _options._isInSelection = isCheckedOrNot(IDC_IN_SELECTION_CHECK)?1:0;
@ -2256,7 +2256,7 @@ bool FindReplaceDlg::processFindNext(const TCHAR *txt2find, const FindOption *op
} }
intptr_t docLength = (*_ppEditView)->execute(SCI_GETLENGTH); intptr_t docLength = (*_ppEditView)->execute(SCI_GETLENGTH);
Sci_CharacterRange cr = (*_ppEditView)->getSelection(); Sci_CharacterRangeFull cr = (*_ppEditView)->getSelection();
//The search "zone" is relative to the selection, so search happens 'outside' //The search "zone" is relative to the selection, so search happens 'outside'
@ -2445,13 +2445,13 @@ bool FindReplaceDlg::processReplace(const TCHAR *txt2find, const TCHAR *txt2repl
FindOption replaceOptions = options ? *options : *_env; FindOption replaceOptions = options ? *options : *_env;
replaceOptions._incrementalType = FirstIncremental; replaceOptions._incrementalType = FirstIncremental;
Sci_CharacterRange currentSelection = (*_ppEditView)->getSelection(); Sci_CharacterRangeFull currentSelection = (*_ppEditView)->getSelection();
FindStatus status; FindStatus status;
moreMatches = processFindNext(txt2find, &replaceOptions, &status, FINDNEXTTYPE_FINDNEXTFORREPLACE); moreMatches = processFindNext(txt2find, &replaceOptions, &status, FINDNEXTTYPE_FINDNEXTFORREPLACE);
if (moreMatches) if (moreMatches)
{ {
Sci_CharacterRange nextFind = (*_ppEditView)->getSelection(); Sci_CharacterRangeFull nextFind = (*_ppEditView)->getSelection();
// If the next find is the same as the last, then perform the replacement // If the next find is the same as the last, then perform the replacement
if (nextFind.cpMin == currentSelection.cpMin && nextFind.cpMax == currentSelection.cpMax) if (nextFind.cpMin == currentSelection.cpMin && nextFind.cpMax == currentSelection.cpMax)
@ -2567,7 +2567,7 @@ int FindReplaceDlg::processAll(ProcessOperation op, const FindOption *opt, bool
const TCHAR *txt2find = pOptions->_str2Search.c_str(); const TCHAR *txt2find = pOptions->_str2Search.c_str();
const TCHAR *txt2replace = pOptions->_str4Replace.c_str(); const TCHAR *txt2replace = pOptions->_str4Replace.c_str();
Sci_CharacterRange cr = (*_ppEditView)->getSelection(); Sci_CharacterRangeFull cr = (*_ppEditView)->getSelection();
size_t docLength = (*_ppEditView)->execute(SCI_GETLENGTH); size_t docLength = (*_ppEditView)->execute(SCI_GETLENGTH);
// Default : // Default :
@ -3825,7 +3825,7 @@ void FindReplaceDlg::clearMarks(const FindOption& opt)
{ {
if (opt._isInSelection) if (opt._isInSelection)
{ {
Sci_CharacterRange cr = (*_ppEditView)->getSelection(); Sci_CharacterRangeFull cr = (*_ppEditView)->getSelection();
intptr_t startPosition = cr.cpMin; intptr_t startPosition = cr.cpMin;
intptr_t endPosition = cr.cpMax; intptr_t endPosition = cr.cpMax;
@ -5178,7 +5178,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
// selected (no change, if there was no selection) // selected (no change, if there was no selection)
if (updateCase && !isFound) if (updateCase && !isFound)
{ {
Sci_CharacterRange range = (*(_pFRDlg->_ppEditView))->getSelection(); Sci_CharacterRangeFull range = (*(_pFRDlg->_ppEditView))->getSelection();
(*(_pFRDlg->_ppEditView))->execute(SCI_SETSEL, static_cast<WPARAM>(-1), range.cpMin); (*(_pFRDlg->_ppEditView))->execute(SCI_SETSEL, static_cast<WPARAM>(-1), range.cpMin);
} }
} }
@ -5226,7 +5226,7 @@ void FindIncrementDlg::markSelectedTextInc(bool enable, FindOption *opt)
return; return;
//Get selection //Get selection
Sci_CharacterRange range = (*(_pFRDlg->_ppEditView))->getSelection(); Sci_CharacterRangeFull range = (*(_pFRDlg->_ppEditView))->getSelection();
//If nothing selected, dont mark anything //If nothing selected, dont mark anything
if (range.cpMin == range.cpMax) if (range.cpMin == range.cpMax)

View File

@ -415,7 +415,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
// get the current text selection // get the current text selection
Sci_CharacterRange range = getSelection(); Sci_CharacterRangeFull range = getSelection();
if (range.cpMax == range.cpMin) if (range.cpMax == range.cpMin)
{ {
// no selection: select the current word instead // no selection: select the current word instead
@ -2379,15 +2379,15 @@ char * ScintillaEditView::getSelectedText(char * txt, size_t size, bool expand)
{ {
if (!size) if (!size)
return NULL; return NULL;
Sci_CharacterRange range = getSelection(); Sci_CharacterRangeFull range = getSelection();
if (range.cpMax == range.cpMin && expand) if (range.cpMax == range.cpMin && expand)
{ {
expandWordSelection(); expandWordSelection();
range = getSelection(); range = getSelection();
} }
if (!(static_cast<Sci_PositionCR>(size) > (range.cpMax - range.cpMin))) //there must be atleast 1 byte left for zero terminator if (!(static_cast<Sci_Position>(size) > (range.cpMax - range.cpMin))) //there must be atleast 1 byte left for zero terminator
{ {
range.cpMax = range.cpMin + (Sci_PositionCR)size -1; //keep room for zero terminator range.cpMax = range.cpMin + size -1; //keep room for zero terminator
} }
//getText(txt, range.cpMin, range.cpMax); //getText(txt, range.cpMin, range.cpMax);
return getWordFromRange(txt, size, range.cpMin, range.cpMax); return getWordFromRange(txt, size, range.cpMin, range.cpMax);
@ -2790,40 +2790,40 @@ void ScintillaEditView::showIndentGuideLine(bool willBeShowed)
void ScintillaEditView::setLineIndent(size_t line, size_t indent) const void ScintillaEditView::setLineIndent(size_t line, size_t indent) const
{ {
Sci_CharacterRange crange = getSelection(); Sci_CharacterRangeFull crange = getSelection();
size_t posBefore = execute(SCI_GETLINEINDENTPOSITION, line); int64_t posBefore = execute(SCI_GETLINEINDENTPOSITION, line);
execute(SCI_SETLINEINDENTATION, line, indent); execute(SCI_SETLINEINDENTATION, line, indent);
size_t posAfter = execute(SCI_GETLINEINDENTPOSITION, line); int64_t posAfter = execute(SCI_GETLINEINDENTPOSITION, line);
long long posDifference = posAfter - posBefore; long long posDifference = posAfter - posBefore;
if (posAfter > posBefore) if (posAfter > posBefore)
{ {
// Move selection on // Move selection on
if (crange.cpMin >= static_cast<Sci_PositionCR>(posBefore)) if (crange.cpMin >= posBefore)
{ {
crange.cpMin += static_cast<Sci_PositionCR>(posDifference); crange.cpMin += posDifference;
} }
if (crange.cpMax >= static_cast<Sci_PositionCR>(posBefore)) if (crange.cpMax >= posBefore)
{ {
crange.cpMax += static_cast<Sci_PositionCR>(posDifference); crange.cpMax += posDifference;
} }
} }
else if (posAfter < posBefore) else if (posAfter < posBefore)
{ {
// Move selection back // Move selection back
if (crange.cpMin >= static_cast<Sci_PositionCR>(posAfter)) if (crange.cpMin >= posAfter)
{ {
if (crange.cpMin >= static_cast<Sci_PositionCR>(posBefore)) if (crange.cpMin >= posBefore)
crange.cpMin += static_cast<Sci_PositionCR>(posDifference); crange.cpMin += posDifference;
else else
crange.cpMin = static_cast<Sci_PositionCR>(posAfter); crange.cpMin = posAfter;
} }
if (crange.cpMax >= static_cast<Sci_PositionCR>(posAfter)) if (crange.cpMax >= posAfter)
{ {
if (crange.cpMax >= static_cast<Sci_PositionCR>(posBefore)) if (crange.cpMax >= posBefore)
crange.cpMax += static_cast<Sci_PositionCR>(posDifference); crange.cpMax += posDifference;
else else
crange.cpMax = static_cast<Sci_PositionCR>(posAfter); crange.cpMax = posAfter;
} }
} }
execute(SCI_SETSEL, crange.cpMin, crange.cpMax); execute(SCI_SETSEL, crange.cpMin, crange.cpMax);

View File

@ -233,7 +233,7 @@ public:
void replaceSelWith(const char * replaceText); void replaceSelWith(const char * replaceText);
intptr_t getSelectedTextCount() { intptr_t getSelectedTextCount() {
Sci_CharacterRange range = getSelection(); Sci_CharacterRangeFull range = getSelection();
return (range.cpMax - range.cpMin); return (range.cpMax - range.cpMin);
}; };
@ -271,10 +271,10 @@ public:
return size_t(execute(SCI_GETLENGTH)); return size_t(execute(SCI_GETLENGTH));
}; };
Sci_CharacterRange getSelection() const { Sci_CharacterRangeFull getSelection() const {
Sci_CharacterRange crange{}; Sci_CharacterRangeFull crange{};
crange.cpMin = static_cast<Sci_PositionCR>(execute(SCI_GETSELECTIONSTART)); crange.cpMin = execute(SCI_GETSELECTIONSTART);
crange.cpMax = static_cast<Sci_PositionCR>(execute(SCI_GETSELECTIONEND)); crange.cpMax = execute(SCI_GETSELECTIONEND);
return crange; return crange;
}; };
@ -543,8 +543,8 @@ public:
void runMarkers(bool doHide, size_t searchStart, bool endOfDoc, bool doDelete); void runMarkers(bool doHide, size_t searchStart, bool endOfDoc, bool doDelete);
bool isSelecting() const { bool isSelecting() const {
static Sci_CharacterRange previousSelRange = getSelection(); static Sci_CharacterRangeFull previousSelRange = getSelection();
Sci_CharacterRange currentSelRange = getSelection(); Sci_CharacterRangeFull currentSelRange = getSelection();
if (currentSelRange.cpMin == currentSelRange.cpMax) if (currentSelRange.cpMin == currentSelRange.cpMax)
{ {