- adds 'editor/scroll offset' setting to the registry to act similar to
the 'scrolloff' setting in Vim. When set to a non-zero value, the editor
will attempt to keep that many lines above and below the cursor. This
helps to maintain some context around the current line. As in Vim, if
set to a large value, the cursor will stay in the center of the screen
most of the time. The value defaults to 0.
- Updates the default_reg data to include the new setting.
- Updates ht_registry::init() to contain the proper palette data so that
a new default registry can be created. I assume these original values
were lost from this portion of code in a refactor some time ago.
- Slightly modifies the "goto address" functionality (in
ht_uformat_viewer::set_cursor), including when jumping to a search
result. If the destination line is already on-screen (and within 'scroll
offset' lines from the top/bottom) the cursor just goes to the
destination line. If the destination line is within half a screen above
the current screen (or on-screen within 'scroll offset' lines from the
top), the cursor line will be 'scroll offset' lines from the top of the
screen. Likewise, if the destination line is within half a screen under
the current screen (or within 'scroll offset' lines above the bottom),
the cursor line will be 'scroll offset' lines from the bottom of the
screen. If the destination line is further from the current screen, the
destination line will be centered. It may sound confusing, but this
behavior quickly conveys information about the relationship of the
destination line to where the user was previously editing.
- One limitation is that if the user has an existing config file, the
new setting will not be available. This appears to be a limitation of
the registry. Should this be addressed, or is deleting the config file
a sufficient workaround?
Log in to post a comment.