return whether bookmark was removed, fixes
@@ -210,9 +210,11 @@ class Actions(app.mutator.Mutator):
None.
Returns:
- None.
+ (boolean) Whether any bookmarks were removed.
"""
- def removeOverlaps(rangeList, needle):
+ upperRow, _, lowerRow, _ = self.startAndEnd()
+ rangeList = self.bookmarks
+ needle = ((upperRow, lowerRow),)
# Find the left-hand index.
begin = bisect.bisect_left(rangeList, needle)
if begin and needle[0][0] <= rangeList[begin-1][0][1]:
@@ -233,10 +235,10 @@ class Actions(app.mutator.Mutator):
else:
index += 1
break
- return rangeList[:begin] + rangeList[index:]
- upperRow, _, lowerRow, _ = self.startAndEnd()
- needle = ((upperRow, lowerRow),)
- self.bookmarks = removeOverlaps(self.bookmarks, needle)
+ if begin == index:
+ return False
+ self.bookmarks = rangeList[:begin] + rangeList[index:]
+ return True
def backspace(self):
app.log.info('backspace', self.penRow > self.markerRow)
