2014-07-11 03:27:04 +04:00
|
|
|
#ifndef face_registry_hh_INCLUDED
|
|
|
|
#define face_registry_hh_INCLUDED
|
|
|
|
|
|
|
|
#include "face.hh"
|
|
|
|
#include "utils.hh"
|
|
|
|
#include "completion.hh"
|
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
|
|
|
class FaceRegistry : public Singleton<FaceRegistry>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FaceRegistry();
|
|
|
|
|
2014-07-12 14:19:35 +04:00
|
|
|
Face operator[](const String& facedesc);
|
2014-07-11 03:27:04 +04:00
|
|
|
void register_alias(const String& name, const String& facedesc,
|
|
|
|
bool override = false);
|
|
|
|
|
|
|
|
CandidateList complete_alias_name(StringView prefix,
|
|
|
|
ByteCount cursor_pos) const;
|
|
|
|
private:
|
|
|
|
std::unordered_map<String, Face> m_aliases;
|
|
|
|
};
|
|
|
|
|
2014-07-12 14:19:35 +04:00
|
|
|
inline Face get_face(const String& facedesc)
|
2014-07-11 03:27:04 +04:00
|
|
|
{
|
|
|
|
return FaceRegistry::instance()[facedesc];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // face_registry_hh_INCLUDED
|
|
|
|
|