summaryrefslogtreecommitdiff
path: root/src/display_buffer.hh
AgeCommit message (Collapse)Author
2024-08-14Remove unused wrap_to and reduce string_utils headersMaxime Coste
2024-08-14Reduce number of included headersMaxime Coste
2024-08-12Reduce headers dependency graphMaxime Coste
Move more code into the implementation files to reduce the amount of code pulled by headers.
2024-03-22Fix DisplayLines not tracking their buffer range correctlyMaxime Coste
After extracting the whole buffer content, a line can end up with only non-range highlgihters pending which makes its range become 0.0,0.0, after running highlighting on the extracted range it gets re-inserted but taking the min of existing range and inserted range wrongly returns 0.0. Avoid this by detecting that the 0.0,0.0 range does not actually mean anything when we have no ranged atoms. Fixes #5001
2023-12-10Change use of deprecated '->' operator on an iteratorChris Webb
In display_buffer.hh, the '->' operator is used on an iterator, but (surprisingly) this is deprecated from C++20 because of x-value vs l-value ambiguity. Now clang's -Wdeprecated-declarations warns about it as we declare -std=c++2a. See https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1252r2.pdf which was adopted for 2019-03.
2023-08-05Try to fix clang build issuesMaxime Coste
2023-06-12Merge remote-tracking branch 'arrufat/fix-build-gcc13'Maxime Coste
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-09Fix build using GCC 13.1Adrià Arrufat
The <functional> header was missing and the "hash.hh" was not used.
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
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-12Fix past-the-eol column highlighter getting highlighted as buffer rangeMaxime Coste
Make the column highlighter faces final, and change final logic to give precedence to the base face when both the base and new face are final. Fixes #4669
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
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.
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
2019-11-22Add support for markup in info boxesMaxime Coste
Fixes #2552
2019-09-25Avoid unnecessary allocations in NCursesUI::Window::draw callsMaxime Coste
Pass an ArrayView<DisplayAtom> instead of a DisplayLine& so that the newly common case of passing a single atom does not require constructing a Vector.
2019-02-27Fixed all reorder warningsJustin Frank
2018-10-21Move LineRangeSet to line_modification.hhMaxime Coste
2018-06-11Try to keep window position fixed when buffer gets modifiedMaxime Coste
Adapt window position to the changes that happened in the buffer since last redraw. Fixes #1989
2018-05-08Store the timestamp at which a display buffer was generatedMaxime Coste
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
2018-04-29Remove implicit conversion from String to DisplayAtom/DisplayLineMaxime Coste
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
2017-08-29avoid literal eol in status lines, replace them with another symbolMaxime Coste
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-26Small documentation tweak in display_buffer.hhMaxime Coste
2017-05-08Distinguish between BufferRanges and InclusiveBufferRangesMaxime Coste
Fixes #1257
2017-03-11Increase modelinefmt configuration powerDan Rosén
2016-10-13Rename DisplayAtom::Types to avoid conflicts with struct BufferRangeMaxime 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
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-10-06Cleanup insert_completer code and use markup for option completion menu entryMaxime Coste
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-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-09-12Add some missing memory domainsMaxime Coste
2015-07-23Improve column highlighter to cooperate better with other highlightersMaxime Coste
Fixes #268
2015-06-17Move status/mode line drawing as a separate ui methodMaxime Coste
2015-06-04Add support for Default faceMaxime Coste
The Default face is used to set default color values, if set to default (the default), refers to terminal default colors.
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-01-21Add Display memory domainMaxime Coste
2015-01-12replace all std::vector with VectorMaxime Coste