Commit Graph

88 Commits

Author SHA1 Message Date
Maxime Coste
954373d3cf Support multi-line replace-ranges
This likely has lots of rough edges, but should be an initial proof
of concept to support folding.
2020-04-27 17:39:21 +10:00
Maxime Coste
cb119251bc Do not replace partially selected ranges in replace-ranges highlighter
Partially selected ranges should not be replaced to make it possible
to see what is actually selected.
2020-04-27 17:39:21 +10:00
Maxime Coste
34f48cc851 Rework ncurses info display, crop content when overlflowing
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-24 18:11:29 +11:00
Maxime Coste
cb1b03c0db Add support for markup in info boxes
Fixes #2552
2019-11-22 21:50:51 +11:00
Maxime Coste
2eccbbbe6f Avoid unnecessary allocations in NCursesUI::Window::draw calls
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-09-25 22:46:39 +10:00
Justin Frank
8178400f8d Fixed all reorder warnings 2019-02-27 22:45:31 -08:00
Maxime Coste
72bdd7900f Move LineRangeSet to line_modification.hh 2018-10-21 12:10:21 +11:00
Maxime Coste
0d3a1b5955 Try to keep window position fixed when buffer gets modified
Adapt window position to the changes that happened in the buffer
since last redraw.

Fixes #1989
2018-06-11 15:10:30 +10:00
Maxime Coste
e8c648b7b7 Store the timestamp at which a display buffer was generated
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-05-08 21:56:44 +10:00
Maxime Coste
2fa553e728 Remove implicit conversion from String to DisplayAtom/DisplayLine 2018-04-29 20:45:53 +10:00
Maxime Coste
57baad4afd Make FaceRegistry scoped
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-07 16:27:50 +10:00
Maxime Coste
1709886873 avoid literal eol in status lines, replace them with another symbol 2017-08-29 10:01:43 +07:00
Maxime Coste
4ed790632d Fix some other uses of invalid buffer coordinates in display code 2017-06-15 18:12:21 +01:00
Maxime Coste
0dec1e3a91 Remove unused only_buffer mode for DisplayLine::trim 2017-06-09 15:30:13 +01:00
Maxime Coste
f310db639c Rework partial line display logic
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-06-09 13:22:32 +01:00
Maxime Coste
b1bb9d0cb2 Small documentation tweak in display_buffer.hh 2017-05-26 08:00:15 +01:00
Maxime Coste
12c498a0bd Distinguish between BufferRanges and InclusiveBufferRanges
Fixes #1257
2017-05-08 12:34:57 +01:00
Dan Rosén
5a403a9611 Increase modelinefmt configuration power 2017-03-11 21:43:51 +01:00
Maxime Coste
6bfc68d4f3 Rename DisplayAtom::Types to avoid conflicts with struct BufferRange 2016-10-13 19:55:15 +01:00
Maxime Coste
35559b65dd Support codepoints of variable width
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-10-01 13:45:00 +01:00
Maxime Coste
8dcffd8f5a Initial, WIP spelling implementation
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-12-17 04:07:49 +00:00
Maxime Coste
67646cd45a Cleanup insert_completer code and use markup for option completion menu entry 2015-10-06 13:37:16 +01:00
Maxime Coste
2b4b73ae8e Remove the default_face parameter of parse_display_line
No need to define a default face there, we will pass a default face
to UserInterface::draw_status later.
2015-09-20 11:34:13 +01:00
Maxime Coste
6bc5f8c3a3 Add simple markup support to generate display lines from strings
The syntax is simply {face} to enable the given face, use \{ to
escape a {, and \\ to escape a \.
2015-09-19 12:19:17 +01:00
Maxime Coste
5173dad470 Add some missing memory domains 2015-09-12 10:51:16 +01:00
Maxime Coste
2946504a17 Improve column highlighter to cooperate better with other highlighters
Fixes #268
2015-07-23 13:58:23 +01:00
Maxime Coste
bf46870ff2 Move status/mode line drawing as a separate ui method 2015-06-17 21:28:02 +01:00
Maxime Coste
9668dccea9 Add support for Default face
The Default face is used to set default color values, if set
to default (the default), refers to terminal default colors.
2015-06-04 13:49:28 +01:00
Maxime Coste
045272ab8a Use a struct for BufferRange rather than std::pair 2015-04-23 21:38:45 +01:00
Maxime Coste
840e58e0b1 NCurses: When mode line is too long, trim it rather hiding it 2015-04-23 21:11:50 +01:00
Maxime Coste
0ff415597e Add Display memory domain 2015-01-21 13:35:46 +00:00
Maxime Coste
da562e03a0 replace all std::vector with Vector 2015-01-12 13:58:41 +00:00
Maxime Coste
3a817e2f96 Cleanup includes 2014-11-12 21:27:07 +00:00
Maxime Coste
d4a84125ef Use InternedStrings for buffer contents 2014-10-03 13:39:13 +01:00
Maxime Coste
a32b49acd1 Rename ColorPair to Face and ColorRegistry to FaceRegistry
Face also stores the attributes
2014-07-11 00:27:43 +01:00
Maxime Coste
55866b51d7 Fix redrawing of windows when only the status line changes 2014-07-07 23:56:17 +01:00
Maxime Coste
c21368cac5 DisplayAtom::content returns a StringView 2014-05-16 19:29:39 +01:00
Maxime Coste
8546788b43 Refactor LineAndColumn coordinates
BufferCoord -> ByteCoord
DisplayCoord -> CharCoord

Moved their definition along with LineAndColumn into coord.hh
2014-05-07 19:53:45 +01:00
Maxime Coste
4f4a626754 Fix adapt_view_pos when the cursor is not on a display atom by itself 2014-01-21 18:52:51 +00:00
Maxime Coste
e6884f989c Style changes, replace typedefs with usings 2014-01-09 19:59:26 +00:00
Maxime Coste
bd80cf0404 Add DisplayAtom::check_invariant method 2013-12-12 13:45:08 +00:00
Maxime Coste
277b02eee6 Add experimental region_ref highlighter
highlights a region using another highlighter.
2013-12-11 23:19:24 +00:00
Maxime Coste
d6425f1d50 merge AtomContent into DisplayAtom 2013-07-24 13:55:57 +01:00
Maxime Coste
8633a37dad Try to keep the selection start visible if possible 2013-07-24 01:34:00 +02:00
Maxime Coste
c7e52a650d DisplayLine no longer map to a single buffer line, but to a buffer range 2013-07-24 01:33:12 +02:00
Maxime Coste
e510bf8b96 Fix horizontal scrolling support with replaced buffer ranges
tab character were not properly handled when scrolling horizontally
2013-06-28 00:03:11 +02:00
Maxime Coste
d5b190369a DisplayBuffer: use coords rather than iterators 2013-05-30 13:59:38 +02:00
Maxime Coste
97df6f2222 AtomContent uses coord rather than iterators 2013-05-29 18:58:20 +02:00
Maxime Coste
56ab33c9d6 support specifying colors with RGB components 2013-05-13 14:25:05 +02:00
Maxime Coste
270e950cf1 sort includes directives 2013-04-09 20:05:40 +02:00