mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Handle untitled documents when filtering on path
These would previously be prefixed with the project folder path. Now they get no prefix (and disappear when the path-part of the filter string is non-empty).
This commit is contained in:
@@ -480,11 +480,11 @@ inline void rank_record (document_record_t& record, filter_string_t const& filte
|
||||
std::vector<std::pair<size_t, size_t>> path_cover;
|
||||
if(filter.path != NULL_STR)
|
||||
{
|
||||
std::string prefix = path::relative_to(path::parent(record.full_path), basePath);
|
||||
std::string prefix = (record.full_path == NULL_STR) ? "" : path::relative_to(path::parent(record.full_path), basePath);
|
||||
if(double rank = oak::rank(filter.path, prefix, &path_cover))
|
||||
{
|
||||
path_rank = 1 - rank;
|
||||
record.display = prefix + (prefix.empty() ? "" : "/");
|
||||
record.display = (record.full_path == NULL_STR) ? "" : prefix + (prefix.empty() ? "" : "/");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user