mirror of https://github.com/helix-editor/helix
applay completion by `C-x`
If only one completion applay it by pressing completion hotkeypull/12085/head
parent
7afdd1cc94
commit
f61b72976e
|
@ -169,6 +169,10 @@ impl<T: Item> Menu<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn selection(&self) -> Option<&T> {
|
pub fn selection(&self) -> Option<&T> {
|
||||||
|
if self.options.len() == 1 {
|
||||||
|
return Some(&self.options[0]);
|
||||||
|
}
|
||||||
|
|
||||||
self.cursor.and_then(|cursor| {
|
self.cursor.and_then(|cursor| {
|
||||||
self.matches
|
self.matches
|
||||||
.get(cursor)
|
.get(cursor)
|
||||||
|
@ -177,6 +181,10 @@ impl<T: Item> Menu<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn selection_mut(&mut self) -> Option<&mut T> {
|
pub fn selection_mut(&mut self) -> Option<&mut T> {
|
||||||
|
if self.options.len() == 1 {
|
||||||
|
return Some(&mut self.options[0]);
|
||||||
|
}
|
||||||
|
|
||||||
self.cursor.and_then(|cursor| {
|
self.cursor.and_then(|cursor| {
|
||||||
self.matches
|
self.matches
|
||||||
.get(cursor)
|
.get(cursor)
|
||||||
|
|
Loading…
Reference in New Issue