Completions: change NullCompletion functor to complete_nothing function
This commit is contained in:
parent
9bba47bd30
commit
82baa55eed
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user