mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-06 08:44:02 +01:00
Extra code to find target tag
Without this extra code, we would just be finding the previous tag with the matching name and not consider the depth. This code sets the cursor inside the potentially correct tag, gets the nest location without updating the display and if it's not at the correct depth, do i++ so we end up with another for loop to find the tag previous to that one and so on. The only way to escape out of this is to find a tag at the right depth. Set ch before line in the object, so it's similar to the order of the endPos object.
This commit is contained in:
@@ -309,13 +309,25 @@ var ICEcoder = {
|
||||
cursor.findPrevious();
|
||||
searchPos.ch = cursor.from().ch;
|
||||
searchPos.line = cursor.from().line;
|
||||
if (i==nestPos && 1==2) {
|
||||
cursorX = cM.getSearchCursor(">",searchPos);
|
||||
cursorX.findNext();
|
||||
searchPosX = new Object();
|
||||
searchPosX.ch = cursorX.from().ch+1;
|
||||
searchPosX.line = cursorX.from().line;
|
||||
cM.setCursor(searchPosX);
|
||||
top.ICEcoder.getNestLocation();
|
||||
if (ICEcoder.htmlTagArray.length-1 != nestPos) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Once we've found our tag
|
||||
if (cursor.from()) {
|
||||
// Set our vars to match the start position
|
||||
startPos = new Object();
|
||||
top.ICEcoder.startPosCh = startPos.ch = cursor.from().ch;
|
||||
top.ICEcoder.startPosLine = startPos.line = cursor.from().line;
|
||||
top.ICEcoder.startPosCh = startPos.ch = cursor.from().ch;
|
||||
// Now set an end position object that matches this start tag
|
||||
endPos = new Object();
|
||||
endPos.line = top.ICEcoder.content.contentWindow.CodeMirror.tagRangeFinder(cM,startPos) || startPos.line;
|
||||
|
||||
Reference in New Issue
Block a user