| Age | Commit message (Collapse) | Author |
|
For WrapHighlighter to be able to take ReplaceRangesHighlighter
into account, it needs to run afterwards, moreover, moving
TabulationHighlighter to the replace pass means we should be able to
remove any tabulation specific handling from WrapHighlighter
Also move ShowWhitespaceHighlighter to this pass as it is designed
to replace TabulationHighlighter by running before (as builtin
highlighters run after non builtin ones for each passes)
|
|
Move the whole responsibility of making the cursor visible to the
window, removing cursor_pos from the display setup and resolving
the cursor location by finding it in the display buffer afterwards.
This simplifies hightlighters' do_compute_display_setup as they do
not need to compute the cursor location. Highlighting may run on
more lines than necessary after this change but this should be a
minor performance hit.
|
|
|
|
Use an empty Optional to show that resolution failed and just do not
do anything in the mouse event handler in that case.
|
|
|
|
Lots of code includes buffer_utils.hh just for write_to_debug_buffer
which pulls many unnecessary dependencies. Reorganise to reduce
compile times.
|
|
The wrap highlighter was pulling all lines until the cursor, regardless
of whether the cursor was going to be made visible, this could lead to
a display buffer containing much more lines than the actual viewport
which eventually could lead to menu being anchored out of view that
was leading to past-the-end buffer accesses.
Fix the wrap higlighter not to pull lines up to the cursor when it
is not tasked with making the cursor visible, and always trim the
eventual extra lines after highlighting.
Fixes #5118
|
|
An assert fails from time to time after reloading fifo buffers due
to being scrolled past the last line of the buffer. A repro case was
not found but this should fix the underlying issue.
|
|
Fixes #4964
|
|
ensure cursor is visible after user input except if the command
implementation opted-out. Hooks and timers should not enforce
visible cursor.
PageUp/PageDown and `<c-f>` / `<c-b>` commands still move the cursor
as this seemed a desired behaviour.
|
|
This was mostly redundant with Client::force_redraw.
|
|
|
|
This is currently broken on various corner cases and breaks the
"master branch should be good for day to day work" implicit rule,
ongoing work to stabilize this feature will take place on the
no-cursor-move-on-scroll branch until its deemed ready.
This reverts commit 1e38045d702ec6eb2425016d9b02636270ab1b1e.
Closes #4963
|
|
Kakoune now does not touch cursors when scrolling. It checks
if either the buffer or selections has been modified since
last redraw.
Fixes #4124
Fixes #2844
|
|
|
|
Colorizing long lines can be costly, remove all the invisible atoms
earlier. Also optimize ForwardHighlighterApplier further by trimming
empty lines.
|
|
Honor the split request by inserting an empty atom to make sure
client code can assume splitting does replace one atom with two
Fixes #4753
|
|
Instead of triming only buffer ranges, add a trim_from method to
display line to keep the initial N columns, we know how many columns
are used by non-trimable widgets in DisplaySetup::widget_columns so
we can just pass this.
Also restore the previous logic for face merging
Fixes #4670
|
|
Always start with full buffer lines and trim the display buffer at
the very end, treat non-range display atoms as non-trimable in that
case and keep track of how many columns are occupied by "widgets"
such as line numbers or flags.
Fixes #4659
|
|
|
|
Only include the value for int/str/bool options, for the rest just
write '<option name>=...'.
This should reduce the cost of some patterns such as repeatedly adding
a value inside a list option.
It seems very unlikely that the actual value would be matched by
a hook regex string for non primitive types.
|
|
WinResize hooks could be triggered during shell evaluation, leading
to any state potentially getting mutated after a shell evaluation
call.
|
|
Fixes #2552
|
|
|
|
|
|
Using <fg>,<bg>+<attr>@<base> will apply the given fg color,
bg color and attributes on top of base dynamically. Simply giving
<base> is a shorthand for default,default@<base>.
Inspired by the discussion in #2862
|
|
|
|
|
|
m_last_setup was not storing the actual position that was used to
redraw the window, but the previous one, leading to an additional
spurious redraw immediatly after (triggered by window position not
believed to be the one at last redraw).
Fixes #2562
|
|
Hooks are now an enum class instead of passing strings around.
|
|
|
|
Add a test case to validate roundtrips between Kakoune and the
shell.
|
|
|
|
|
|
|
|
Adapt window position to the changes that happened in the buffer
since last redraw.
Fixes #1989
|
|
Window can be resized with an "offset_pos" flag, which means that
the resize took place on the top left corner of the window, leading
to a change in current window position. This is treated as temporary
and the position change is stored in a m_position_offset field.
That allows the ncurses UI to offset the position when it displays
a Search menu, so that the window does not constantly scroll when
the search menu open/closes. The window will only scroll if it needs
to in order to keep the main selectin visible.
|
|
|
|
Fixes #2079
|
|
Fixes #2056
|
|
Draft is well establish and all draft context are transient.
|
|
Coordinates inside a display buffer are only valid for a certain
buffer content, they cannot be used once the buffer has been
modified.
Fixes #2034
|
|
Hash the current face state and store that hash to check for changes.
|
|
|
|
Window::on_option_changed calls hooks, which can do anything
including adding/removing options in the various option managers
Fixes #1863
|
|
Fixes #1741
|
|
Some highlighters, such as wrap or line numbers, are not intended
to be used multiple times on the same display. Add support for unique
ids that are used by highlighters to disable themselves if another
unique highlighter with the same id is supposed to override them.
The usual highlighter "precedence" takes, place, that it, that most
nested highlighter will the the one to run (window in priority to
buffer in priority to global).
|
|
Fixes #1711
|
|
Just compose, to avoid coupling Highlighters with the Highlighter
interface. And yeah, that naming is a bit confusing.
|
|
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
|