kakoune/src/completion.hh

40 lines
783 B
C++
Raw Normal View History

#ifndef completion_hh_INCLUDED
#define completion_hh_INCLUDED
#include <vector>
#include <functional>
#include "string.hh"
namespace Kakoune
{
2013-02-18 14:00:43 +01:00
struct Context;
typedef std::vector<String> CandidateList;
struct Completions
{
CandidateList candidates;
ByteCount start;
ByteCount end;
Completions()
: start(0), end(0) {}
Completions(ByteCount start, ByteCount end)
: start(start), end(end) {}
};
typedef std::function<Completions (const Context&,
const String&, ByteCount)> Completer;
inline Completions complete_nothing(const Context& context,
const String&, ByteCount cursor_pos)
{
return Completions(cursor_pos, cursor_pos);
}
}
#endif // completion_hh_INCLUDED