Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/editor/MultiRangeInlineEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ define(function (require, exports, module) {
SearchResultItem.prototype.$listItem = null;

function _updateRangeLabel(listItem, range) {
var text = range.name + " " + range.textRange.document.file.name + " : " + (range.textRange.startLine + 1);
listItem.text(text);
listItem.attr("title", text);
var text = range.name + " <span class='related-file'>— " + range.textRange.document.file.name + " : " + (range.textRange.startLine + 1) + "</span>";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename needs to be HTML-escaped now -- StringUtils.htmlEscape(range.textRange.document.file.name)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might need to escape range.name too. It happens that it's not necessary for CSS selectors (although it almost is, with >) and JS methods, but in the future if we had, say, LESS support, then there would be things like & in there, and there are other things people could use MultiRangeInlineEditor for that might have syntax that would need to be escaped.

listItem.html(text);
listItem.attr("title", range.name + " " + range.textRange.document.file.name + " : " + (range.textRange.startLine + 1));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to replace this with listItem.attr(listItem.text())... could you try it out locally and see if that gives the right tooltip?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Peter, it's so much better!

}

/**
Expand Down
8 changes: 6 additions & 2 deletions src/styles/brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -732,16 +732,20 @@ a, img {
}

li {
color: @inline-color-2;
color: @tc-emphasized-text;
margin: 0;
overflow: hidden;
padding: 2px 0px 2px 15px;
text-overflow: ellipsis;
white-space: nowrap;

.related-file {
color: @tc-input-placeholder-text;
}
}

.selected {
color: @inline-color-3;
color: @tc-light-weight-text;
transition: color 0.1s ease-out .15s;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/styles/brackets_colors.less
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
@tc-selected-row: #d0d5d5;
@tc-hover-highlight: rgba(255, 255, 255, 0.6);
@tc-text: #454545;
@tc-emphasized-text: #333;
@tc-text-shadow: 0 1px 0 #fff;
@tc-call-to-action: #288edf;
@tc-call-to-action-border: #0055ad;
Expand Down