Sublime Forum

[ST3] Cannot toggle single bookmark after changing file

#1

Given a file

Foo
Bar
Foo

Toggle a bookmark, e.g. in line 2

-Foo
xBar
-Foo

Change file, e.g. remove first line

xBar
-Foo

Toggling the bookmark previously added is no longer possible. Removing all bookmarks is not effected.

I’m using Build 3047.

0 Likes

#2

I noticed bookmarks are saved on a line/column basis, i.e. it is possible to have many bookmarks in a single line. Is this expected behavior?

0 Likes

#3

Turns out the behavior is not related to file changes. Rather, an existing bookmark can only be toggled if the cursor is exactly where it was when the bookmark was added (line and column). To some degree this makes sense, but at least to me it was unexpected behavior. Interestingly ST2 behaves just like ST3.

0 Likes

#4

Bookmarks are actually saved on the current selection, not just the line/column. The cursor can be anywhere within the original selection area in order to toggle(unset) the bookmark.

However, this is not particularly easy to manage. The list of bookmarks simple states the line number and if you’re not careful you can easily end up with half a dozen bookmarks that all state “line 366”. The list of bookmarks should at least include the line number, column number (of the start of the selection) and perhaps the first 40+ characters from the selection (if any).

In order to toggle just “line” bookmarks, you need to be careful (there should be an option for this in my opinion - perhaps set a macro and key binding in the meantime?), either:

  1. Always toggle the bookmark when the cursor is at the start of the line: [Home],[Home],[Ctrl]+[F2]
  • Or -
  1. Select the line ([Ctrl]+[L]) before setting the bookmark [Ctrl]+[F2] and then just use [Ctrl]+[F2] anywhere on the line to unset it.
0 Likes