Fixed string subscript out of range bug in editors undo stack.

This commit is contained in:
Ianos Gnatiuc 2006-06-25 07:45:12 +00:00
parent dd8361bf25
commit b5719339a2
3 changed files with 13 additions and 8 deletions

View File

@ -10,6 +10,8 @@ _____________________________________________________________________________
‡ ¬Ąâި ¤«ď GoldED+ 1.1.5, /snapshot/ ‡ ¬Ąâި ¤«ď GoldED+ 1.1.5, /snapshot/
_____________________________________________________________________________ _____________________________________________________________________________
- ˆá¯à ¢«¥­ ¡ £ ¢ á⥪¥ ®âª â  । ªâ®à , ¯à¨ ª®â®à®¬ £®«¤¥¤ ¯à®¡®¢ « ¯à®ç¥áâì ¯®
¨­¤¥ªáã ¡®«ìè¥ ç¥¬ à §¬¥à áâப¨.
+ „®ˇ ˘«Ą­ ReadForceDeleteMsg (Ż® 㬮«ç ­¨î #Del) ˘ goldkeys.cfg ¤«ď 㤠«Ą­¨ď + „®ˇ ˘«Ą­ ReadForceDeleteMsg (Ż® 㬮«ç ­¨î #Del) ˘ goldkeys.cfg ¤«ď 㤠«Ą­¨ď
á®®ˇéĄ­¨© ¬¨­ăď AreaRecicleBin. á®®ˇéĄ­¨© ¬¨­ăď AreaRecicleBin.
! <20>§¬Ą­Ą­ë Ż ŕ ¬Ąâŕë AreaRecycleBin ­  AreaRecycleBin <area> [NoAsk/Ask]. ! <20>§¬Ą­Ą­ë Ż ŕ ¬Ąâŕë AreaRecycleBin ­  AreaRecycleBin <area> [NoAsk/Ask].

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
- Fixed string subscript out of range in editors undo stack.
+ Added ReadForceDeleteMsg (default is #Del) to the goldkeys.cfg used to + Added ReadForceDeleteMsg (default is #Del) to the goldkeys.cfg used to
delete messages without moving them to AreaRecicleBin. delete messages without moving them to AreaRecicleBin.

View File

@ -1063,26 +1063,27 @@ Line* IEclass::wrapit(Line** __currline, uint* __curr_col, uint* __curr_row, boo
} }
} }
// Was this line truncated at space?
bool truncated_at_space = make_bool(isspace(_thisline->txt[_wrappos]));
// Truncate at the wrapping location // Truncate at the wrapping location
_thisline->txt.erase(_wrappos); _thisline->txt.erase(_wrappos);
// Was this line quoted? // Was this line quoted?
if(_quotelen) { if (_quotelen)
{
// Trim spaces off the end of the line // Trim spaces off the end of the line
int _trimpos = _wrappos - 1; int _trimpos = _wrappos - 1;
if(isspace(_thisline->txt[_trimpos])) { if (isspace(_thisline->txt[_trimpos]))
while(_trimpos > 0 and isspace(_thisline->txt[_trimpos-1])) {
while (_trimpos > 0 and isspace(_thisline->txt[_trimpos-1]))
_trimpos--; _trimpos--;
if(_quotelen and (_trimpos < _quotelen)) if(_quotelen and (_trimpos < _quotelen))
_trimpos++; _trimpos++;
Undo->PushItem(EDIT_UNDO_OVR_CHAR|BATCH_MODE, _thisline, _trimpos); Undo->PushItem(EDIT_UNDO_OVR_CHAR|BATCH_MODE, _thisline, _trimpos);
_thisline->txt.erase(_trimpos); _thisline->txt.erase(_trimpos);
} }
Undo->PushItem((truncated_at_space?EDIT_UNDO_OVR_CHAR:EDIT_UNDO_INS_CHAR)|BATCH_MODE, _thisline, _trimpos+1); else
{
Undo->PushItem(EDIT_UNDO_INS_CHAR|BATCH_MODE, _thisline, _trimpos + 1);
}
// Append a new linefeed // Append a new linefeed
_thisline->txt += "\n"; _thisline->txt += "\n";