mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-07 09:06:48 +01:00
Fix to 1st line charCount & simplifying endPos.ch
If our result is within the first line, add 1 to it to fix offset No need to have ternary case for replace all, this is now done with a regex
This commit is contained in:
@@ -958,14 +958,15 @@ var ICEcoder = {
|
||||
}
|
||||
|
||||
charCount = ICEcoder.results[ICEcoder.findResult] - numChars - 1;
|
||||
if (ICEcoder.results[ICEcoder.findResult]<=cM.lineInfo(0).text.length) {
|
||||
charCount++;
|
||||
}
|
||||
startPos = new Object();
|
||||
startPos.line = lineCount;
|
||||
startPos.ch = charCount;
|
||||
endPos = new Object();
|
||||
endPos.line = lineCount;
|
||||
document.findAndReplace.connector.value=="and" && document.findAndReplace.replaceAction.value=="replace all" && buttonClick
|
||||
? endPos.ch = charCount+replaceLen
|
||||
: endPos.ch = charCount+findLen;
|
||||
endPos.ch = charCount+findLen;
|
||||
// Finally, highlight our selection
|
||||
cM = ICEcoder.getcMInstance();
|
||||
cM.setSelection(startPos, endPos);
|
||||
|
||||
Reference in New Issue
Block a user