diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-08-23 23:56:35 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-08-23 23:56:35 +0200 |
| commit | e4fd839ddaaf3fc68df2cb502a633a2ae6a9f86f (patch) | |
| tree | 681b2a63eb9b9497b97697e3f1479a7b20270427 /src/completion.cc | |
| parent | 0d8cce272831cd896d0e69d7c86cc9afc521eb11 (diff) | |
use a strongly typed int CharCount for character counts
Diffstat (limited to 'src/completion.cc')
| -rw-r--r-- | src/completion.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/completion.cc b/src/completion.cc index 1d2a5e86..319da0f7 100644 --- a/src/completion.cc +++ b/src/completion.cc @@ -11,15 +11,15 @@ namespace Kakoune CandidateList complete_filename(const Context& context, const String& prefix, - size_t cursor_pos) + CharCount cursor_pos) { String real_prefix = prefix.substr(0, cursor_pos); String dirname = "./"; String dirprefix; String fileprefix = real_prefix; - size_t dir_end = -1; - for (size_t i = 0; i < real_prefix.length(); ++i) + CharCount dir_end = -1; + for (CharCount i = 0; i < real_prefix.length(); ++i) { if (real_prefix[i] == '/') dir_end = i; @@ -49,7 +49,7 @@ CandidateList complete_filename(const Context& context, String name = dirprefix + filename; if (entry->d_type == DT_DIR) name += '/'; - if (fileprefix.length() or filename[0] != '.') + if (fileprefix.length() != 0 and filename[0] != '.') result.push_back(name); } } |
