summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
AgeCommit message (Collapse)Author
2024-08-16include headers cleanupAdrià Arrufat
2023-06-12Trim display lines before the colorize passMaxime Coste
Colorizing long lines can be costly, remove all the invisible atoms earlier. Also optimize ForwardHighlighterApplier further by trimming empty lines.
2023-06-09Speed up regions highlighting on files with big linesMaxime Coste
Range atoms should always appear in order, so we can iterate a single time through the display lines and display atoms while applying hightlighters to regions
2023-02-15Fix trimming of line front halfway through a double-width glyphMaxime Coste
Insert a space to replace the half glyph and ensure the rest of the line is correctly aligned. Fixes #4843
2023-02-03Fix DisplayLine::trim_front quadratic behaviourMaxime Coste
Erasing fully trimmed display atoms one by one means we have to shift all the remaining ones every time. This is wasteful and we can just erase all the fully trimmed atom in one go. Fixes #4797
2022-12-06Avoid calculating atom length in DisplayLine::trim_fromMaxime Coste
Calculating the length of an atom means we need to decode every codepoint and compute its column width. This can prove quite expensive in trim_from as we can have full buffer lines, so on buffer with long lines we might have to go through megabytes of undisplayed data.
2022-10-17Fix splitting of display atoms accross multi-columns codepointMaxime Coste
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
2022-07-13Re-work line trimming to fix issues with column highightersMaxime Coste
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
2022-07-11Fix buffer location of column highlighter's past-eol atomsMaxime Coste
Using buffer end was confusing Window::display_position that assumes display atom buffer locations are always increasing.
2022-07-10Refactor highlighting logicMaxime Coste
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
2021-08-28Support info markup spanning multiple linesMaxime Coste
Preserve the active face accross lines Fixes #4313
2021-08-17Move control character escaping responsibility to the terminal UIMaxime Coste
Fix atom text at display time, allow tabs/eol/etc... in display atoms and escape them just-in-time Fixes #4293
2021-02-16Fix splitting display line in front of a replaced rangeMaxime Coste
When a replaced buffer range atom was starting exactly at the location we wanted to split onto the code would split *after* that atom instead of before. Fixes #4052
2020-04-27Support multi-line replace-rangesMaxime Coste
This likely has lots of rough edges, but should be an initial proof of concept to support folding.
2020-04-27Do not replace partially selected ranges in replace-ranges highlighterMaxime Coste
Partially selected ranges should not be replaced to make it possible to see what is actually selected.
2020-03-03Only replace chars >= 0 in fix_atom_textMaxime Coste
If char is signed, the test was invalid Fixes #3389
2020-02-26Control character end at 0x1FMaxime Coste
2020-02-25Do not replace spaces in prompt textMaxime Coste
2020-02-22Use Control Picture codepoints in prompt for all codepoints < 0x22Maxime Coste
Fixes #3333
2019-11-28Add a {\} marker to disable markup processingMaxime Coste
2019-11-24Replace tab characters with spaces in info/echoMaxime Coste
This is tricky to fix better than that as tabs make text length dependent on where it will get displayed and what preceedes it. Also fix an issue with empty info title Fixes #2237
2019-11-24Rework ncurses info display, crop content when overlflowingMaxime Coste
Optmize the code to avoid allocating like crazy, unify various info style rendering, crop content and display markers that there is more text remaining. Fixes #2257
2018-04-07Make FaceRegistry scopedMaxime Coste
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
2018-04-05Fix some trailing spaces and a tab that sneaked into the code baseMaxime Coste
2017-10-12Refactor column highlighter to make it more robustMaxime Coste
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 #1615 Fixes #1023
2017-08-29avoid literal eol in status lines, replace them with another symbolMaxime Coste
2017-08-23Optimize DisplayBuffer::optimize()Maxime Coste
Previous implementation was erasing in the middle of the atoms vector each time two atoms were merged, leading to a move of all following atoms.
2017-06-15Fix some other uses of invalid buffer coordinates in display codeMaxime Coste
2017-06-09Remove unused only_buffer mode for DisplayLine::trimMaxime Coste
2017-06-09Rework partial line display logicMaxime Coste
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
2017-05-08Distinguish between BufferRanges and InclusiveBufferRangesMaxime Coste
Fixes #1257
2017-03-11Increase modelinefmt configuration powerDan Rosén
2017-03-01src: Fix the string conversion of range facesFrank LENORMAND
Fixes #1250
2017-01-08Apply clang-tidy modernize to the codebaseMaxime Coste
2016-12-07Fix markup parsing handling of antislash escapesMaxime Coste
Antislashes did not need to immediately precede a face spec to escape it, it could be in any characters before it.
2016-10-26BufferRange option syntax support <line>.<column>+<len> and is inclusiveMaxime Coste
Fixes #864
2016-10-13Rename DisplayAtom::Types to avoid conflicts with struct BufferRangeMaxime Coste
2016-10-04Small code cleanupMaxime Coste
2016-10-01Support codepoints of variable widthMaxime Coste
Add a ColumnCount type and use it in place of CharCount whenever more appropriate, take column size of codepoints into account for vertical movements and docstring wrapping. Fixes #811
2016-07-28Add a char_length(Buffer&, const ByteCoord&, const ByteCoord&) utilMaxime Coste
2015-12-17Initial, WIP spelling implementationMaxime Coste
Add a ranges highlighter that takes a timestamped list of ranges and associated face. Add a spell.kak file that uses aspell pipe interface to fill a range-faces option.
2015-09-20Remove the default_face parameter of parse_display_lineMaxime Coste
No need to define a default face there, we will pass a default face to UserInterface::draw_status later.
2015-09-20Do not allow '\n' in display lines, replace with a spaceMaxime Coste
2015-09-19Add simple markup support to generate display lines from stringsMaxime Coste
The syntax is simply {face} to enable the given face, use \{ to escape a {, and \\ to escape a \.
2015-07-23Improve column highlighter to cooperate better with other highlightersMaxime Coste
Fixes #268
2015-04-23Use a struct for BufferRange rather than std::pairMaxime Coste
2015-04-23NCurses: When mode line is too long, trim it rather hiding itMaxime Coste
2015-03-10Refactor String, use a common StringOps interface, hide std::stringMaxime Coste
2014-11-12Cleanup includesMaxime Coste
2014-07-11Rename ColorPair to Face and ColorRegistry to FaceRegistryMaxime Coste
Face also stores the attributes