Completions: change NullCompletion functor to complete_nothing function

This commit is contained in:
Maxime Coste 2011-11-10 20:57:25 +00:00
parent 9bba47bd30
commit 82baa55eed
2 changed files with 5 additions and 7 deletions

View File

@ -31,13 +31,11 @@ CandidateList complete_buffername(const std::string& prefix,
typedef std::function<Completions (const std::string&, size_t)> Completer; 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 #endif // completion_hh_INCLUDED

View File

@ -168,7 +168,7 @@ void deinit_ncurses()
struct prompt_aborted {}; 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; int max_x, max_y;
getmaxyx(stdscr, max_y, max_x); getmaxyx(stdscr, max_y, max_x);