From 4dc91867e5741c6c121735547a00722fe166269e Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Mon, 4 Jun 2001 03:40:38 +0000 Subject: [PATCH] Fixed undo of del to EOL --- golded3/geedit.cpp | 6 ++++-- golded3/geedit2.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/golded3/geedit.cpp b/golded3/geedit.cpp index fce3f2f..75e88f5 100644 --- a/golded3/geedit.cpp +++ b/golded3/geedit.cpp @@ -1487,8 +1487,10 @@ void IEclass::DeleteEOL() { currline->txt.erase(col); - if(_has_linefeed) + if(_has_linefeed) { + Undo->PushItem(EDIT_UNDO_INS_CHAR|BATCH_MODE); currline->txt += "\n"; + } clreol(); @@ -2444,7 +2446,7 @@ void UndoStack::PushItem(uint action, Line* __line, uint __col, uint __len) { last_item->line = __line; __col = last_item->col.num; if(__len == NO_VALUE) - __len = __line->txt.length() - __col + 1; + __len = __line->txt.length() - __col; throw_new(last_item->data.text_ptr = new(__len) text_item(__col, __len)); memcpy(last_item->data.text_ptr->text, __line->txt.c_str() + __col, __len); break; diff --git a/golded3/geedit2.cpp b/golded3/geedit2.cpp index fb3dab3..1f42690 100644 --- a/golded3/geedit2.cpp +++ b/golded3/geedit2.cpp @@ -740,6 +740,7 @@ void IEclass::BlockPaste() { Line* _newline = insertlinebelow(currline, currline->txt.c_str()+col, BATCH_MODE); currline->txt.erase(col); currline->txt += _pasteline->txt; + Undo->PushItem(EDIT_UNDO_INS_TEXT|BATCH_MODE, currline, col, pastelen); setlinetype(currline); col = currline->txt.length(); wrapins(&currline, &col, &row, false);