Always place bookmarks on top of “search marks”

Logically I think the less temporary marks should be eclipsed, but this currently lead to inconsistencies with respect to hover images, e.g. hovering a search mark that also has a bookmark should show “remove bookmark” which it presently doesn’t, and will require a bit of refactoring to allow.

Issue #1132
This commit is contained in:
Allan Odgaard
2013-10-05 14:23:50 +02:00
parent bf09650c0b
commit 186af2fb21

View File

@@ -679,25 +679,18 @@ private:
enum bookmark_state_t { kBookmarkNoMark, kBookmarkRegularMark, kBookmarkSearchMark };
static std::string const kBookmarkType = "bookmark";
static std::string const kBookmarkType = "bookmark";
static std::string const kSearchmarkType = "search";
- (NSUInteger)stateForColumnWithIdentifier:(id)columnIdentifier atLine:(NSUInteger)lineNumber
{
if([columnIdentifier isEqualToString:kBookmarksColumnIdentifier])
{
ng::buffer_t const& buf = document->buffer();
std::map<size_t, std::string> const& marks = buf.get_marks(buf.begin(lineNumber), buf.eol(lineNumber));
iterate(pair, marks)
{
if(pair->second == kBookmarkType)
return kBookmarkRegularMark;
}
iterate(pair, marks)
{
if(pair->second == "search")
return kBookmarkSearchMark;
}
if(!buf.get_marks(buf.begin(lineNumber), buf.eol(lineNumber), kBookmarkType).empty())
return kBookmarkRegularMark;
if(!buf.get_marks(buf.begin(lineNumber), buf.eol(lineNumber), kSearchmarkType).empty())
return kBookmarkSearchMark;
return kBookmarkNoMark;
}
else if([columnIdentifier isEqualToString:kFoldingsColumnIdentifier])