set-face now takes a scope argument, and faces can be overridden on
a buffer or window basis.
colorscheme apply on global scope, which should be good enough for
now.
Fixes#1411
Reference highlighters allow for potential mutual recursion between
highlighters. This is usually fine, but if the recursion happens on
the same buffer range, it means we will recurse infinitely.
Fixes#1920
To allow more general look arounds out of the actual search range,
pass a second range (the actual subject). This allows us to remove
various flags such as PrevAvailable or NotBeginOfSubject, which are
now easy to check from the subject range.
Fixes#1902
When on an end of line, certain behaviours can be surprising, for
example delete will join the following line (which makes sense, and
is consistent, but hard to predict if we do not know the cursor is
on and end of line).
As Kakoune is moving more and more towards treating end of lines
as any other character, making it clear when the cursor lies on
them seems like a good way to reduce surprise.
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).
Support arbitrary orders for column highlighters (it was previously
failing when column highlighters were not applied in column order).
Fix show_matching tab handling at the same time (horizontal scrolling,
tab characters and show_matching were behaving badly).
Window highlighting now runs user highlighters, then built-ins for each
phases, instead of running all phases for user highlighters, then all
phases for built-ins.
We now consider unprintable character to be 1-column width as we know
we will display them as "�".
Fixes#1615Fixes#1023
Tabs now align to tab stops instead of always spanning 8 spaces when
show_whitespaces is added as a highlighter.
This fixes issue #1453.
A regression test is also provided.
Fixes#1433 although in a slightly different way than requested:
We ensure that scrolloff *displayed* lines are visible below the
cursor, not scrolloff *buffer* lines.
Instead of highlighting full lines and then trim them to make them
fit in the window, highlight only the visible portion, and rely on
the compute_display_setup system introduced for wrapping to setup
our buffer range correctly
update-option will make the range-descs and line-descs option up to
date with the latest buffer modfications, changing the ranges/lines
to where they moved according the modifications since the timestamp
on the option.
Generalize this option type, which is a timestamped list of
<line number>|<arbitrary string>. That way this type is not strongly
coupled with the flag-lines highlighter, and can be reused for other
use cases.
range-faces are now used to replace-range highlighters, where the string
part is not interpretted as a face but as a display line, so the name was
not relevant anymore.
replace-ranges is takes a range-faces option, but treats the face
string as a display line to be parsed, and replaces the range display
with this display line.
Highlighters now run in 3 phases:
Wrap, Move, and Colorize. That way we guarantee the wrap
highlighter runs first, then eventual line numbers/flags,
and finally the colorizers.
We also run a `compute_display_setup` method thats responsible
for computing the lines that will be displayed, eventually
scrolling the view to ensure the cursor is visible.
That means we wont have a very nice interaction between show_whitespaces
and column highlighters, but thats the simplest fix for now, if we want
a better behaviour we need to introduce a way to know that a replaced
range is splittable (meaning it means to have the same amount of columns
as the range it replaces)
Fixes#1275
We were still adding one more char to the line number width in case
it would contain a minus sign. The minus signs are not used anymore
in relative line numbering so we dont need to keep that addtional
char which is always a blank.
This commit adds the following flags to the `show_whitespaces`
highlighter, with a one character long parameter:
* `-lf`: character replacing line feeds
* `-spc`: character replacing spaces
* `-nbsp`: character replacing non breakable spaces
* `-tab`: character replacing a tabulation
* `-tabpad`: character used as padding after a tabulation to satisfy
the `tabstop` option