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 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);