summaryrefslogtreecommitdiff
path: root/src/completion.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-08-23 23:56:35 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-08-23 23:56:35 +0200
commite4fd839ddaaf3fc68df2cb502a633a2ae6a9f86f (patch)
tree681b2a63eb9b9497b97697e3f1479a7b20270427 /src/completion.hh
parent0d8cce272831cd896d0e69d7c86cc9afc521eb11 (diff)
use a strongly typed int CharCount for character counts
Diffstat (limited to 'src/completion.hh')
-rw-r--r--src/completion.hh12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/completion.hh b/src/completion.hh
index 775d558e..60462975 100644
--- a/src/completion.hh
+++ b/src/completion.hh
@@ -16,25 +16,25 @@ typedef std::vector<String> CandidateList;
struct Completions
{
CandidateList candidates;
- size_t start;
- size_t end;
+ CharCount start;
+ CharCount end;
Completions()
: start(0), end(0) {}
- Completions(size_t start, size_t end)
+ Completions(CharCount start, CharCount end)
: start(start), end(end) {}
};
CandidateList complete_filename(const Context& context,
const String& prefix,
- size_t cursor_pos = -1);
+ CharCount cursor_pos = -1);
typedef std::function<Completions (const Context&,
- const String&, size_t)> Completer;
+ const String&, CharCount)> Completer;
inline Completions complete_nothing(const Context& context,
- const String&, size_t cursor_pos)
+ const String&, CharCount cursor_pos)
{
return Completions(cursor_pos, cursor_pos);
}