mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
[BUG_FIXED] Fix column editor insert number bug in virtual space mode.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@551 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
cc3ce1a5a4
commit
8c3485289f
@ -7627,8 +7627,8 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
||||
//--Status Bar Section--//
|
||||
bool willBeShown = nppGUI._statusBarShow;
|
||||
_statusBar.init(_hInst, hwnd, 6);
|
||||
_statusBar.setPartWidth(STATUSBAR_DOC_SIZE, 250);
|
||||
_statusBar.setPartWidth(STATUSBAR_CUR_POS, 300);
|
||||
_statusBar.setPartWidth(STATUSBAR_DOC_SIZE, 200);
|
||||
_statusBar.setPartWidth(STATUSBAR_CUR_POS, 250);
|
||||
_statusBar.setPartWidth(STATUSBAR_EOF_FORMAT, 80);
|
||||
_statusBar.setPartWidth(STATUSBAR_UNICODE_TYPE, 100);
|
||||
_statusBar.setPartWidth(STATUSBAR_TYPING_MODE, 30);
|
||||
|
@ -2502,6 +2502,16 @@ void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, int initial, int in
|
||||
|
||||
int2str(str, stringSize, initial, base, nb, isZeroLeading);
|
||||
|
||||
bool hasVirtualSpc = cmi[i]._nbVirtualAnchorSpc > 0;
|
||||
if (hasVirtualSpc) // if virtual space is present, then insert space
|
||||
{
|
||||
for (int j = 0, k = cmi[i]._selLpos; j < cmi[i]._nbVirtualCaretSpc ; j++, k++)
|
||||
{
|
||||
execute(SCI_INSERTTEXT, k, (LPARAM)" ");
|
||||
}
|
||||
cmi[i]._selLpos += cmi[i]._nbVirtualAnchorSpc;
|
||||
cmi[i]._selRpos += cmi[i]._nbVirtualCaretSpc;
|
||||
}
|
||||
execute(SCI_SETTARGETSTART, cmi[i]._selLpos);
|
||||
execute(SCI_SETTARGETEND, cmi[i]._selRpos);
|
||||
#ifdef UNICODE
|
||||
@ -2513,7 +2523,17 @@ void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, int initial, int in
|
||||
execute(SCI_REPLACETARGET, (WPARAM)-1, (LPARAM)str);
|
||||
#endif
|
||||
initial += incr;
|
||||
totalDiff += diff;
|
||||
if (hasVirtualSpc)
|
||||
{
|
||||
totalDiff += cmi[i]._nbVirtualAnchorSpc + lstrlen(str);
|
||||
// Now there's no more virtual space
|
||||
cmi[i]._nbVirtualAnchorSpc = 0;
|
||||
cmi[i]._nbVirtualCaretSpc = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
totalDiff += diff;
|
||||
}
|
||||
cmi[i]._selRpos += diff;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user