Skip to content

Multiple bookmarks at a point location hides all but the last#1710

Closed
ibdknox wants to merge 1 commit intocodemirror:masterfrom
Kodowa:multiple-bookmarks
Closed

Multiple bookmarks at a point location hides all but the last#1710
ibdknox wants to merge 1 commit intocodemirror:masterfrom
Kodowa:multiple-bookmarks

Conversation

@ibdknox
Copy link
Copy Markdown
Contributor

@ibdknox ibdknox commented Jul 29, 2013

Since bookmarks are point based and do not replace any text, they cannot technically overlap eachother and there's no reason multiple can't be shown at a point location. The current implementation of insertLineContent prevents them from being shown by assuming there's only ever one. This is another naive solution that has one problem: when there are two (or more) bookmarks the cursor is positioned in between them (as opposed to before all of them) when the insertLeft option is set true.

Signed-off-by: Chris Granger <ibdknox@gmail.com>
marijnh added a commit that referenced this pull request Jul 30, 2013
@marijnh
Copy link
Copy Markdown
Member

marijnh commented Jul 30, 2013

Merged, and fixed in attached patch (you trampled on an existing i variable -- also, for/in isn't a very safe or efficient way to iterate over arrays).

@marijnh marijnh closed this Jul 30, 2013
@ibdknox
Copy link
Copy Markdown
Contributor Author

ibdknox commented Jul 30, 2013

Any thoughts on how to fix the cursor placement issue? If you put two bookmarks at the end of the line with insertLeft the cursor ends up in between them instead of after the last character. I looked into it a bit and from what I could tell the issue has to do with the way it assumes positions equate to a single measurable span.

anaran pushed a commit to anaran/CodeMirror that referenced this pull request Feb 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants