I could possibly be missing something, but let me explain what’s happening.
I have a set of Markers (highlight regions) that are being set on keypress. I’m trying to detect if the cursor is at the beginning of the highlight region, and return it only if it is.
So, I have this code snippet:
position = cursor.getBufferPosition() marks = @findMarks(containsBufferPosition: [position.row, position.column]) mark = mark for mark in marks when mark.getStartBufferPosition().isEqual(position) console.log mark for mark in marks when mark.getStartBufferPosition().isEqual(position) console.log mark
The console won’t log a Marker if my cursor is at the end of a Marker region, but it will still return a mark into the mark variable. Am I missing something here with list comprehensions and what should be returned? I’m expecting undefined, but I get the Marker!