Set a LineMarker
Hi Community,
I found a tutorial about Line Maker Provider, but I want to put a Line Marker at a precise Position by clicking. Like IntelliJ does it 4 example with bookmarks.
How can I implement that?
Please sign in to leave a comment.
You need to add a RangeHighlighter directly to the markup model of the underlying document. See Bookmark.createHighligher() for the code that sets up such a range highlighter:
https://upsource.jetbrains.com/ideac/file/HEAD/platform%2Flang-impl%2Fsrc%2Fcom%2Fintellij%2Fide%2Fbookmarks%2FBookmark.java
Here's the code which creates a bookmark when the editor gutter is clicked:
https://upsource.jetbrains.com/ideac/file/7205db4b582156675c801a71a86ef62119c1a69b/platform%2Flang-impl%2Fsrc%2Fcom%2Fintellij%2Fide%2Fbookmarks%2FBookmarkManager.java?nav=stub:403:focused
thank you
:) exactly what I was looking for!