summaryrefslogtreecommitdiff
path: root/src/highlighter_group.cc
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2024-08-16include headers cleanupAdriĆ  Arrufat
2024-08-12Extract format implementation to its own fileMaxime Coste
Split it to avoid pulling all string_utils dependencies for just format.
2024-04-12Make removing an unknown highlighter an errorMaxime Coste
Fail instead of silently doing nothing, this makes it easier to toggle highlighters using a try/catch
2022-07-21Use menu behavior for add-highlighter/remove-highlighter completionJohannes Altmanninger
This means that typing :add-highlighter g c 80 results in :add-highlighter global/ column 80 Paths for add-highlighter do not get the menu behavior because we want to be able to type "global/foo" even if "global/foobar" exists.
2020-03-30Add -override support to add-highlighterMaxime Coste
This allow replacing a highlighter in place, not loosing its current position in its parent. Fixes #3436
2018-07-05Tweak how highlighter names are auto-generatedMaxime Coste
2018-07-05Refactor add-highlighter to make naming explicitMaxime Coste
The highlighter name must be given as part of the path of the highlighter, as the last element. Fixes #1712
2018-06-11Pass DisplaySetup through the HighlightContextMaxime Coste
2018-04-06Make error messages more consistentDelapouite
2018-04-06Make compute_display_setup methods constMaxime Coste
2018-03-20Revert "Throw when trying to remove a child highlighter that does not exists"Maxime Coste
This reverts commit 56237aa8f8adaffc63584a6e8435b9cf414d82ef. Throwing seems more correct, but it breaks lots of existing scripts. reverting for now until we have a nice solution.
2018-03-20Throw when trying to remove a child highlighter that does not existsMaxime Coste
2018-02-22Fix typos in C++ string literalsaver-d
informations, dont, incrementaly, alignement
2017-11-25Highlighters: Introduce unique highlighter supportMaxime Coste
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).
2017-11-02Append '/' to highlighter group completion candidatesMaxime Coste
2017-10-31Highlighters does not need to inherit from HighlighterGroupMaxime Coste
Just compose, to avoid coupling Highlighters with the Highlighter interface. And yeah, that naming is a bit confusing.
2017-10-28Move highlighters into ScopesMaxime Coste
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.
2017-10-10Move all non-core string code to string_utils.{hh,cc}Maxime Coste
2017-08-29Rename containers.hh to ranges.hh (and Container to Range)Maxime Coste
2017-05-07Move passes logic to the base Highlighter classMaxime Coste
Validate that childs of HighlighterGroup are matching its passes.
2017-05-07Make scrolling around work more correctly with wrappingMaxime Coste
2017-05-07Introduce highlighting phases and display setup computationMaxime Coste
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.
2017-03-07Replace IdMap with HashMapMaxime Coste
2016-03-08Rework container helpers, use pipe syntax and cleanup implementationMaxime Coste
use 'container | filter(func) | reverse() | transform(func)' instead of 'transform(reverse(filter(container), func), func)' to express container transformations.
2016-02-13Do not allow / in highlighter names as it is used for hierachiesMaxime Coste
/ are replaced with <slash> in the highlighter names. Fixes #553
2015-11-11Fix access to dead temporaryMaxime Coste
2015-09-16Store key hash in IdMapMaxime Coste
2015-06-01Port even more code to use format functionMaxime Coste
2015-06-01Port more code to use the format function instead of adhoc string concatMaxime Coste
2014-12-23Unify completion from container content logicMaxime Coste
2014-12-23Move containers utils to containers.hh and add filtered/transformed utilsMaxime Coste
2014-12-02Pass a BufferRange to highlighters, fix subregionsMaxime Coste
Regions highlighter can now correctly be applied to only subrange of the buffer, fixing some corner cases in recursive regions.
2014-10-28Style fixesMaxime Coste
2014-10-22Refactor highlighters, use an interface with virtual methodsMaxime Coste
2014-06-16Share implementation in complete_id/complete_group_idMaxime Coste
2014-06-15Refactor highlighter command completionsMaxime Coste
2014-06-12Remove defhl, use addhl -groupMaxime Coste
2014-06-10Add HierachicalHighlighter classMaxime Coste
HierachicalHighlighter contains a map of names to HighlighterGroup and can wrap any highlighter that wants to access user settable sub groups.
2014-06-10Replace FunctionGroup template with HighlighterGroup classMaxime Coste
2013-03-27Merge {Filter,Highlighter}Group in a FunctionGroup templateMaxime Coste
2012-10-11use ByteCount instead of CharCount when we are really counting bytesMaxime Coste
(that is most of the time when we are not concerned with displaying)
2012-08-23use a strongly typed int CharCount for character countsMaxime Coste
2012-06-25remove ugly id_to_str param in idvaluemap and str_to_strMaxime Coste
2012-04-14replace std::string references with StringMaxime Coste
2012-04-03fix error message in HighlighterGroupMaxime Coste
2012-01-19HighlighterGroup: use idvaluemap::complete_id_if in complete_group_idMaxime Coste
2012-01-19HighlighterGroup: move to it's own file, Window uses them directlyMaxime Coste