undo of cutted text fixed

This commit is contained in:
Alexander S. Aganichev 2001-02-20 21:29:42 +00:00
parent 4d2f5ae1e5
commit 5c5191aafe
3 changed files with 8 additions and 4 deletions

View File

@ -2412,6 +2412,8 @@ void UndoStack::PushItem(uint action, Line* __line, uint __col, uint __len) {
case EDIT_UNDO_INS_TEXT: case EDIT_UNDO_INS_TEXT:
case EDIT_UNDO_WRAP_TEXT: case EDIT_UNDO_WRAP_TEXT:
last_item->line = __line; 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)); throw_new(last_item->data.text_ptr = new text_item(__col, __len));
break; break;
case EDIT_UNDO_NEW_LINE: case EDIT_UNDO_NEW_LINE:

View File

@ -632,9 +632,11 @@ void IEclass::BlockDel(Line* anchor) {
// are now pointing where they should // are now pointing where they should
if(firstcutline != lastcutline) { if(firstcutline != lastcutline) {
Undo->PushItem(EDIT_UNDO_DEL_TEXT, firstcutline, firstcol); size_t __len = firstcutline->txt.length();
firstcutline->txt.erase(firstcol);
firstcutline->txt += lastcutline->txt.c_str()+lastcol; 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 { else {
Undo->PushItem(EDIT_UNDO_DEL_TEXT, firstcutline, firstcol, lastcol-firstcol); Undo->PushItem(EDIT_UNDO_DEL_TEXT, firstcutline, firstcol, lastcol-firstcol);

View File

@ -428,8 +428,6 @@ static void w_brag() {
wcenters(MAXROW-9, C_BRAGW, buf); wcenters(MAXROW-9, C_BRAGW, buf);
sprintf(buf, "Compiled on %s %s", __gver_date__, __gver_time__); sprintf(buf, "Compiled on %s %s", __gver_date__, __gver_time__);
wcenters(MAXROW-8, C_BRAGW, buf); 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_back(); // Open a nice background window
w_brag(); // Display Brag Window w_brag(); // Display Brag Window
update_statusline(LNG->Initializing);
HandleGEvent(EVTT_STARTUP); HandleGEvent(EVTT_STARTUP);
// Write the binary config if any of the cfgs were compiled. // Write the binary config if any of the cfgs were compiled.