highlighters.hh (1374B)
1 #ifndef highlighters_hh_INCLUDED 2 #define highlighters_hh_INCLUDED 3 4 #include "color.hh" 5 #include "highlighter.hh" 6 #include "option.hh" 7 8 namespace Kakoune 9 { 10 11 void register_highlighters(); 12 13 struct InclusiveBufferRange 14 { 15 BufferCoord first, last; 16 friend bool operator==(const InclusiveBufferRange& lhs, const InclusiveBufferRange& rhs) = default; 17 }; 18 19 String option_to_string(InclusiveBufferRange range); 20 InclusiveBufferRange option_from_string(Meta::Type<InclusiveBufferRange>, StringView str); 21 22 using LineAndSpec = std::tuple<LineCount, String>; 23 using LineAndSpecList = TimestampedList<LineAndSpec>; 24 25 constexpr StringView option_type_name(Meta::Type<LineAndSpecList>) 26 { 27 return "line-specs"; 28 } 29 void option_update(LineAndSpecList& opt, const Context& context); 30 void option_list_postprocess(Vector<LineAndSpec, MemoryDomain::Options>& opt); 31 32 using RangeAndString = std::tuple<InclusiveBufferRange, String>; 33 using RangeAndStringList = TimestampedList<RangeAndString>; 34 35 constexpr StringView option_type_name(Meta::Type<RangeAndStringList>) 36 { 37 return "range-specs"; 38 } 39 void option_update(RangeAndStringList& opt, const Context& context); 40 void option_list_postprocess(Vector<RangeAndString, MemoryDomain::Options>& opt); 41 bool option_add_from_strings(Vector<RangeAndString, MemoryDomain::Options>& opt, ConstArrayView<String> strs); 42 43 } 44 45 #endif // highlighters_hh_INCLUDED