summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2011-11-10 20:57:25 +0000
committerMaxime Coste <frrrwww@gmail.com>2011-11-10 20:57:25 +0000
commit82baa55eed7f908a02b9b60260e0e5cd78a9ad4d (patch)
tree7e63a745ee14c11b570329d9efa192da449cc6ab /src
parent9bba47bd30a33cb6990903e5c88515d24397e618 (diff)
Completions: change NullCompletion functor to complete_nothing function
Diffstat (limited to 'src')
-rw-r--r--src/completion.hh10
-rw-r--r--src/main.cc2
2 files changed, 5 insertions, 7 deletions
diff --git a/src/completion.hh b/src/completion.hh
index e4fe8062..ca325155 100644
--- a/src/completion.hh
+++ b/src/completion.hh
@@ -31,13 +31,11 @@ CandidateList complete_buffername(const std::string& prefix,
typedef std::function<Completions (const std::string&, size_t)> Completer;
-struct NullCompletion
+
+inline Completions complete_nothing(const std::string&, size_t cursor_pos)
{
- Completions operator() (const std::string&, size_t cursor_pos)
- {
- return Completions(cursor_pos, cursor_pos);
- }
-};
+ return Completions(cursor_pos, cursor_pos);
+}
}
#endif // completion_hh_INCLUDED
diff --git a/src/main.cc b/src/main.cc
index 5b6c4351..4646d04e 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -168,7 +168,7 @@ void deinit_ncurses()
struct prompt_aborted {};
-std::string prompt(const std::string& text, Completer completer = NullCompletion())
+std::string prompt(const std::string& text, Completer completer = complete_nothing)
{
int max_x, max_y;
getmaxyx(stdscr, max_y, max_x);