1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 12:02:15 +03:00
kakoune/src/completion.hh

49 lines
1.0 KiB
C++
Raw Normal View History

#ifndef completion_hh_INCLUDED
#define completion_hh_INCLUDED
#include <vector>
#include <functional>
#include "units.hh"
namespace Kakoune
{
2013-11-11 23:10:49 +04:00
class Context;
class String;
using CandidateList = std::vector<String>;
struct Completions
{
CandidateList candidates;
ByteCount start;
ByteCount end;
Completions()
: start(0), end(0) {}
Completions(ByteCount start, ByteCount end)
: start(start), end(end) {}
};
enum class CompletionFlags
{
None,
Fast
};
using Completer = std::function<Completions (const Context&, CompletionFlags,
const String&, ByteCount)>;
inline Completions complete_nothing(const Context& context, CompletionFlags,
const String&, ByteCount cursor_pos)
{
return Completions(cursor_pos, cursor_pos);
}
Completions shell_complete(const Context& context, CompletionFlags,
const String&, ByteCount cursor_pos);
}
#endif // completion_hh_INCLUDED