2011-11-29 23:37:20 +01:00
|
|
|
#ifndef highlighters_hh_INCLUDED
|
|
|
|
#define highlighters_hh_INCLUDED
|
|
|
|
|
2013-03-29 19:31:06 +01:00
|
|
|
#include "color.hh"
|
2013-04-09 20:05:40 +02:00
|
|
|
#include "highlighter.hh"
|
2017-05-25 09:38:11 +02:00
|
|
|
#include "option.hh"
|
2013-03-29 19:31:06 +01:00
|
|
|
|
2011-11-29 23:37:20 +01:00
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
|
|
|
void register_highlighters();
|
|
|
|
|
2017-05-08 13:34:57 +02:00
|
|
|
struct InclusiveBufferRange{ BufferCoord first, last; };
|
|
|
|
|
|
|
|
inline bool operator==(const InclusiveBufferRange& lhs, const InclusiveBufferRange& rhs)
|
|
|
|
{
|
|
|
|
return lhs.first == rhs.first and lhs.last == rhs.last;
|
|
|
|
}
|
|
|
|
String option_to_string(InclusiveBufferRange range);
|
2018-05-27 05:00:04 +02:00
|
|
|
InclusiveBufferRange option_from_string(Meta::Type<InclusiveBufferRange>, StringView str);
|
2017-05-08 13:34:57 +02:00
|
|
|
|
2017-05-24 16:41:43 +02:00
|
|
|
using LineAndSpec = std::tuple<LineCount, String>;
|
2017-05-25 09:38:11 +02:00
|
|
|
using LineAndSpecList = TimestampedList<LineAndSpec>;
|
|
|
|
|
|
|
|
constexpr StringView option_type_name(Meta::Type<LineAndSpecList>)
|
|
|
|
{
|
|
|
|
return "line-specs";
|
|
|
|
}
|
|
|
|
void option_update(LineAndSpecList& opt, const Context& context);
|
2017-11-02 02:51:15 +01:00
|
|
|
void option_list_postprocess(Vector<LineAndSpec, MemoryDomain::Options>& opt);
|
2017-05-25 09:38:11 +02:00
|
|
|
|
2017-05-17 20:35:54 +02:00
|
|
|
using RangeAndString = std::tuple<InclusiveBufferRange, String>;
|
2017-05-25 09:38:11 +02:00
|
|
|
using RangeAndStringList = TimestampedList<RangeAndString>;
|
|
|
|
|
|
|
|
constexpr StringView option_type_name(Meta::Type<RangeAndStringList>)
|
|
|
|
{
|
|
|
|
return "range-specs";
|
|
|
|
}
|
|
|
|
void option_update(RangeAndStringList& opt, const Context& context);
|
2017-11-02 02:51:15 +01:00
|
|
|
void option_list_postprocess(Vector<RangeAndString, MemoryDomain::Options>& opt);
|
2021-03-08 22:51:43 +01:00
|
|
|
bool option_add_from_strings(Vector<RangeAndString, MemoryDomain::Options>& opt, ConstArrayView<String> strs);
|
2013-03-29 19:31:06 +01:00
|
|
|
|
2011-11-29 23:37:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // highlighters_hh_INCLUDED
|