kakoune

Fork of kakoune, an acceptable text editor
git clone git://git.laack.co/kakoune.git
Log | Files | Refs

highlighter.cc (1309B)


      1 #include "highlighter.hh"
      2 
      3 #include "debug.hh"
      4 #include "flags.hh"
      5 
      6 namespace Kakoune
      7 {
      8 
      9 void Highlighter::highlight(HighlightContext context, DisplayBuffer& display_buffer, BufferRange range)
     10 {
     11     if (context.pass & m_passes) try
     12     {
     13         do_highlight(context, display_buffer, range);
     14     }
     15     catch (runtime_error& error)
     16     {
     17         write_to_debug_buffer(format("Error while highlighting: {}", error.what()));
     18     }
     19 }
     20 
     21 void Highlighter::compute_display_setup(HighlightContext context, DisplaySetup& setup) const
     22 {
     23     if (context.pass & m_passes)
     24         do_compute_display_setup(context, setup);
     25 }
     26 
     27 
     28 bool Highlighter::has_children() const
     29 {
     30     return false;
     31 }
     32 
     33 Highlighter& Highlighter::get_child(StringView path)
     34 {
     35     throw runtime_error("this highlighter does not hold children");
     36 }
     37 
     38 void Highlighter::add_child(String, UniquePtr<Highlighter>&&, bool)
     39 {
     40     throw runtime_error("this highlighter does not hold children");
     41 }
     42 
     43 void Highlighter::remove_child(StringView id)
     44 {
     45     throw runtime_error("this highlighter does not hold children");
     46 }
     47 
     48 Completions Highlighter::complete_child(StringView path, ByteCount cursor_pos, bool group) const
     49 {
     50     throw runtime_error("this highlighter does not hold children");
     51 }
     52 
     53 void Highlighter::fill_unique_ids(Vector<StringView>& unique_ids) const
     54 {}
     55 
     56 }