summaryrefslogtreecommitdiff
path: root/src/completion.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-05-30 23:23:38 +1000
committerMaxime Coste <mawww@kakoune.org>2018-07-05 07:54:28 +1000
commitb548dd3a6f369e5a244fdcdca55061513026f82a (patch)
tree1ca672c1d6f976a74f34d37f75fd68a83933fbe1 /src/completion.hh
parent5eeec8bd4d24882ea443c4441f696257b8cb68c4 (diff)
Change option lists to be specified as separate arguments on commands line
Option lists and maps are specified using separate arguments, avoiding the need for additional escaping of their separator and reusing the existing command line spliting logic instead. As discussed on #2087, this should make it much easier to work with list options, and make the general option system feel cleaner.
Diffstat (limited to 'src/completion.hh')
-rw-r--r--src/completion.hh7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/completion.hh b/src/completion.hh
index 19275824..553b37e7 100644
--- a/src/completion.hh
+++ b/src/completion.hh
@@ -21,6 +21,7 @@ struct Completions
CandidateList candidates;
ByteCount start;
ByteCount end;
+ bool quoted = false;
Completions()
: start(0), end(0) {}
@@ -28,8 +29,8 @@ struct Completions
Completions(ByteCount start, ByteCount end)
: start(start), end(end) {}
- Completions(ByteCount start, ByteCount end, CandidateList candidates)
- : candidates(std::move(candidates)), start(start), end(end) {}
+ Completions(ByteCount start, ByteCount end, CandidateList candidates, bool quoted = false)
+ : candidates(std::move(candidates)), start(start), end(end), quoted{quoted} {}
};
enum class CompletionFlags
@@ -56,7 +57,7 @@ Completions shell_complete(const Context& context, CompletionFlags,
inline Completions offset_pos(Completions completion, ByteCount offset)
{
return { completion.start + offset, completion.end + offset,
- std::move(completion.candidates) };
+ std::move(completion.candidates), completion.quoted };
}
template<typename Container>