Add distinct w (curr buf) / W (all buf) word completion for <c-x>
This commit is contained in:
parent
30ce5a0055
commit
d5b6669a83
|
@ -1224,8 +1224,9 @@ reached (see `idle_timeout` option). Insert mode completion can be explicitly tr
|
||||||
using `<c-x>`, followed, by:
|
using `<c-x>`, followed, by:
|
||||||
|
|
||||||
* *f* : filename completion
|
* *f* : filename completion
|
||||||
* *w* : buffer word completion
|
* *w* : word completion (current buffer)
|
||||||
* *l* : buffer line completion
|
* *W* : word completion (all buffers)
|
||||||
|
* *l* : line completion (current buffer)
|
||||||
|
|
||||||
Completion candidates can be selected using `<c-n>` and `<c-p>`.
|
Completion candidates can be selected using `<c-n>` and `<c-p>`.
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,10 @@ Insert mode
|
||||||
explicit file completion
|
explicit file completion
|
||||||
|
|
||||||
*w*:::
|
*w*:::
|
||||||
explicit word completion
|
explicit word completion (current buffer)
|
||||||
|
|
||||||
|
*W*:::
|
||||||
|
explicit word completion (all buffers)
|
||||||
|
|
||||||
*l*:::
|
*l*:::
|
||||||
explicit line completion
|
explicit line completion
|
||||||
|
|
|
@ -1208,12 +1208,15 @@ public:
|
||||||
if (key.key == 'f')
|
if (key.key == 'f')
|
||||||
m_completer.explicit_file_complete();
|
m_completer.explicit_file_complete();
|
||||||
if (key.key == 'w')
|
if (key.key == 'w')
|
||||||
m_completer.explicit_word_complete();
|
m_completer.explicit_word_buffer_complete();
|
||||||
|
if (key.key == 'W')
|
||||||
|
m_completer.explicit_word_all_complete();
|
||||||
if (key.key == 'l')
|
if (key.key == 'l')
|
||||||
m_completer.explicit_line_complete();
|
m_completer.explicit_line_complete();
|
||||||
}, "enter completion type",
|
}, "enter completion type",
|
||||||
"f: filename\n"
|
"f: filename\n"
|
||||||
"w: word\n"
|
"w: word (current buffer)\n"
|
||||||
|
"W: word (all buffers)\n"
|
||||||
"l: line\n");
|
"l: line\n");
|
||||||
update_completions = false;
|
update_completions = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,7 +548,13 @@ void InsertCompleter::explicit_file_complete()
|
||||||
m_explicit_completer = complete_filename<false>;
|
m_explicit_completer = complete_filename<false>;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsertCompleter::explicit_word_complete()
|
void InsertCompleter::explicit_word_buffer_complete()
|
||||||
|
{
|
||||||
|
try_complete(complete_word<false>);
|
||||||
|
m_explicit_completer = complete_word<false>;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InsertCompleter::explicit_word_all_complete()
|
||||||
{
|
{
|
||||||
try_complete(complete_word<true>);
|
try_complete(complete_word<true>);
|
||||||
m_explicit_completer = complete_word<true>;
|
m_explicit_completer = complete_word<true>;
|
||||||
|
|
|
@ -86,7 +86,8 @@ public:
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
void explicit_file_complete();
|
void explicit_file_complete();
|
||||||
void explicit_word_complete();
|
void explicit_word_buffer_complete();
|
||||||
|
void explicit_word_all_complete();
|
||||||
void explicit_line_complete();
|
void explicit_line_complete();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user