mirror of
https://github.com/textmate/textmate.git
synced 2026-01-14 17:28:05 -05:00
Improve implementation of document_view_t::has_marks
The previous version was proportional in time with number of marks, since it requested (a copy of) all the marks.
This commit is contained in:
@@ -284,8 +284,7 @@ struct document_view_t : ng::buffer_api_t
|
||||
|
||||
bool has_marks (std::string const& type = NULL_STR) const
|
||||
{
|
||||
ng::buffer_t const& buf = [_document_editor buffer];
|
||||
return type == NULL_STR ? !buf.get_marks(0, buf.size()).empty() : !buf.get_marks(0, buf.size(), type).empty();
|
||||
return [_document_editor buffer].prev_mark(SIZE_T_MAX, type).second != NULL_STR;
|
||||
}
|
||||
|
||||
bool current_line_has_marks (std::string const& type) const
|
||||
|
||||
Reference in New Issue
Block a user