mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-19 09:21:30 +03:00
0ce6bd9bf5
(that is most of the time when we are not concerned with displaying)
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#ifndef highlighter_registry_h_INCLUDED
|
|
#define highlighter_registry_h_INCLUDED
|
|
|
|
#include "string.hh"
|
|
#include <unordered_map>
|
|
|
|
#include "highlighter.hh"
|
|
#include "utils.hh"
|
|
#include "completion.hh"
|
|
#include "idvaluemap.hh"
|
|
|
|
namespace Kakoune
|
|
{
|
|
|
|
class Window;
|
|
class HighlighterGroup;
|
|
|
|
typedef std::function<HighlighterAndId (Window& window,
|
|
const HighlighterParameters& params)> HighlighterFactory;
|
|
|
|
class HighlighterRegistry : public Singleton<HighlighterRegistry>
|
|
{
|
|
public:
|
|
void register_factory(const String& name,
|
|
const HighlighterFactory& factory);
|
|
|
|
void add_highlighter_to_group(Window& window,
|
|
HighlighterGroup& group,
|
|
const String& factory_name,
|
|
const HighlighterParameters& parameters);
|
|
|
|
CandidateList complete_highlighter(const String& prefix,
|
|
ByteCount cursor_pos);
|
|
|
|
private:
|
|
idvaluemap<String, HighlighterFactory> m_factories;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // highlighter_registry_h_INCLUDED
|