Few undo fixes, fixed char deletion after del to eol
This commit is contained in:
parent
a00d404cb8
commit
ed39a2ea9c
@ -979,6 +979,10 @@ void IEclass::insertchar(char __ch) {
|
|||||||
if(currline->prev and not currline->prev->txt.empty() and
|
if(currline->prev and not currline->prev->txt.empty() and
|
||||||
(currline->prev->txt.find('\n') == currline->prev->txt.npos) and
|
(currline->prev->txt.find('\n') == currline->prev->txt.npos) and
|
||||||
not isspace(currline->prev->txt[currline->prev->txt.length()-1])) {
|
not isspace(currline->prev->txt[currline->prev->txt.length()-1])) {
|
||||||
|
if(not batch_mode) {
|
||||||
|
Undo->PushItem(EDIT_UNDO_VOID);
|
||||||
|
batch_mode = BATCH_MODE;
|
||||||
|
}
|
||||||
GoUp();
|
GoUp();
|
||||||
GoEOL();
|
GoEOL();
|
||||||
}
|
}
|
||||||
@ -1038,8 +1042,12 @@ void IEclass::DelChar() {
|
|||||||
_thisline->txt.erase(col, 1);
|
_thisline->txt.erase(col, 1);
|
||||||
batch_mode = BATCH_MODE;
|
batch_mode = BATCH_MODE;
|
||||||
}
|
}
|
||||||
else if((col == _thislen) && _nextline) {
|
else if(col and (col == _thislen) and _nextline) {
|
||||||
GFTRK(NULL);
|
GFTRK(NULL);
|
||||||
|
if(not batch_mode) {
|
||||||
|
Undo->PushItem(EDIT_UNDO_VOID);
|
||||||
|
batch_mode = BATCH_MODE;
|
||||||
|
}
|
||||||
GoRight();
|
GoRight();
|
||||||
DelChar();
|
DelChar();
|
||||||
return;
|
return;
|
||||||
@ -1123,6 +1131,10 @@ void IEclass::DelLeft() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Go left(/up) and delete the character there
|
// Go left(/up) and delete the character there
|
||||||
|
if(not batch_mode) {
|
||||||
|
Undo->PushItem(EDIT_UNDO_VOID);
|
||||||
|
batch_mode = BATCH_MODE;
|
||||||
|
}
|
||||||
GoLeft();
|
GoLeft();
|
||||||
DelChar();
|
DelChar();
|
||||||
|
|
||||||
@ -1324,8 +1336,9 @@ void IEclass::DupLine() {
|
|||||||
GFTRK("EditDupLine");
|
GFTRK("EditDupLine");
|
||||||
|
|
||||||
Undo->PushItem(EDIT_UNDO_VOID);
|
Undo->PushItem(EDIT_UNDO_VOID);
|
||||||
|
batch_mode = BATCH_MODE;
|
||||||
|
|
||||||
Line* _nextline = insertlinebelow(currline, currline->txt.c_str(), BATCH_MODE);
|
Line* _nextline = insertlinebelow(currline, currline->txt.c_str(), batch_mode);
|
||||||
_nextline->type = currline->type & ~GLINE_BLOK;
|
_nextline->type = currline->type & ~GLINE_BLOK;
|
||||||
_nextline->color = currline->color;
|
_nextline->color = currline->color;
|
||||||
_nextline->kludge = currline->kludge;
|
_nextline->kludge = currline->kludge;
|
||||||
@ -1861,8 +1874,13 @@ void IEclass::Reflow() {
|
|||||||
|
|
||||||
// Skip empty lines
|
// Skip empty lines
|
||||||
while(isempty()) {
|
while(isempty()) {
|
||||||
if(currline->next)
|
if(currline->next) {
|
||||||
|
if(not batch_mode) {
|
||||||
|
Undo->PushItem(EDIT_UNDO_VOID);
|
||||||
|
batch_mode = BATCH_MODE;
|
||||||
|
}
|
||||||
GoDown();
|
GoDown();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
GFTRK(NULL);
|
GFTRK(NULL);
|
||||||
return;
|
return;
|
||||||
@ -1879,7 +1897,7 @@ void IEclass::Reflow() {
|
|||||||
const char* ptr = _qlenptr;
|
const char* ptr = _qlenptr;
|
||||||
while(*ptr and isspace(*ptr) and (*ptr != '\n')) ptr++;
|
while(*ptr and isspace(*ptr) and (*ptr != '\n')) ptr++;
|
||||||
if(ptr != _qlenptr) {
|
if(ptr != _qlenptr) {
|
||||||
Undo->PushItem(EDIT_UNDO_DEL_TEXT, currline, _qlen1, ptr-_qlenptr);
|
Undo->PushItem(EDIT_UNDO_DEL_TEXT|batch_mode, currline, _qlen1, ptr-_qlenptr);
|
||||||
currline->txt.erase(_qlen1, ptr-_qlenptr);
|
currline->txt.erase(_qlen1, ptr-_qlenptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user