summaryrefslogtreecommitdiff
path: root/src/highlighters.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-05-25 08:38:11 +0100
committerMaxime Coste <mawww@kakoune.org>2017-05-25 19:54:08 +0100
commit83d85df26e68687ca124c3affb42e246fd77188a (patch)
tree87260753f599c46706e6aa77249c35e5e1c7aed4 /src/highlighters.hh
parentf014eb7052082f7a6760dbd2aec9204b0cb4e1dc (diff)
Add an update-option command to update range-descs/line-descs options
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.
Diffstat (limited to 'src/highlighters.hh')
-rw-r--r--src/highlighters.hh16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/highlighters.hh b/src/highlighters.hh
index a3f1971d..cae0d63e 100644
--- a/src/highlighters.hh
+++ b/src/highlighters.hh
@@ -3,6 +3,7 @@
#include "color.hh"
#include "highlighter.hh"
+#include "option.hh"
namespace Kakoune
{
@@ -19,7 +20,22 @@ String option_to_string(InclusiveBufferRange range);
void option_from_string(StringView str, InclusiveBufferRange& opt);
using LineAndSpec = std::tuple<LineCount, String>;
+using LineAndSpecList = TimestampedList<LineAndSpec>;
+
+constexpr StringView option_type_name(Meta::Type<LineAndSpecList>)
+{
+ return "line-specs";
+}
+void option_update(LineAndSpecList& opt, const Context& context);
+
using RangeAndString = std::tuple<InclusiveBufferRange, String>;
+using RangeAndStringList = TimestampedList<RangeAndString>;
+
+constexpr StringView option_type_name(Meta::Type<RangeAndStringList>)
+{
+ return "range-specs";
+}
+void option_update(RangeAndStringList& opt, const Context& context);
}