BlackBox Component Builder
Download  Extensions  GitHub  Chat  Wiki  Forum  Support 


Bookmarks for text documents.

When you edit a source code file it is often necessary to jump back and forth between two or three different areas making changes simultaneously. A valid solution would be to open the appropriate number of windows with the same document and to switch between them. BlackBox supports this with the command "Window - New Window (F2)". For example, you may open one window with TYPE declaration in view to add properties to an object, and the second window with a method implementation. Now you may add new properties while writing code that uses them. Unfortunately, in BlackBox all these windows will share the same text cursor position, so if you start typing right after you switch to another window, you will immediately be brought back to the place where you were typing in the previous view, effectively losing all the advantages of having two windows. To place the text cursor at a new position you have to use the mouse, and switch from keyboard to mouse and back again which slows you down and distracts you.

Another problem with the approach of using multiple windows, is that you end up having a) many windows open to same file, b) very small amount of text in each window without its context, and c) very limited navigation capabilities using the "Window" menu, so you cannot quickly find the window you need.

That is why you may find bookmarks useful. A bookmark is a small visible object (of type CpcBookmarks.View) which can be pasted into any text document. It looks like a little grey square with a digit in it. Bookmarks are numbered from 1 to 9, so you may have up to nine bookmarks per document. After you have placed a bookmark, you may quickly jump to that exact cursor position from anywhere in the document (the document's window must be active). Bookmarks are saved within the document, so the state is preserved between editing sessions.

Like any other View object bookmarks are ignored by the compiler, so you don't have to put them in comments. They may be anywhere in your source code. Right where you need them.

The disadvantage of bookmarks is that you have to remember the number location correspondence. You'll have to think up your own scheme for using those numbers. You won't be using more than three most of the time, so it won't be very hard to simply poke through numbers from 1 to 3 to find the place you need.

Author: Alexander Iljin
Published by: Anton Shelin
Русский English


Publish your extensions for
BlackBox Component Builder.

Sign up


remember me