From 5c5191aafed7720d6f49db0a5879866043f6eda6 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Tue, 20 Feb 2001 21:29:42 +0000 Subject: [PATCH] undo of cutted text fixed --- golded3/geedit.cpp | 2 ++ golded3/geedit2.cpp | 6 ++++-- golded3/geinit.cpp | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/golded3/geedit.cpp b/golded3/geedit.cpp index 74ee332..b8351d4 100644 --- a/golded3/geedit.cpp +++ b/golded3/geedit.cpp @@ -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: diff --git a/golded3/geedit2.cpp b/golded3/geedit2.cpp index 9d19814..d0428ce 100644 --- a/golded3/geedit2.cpp +++ b/golded3/geedit2.cpp @@ -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); diff --git a/golded3/geinit.cpp b/golded3/geinit.cpp index 0db077f..a4406f4 100644 --- a/golded3/geinit.cpp +++ b/golded3/geinit.cpp @@ -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.