mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed broken highlighting for file path references ended by \\ (PY-7434).
This commit is contained in:
@@ -69,9 +69,7 @@ public class PyStringLiteralFileReferenceSet extends RootFileReferenceSet {
|
||||
@Override
|
||||
public boolean process(int startOffset, int endOffset, String value) {
|
||||
if ("\\".equals(value) || "/".equals(value)) {
|
||||
if (myStartOffset != -1) {
|
||||
addReference(startOffset);
|
||||
}
|
||||
addReference(startOffset);
|
||||
}
|
||||
else {
|
||||
if (myStartOffset == -1) {
|
||||
@@ -84,15 +82,18 @@ public class PyStringLiteralFileReferenceSet extends RootFileReferenceSet {
|
||||
}
|
||||
|
||||
private void addReference(int startOffset) {
|
||||
final FileReference ref = myFileReferenceSet.createFileReference(
|
||||
new TextRange(myStartOffset, startOffset),
|
||||
myIndex++,
|
||||
myItem.toString());
|
||||
myReferenceList.add(ref);
|
||||
myStartOffset = -1;
|
||||
myItem.setLength(0);
|
||||
if (myStartOffset != -1) {
|
||||
final FileReference ref = myFileReferenceSet.createFileReference(
|
||||
new TextRange(myStartOffset, startOffset),
|
||||
myIndex++,
|
||||
myItem.toString());
|
||||
myReferenceList.add(ref);
|
||||
myStartOffset = -1;
|
||||
myItem.setLength(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void finish() {
|
||||
addReference(myEndOffset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user