mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ide: Fixed freeze on empty block replace
git-svn-id: svn://ultimatepp.org/upp/trunk@15563 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5895e90a99
commit
c5bab37f6c
1 changed files with 3 additions and 1 deletions
|
|
@ -550,13 +550,15 @@ int CodeEditor::BlockReplace()
|
|||
foundpos = l;
|
||||
Index<int> ln;
|
||||
StartSearchProgress(l, h);
|
||||
while(FindFrom(foundpos, false, true) && foundpos + foundsize <= h) {
|
||||
while(foundpos < GetLength() && FindFrom(foundpos, false, true) && foundpos + foundsize <= h) {
|
||||
CachePos(foundpos);
|
||||
if(~findreplace.mode == 0) {
|
||||
Remove((int)foundpos, foundsize);
|
||||
WString rt = GetReplaceText();
|
||||
Insert((int)foundpos, rt);
|
||||
foundpos += rt.GetCount();
|
||||
if(foundsize + rt.GetCount() == 0 && foundpos < GetLength())
|
||||
foundpos++;
|
||||
h = h - foundsize + rt.GetCount();
|
||||
count++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue