undo of cutted text fixed
This commit is contained in:
parent
4d2f5ae1e5
commit
5c5191aafe
@ -2412,6 +2412,8 @@ void UndoStack::PushItem(uint action, Line* __line, uint __col, uint __len) {
|
||||
case EDIT_UNDO_INS_TEXT:
|
||||
case EDIT_UNDO_WRAP_TEXT:
|
||||
last_item->line = __line;
|
||||
if(__len == NO_VALUE)
|
||||
__len = __line->txt.length() - __col + 1;
|
||||
throw_new(last_item->data.text_ptr = new text_item(__col, __len));
|
||||
break;
|
||||
case EDIT_UNDO_NEW_LINE:
|
||||
|
@ -632,9 +632,11 @@ void IEclass::BlockDel(Line* anchor) {
|
||||
// are now pointing where they should
|
||||
|
||||
if(firstcutline != lastcutline) {
|
||||
Undo->PushItem(EDIT_UNDO_DEL_TEXT, firstcutline, firstcol);
|
||||
firstcutline->txt.erase(firstcol);
|
||||
size_t __len = firstcutline->txt.length();
|
||||
firstcutline->txt += lastcutline->txt.c_str()+lastcol;
|
||||
Undo->PushItem(EDIT_UNDO_INS_TEXT, firstcutline, __len);
|
||||
Undo->PushItem(EDIT_UNDO_DEL_TEXT|BATCH_MODE, firstcutline, firstcol, __len);
|
||||
firstcutline->txt.erase(firstcol, __len);
|
||||
}
|
||||
else {
|
||||
Undo->PushItem(EDIT_UNDO_DEL_TEXT, firstcutline, firstcol, lastcol-firstcol);
|
||||
|
@ -428,8 +428,6 @@ static void w_brag() {
|
||||
wcenters(MAXROW-9, C_BRAGW, buf);
|
||||
sprintf(buf, "Compiled on %s %s", __gver_date__, __gver_time__);
|
||||
wcenters(MAXROW-8, C_BRAGW, buf);
|
||||
|
||||
update_statusline(LNG->Initializing);
|
||||
}
|
||||
|
||||
|
||||
@ -853,6 +851,8 @@ void Initialize(int argc, char* argv[]) {
|
||||
w_back(); // Open a nice background window
|
||||
w_brag(); // Display Brag Window
|
||||
|
||||
update_statusline(LNG->Initializing);
|
||||
|
||||
HandleGEvent(EVTT_STARTUP);
|
||||
|
||||
// Write the binary config if any of the cfgs were compiled.
|
||||
|
Reference in New Issue
Block a user