@@ -76,7 +76,6 @@ pub struct Menu<T: Item> {
76
76
viewport : ( u16 , u16 ) ,
77
77
recalculate : bool ,
78
78
sort_strategy : SortStrategy ,
79
- use_preselect : bool ,
80
79
}
81
80
82
81
impl < T : Item > Menu < T > {
@@ -88,7 +87,6 @@ impl<T: Item> Menu<T> {
88
87
options : Vec < T > ,
89
88
editor_data : <T as Item >:: Data ,
90
89
sort_strategy : SortStrategy ,
91
- use_preselect : bool ,
92
90
callback_fn : impl Fn ( & mut Editor , Option < & T > , MenuEvent ) + ' static ,
93
91
) -> Self {
94
92
let mut menu = Self {
@@ -104,7 +102,6 @@ impl<T: Item> Menu<T> {
104
102
viewport : ( 0 , 0 ) ,
105
103
recalculate : true ,
106
104
sort_strategy,
107
- use_preselect,
108
105
} ;
109
106
110
107
// TODO: scoring on empty input should just use a fastpath
@@ -116,7 +113,6 @@ impl<T: Item> Menu<T> {
116
113
pub fn score ( & mut self , pattern : & str ) {
117
114
// dereference pointers here, not inside of the filter_map() loop
118
115
let is_pattern_empty = pattern. is_empty ( ) ;
119
- let use_preselect = self . use_preselect ;
120
116
121
117
// reuse the matches allocation
122
118
self . matches . clear ( ) ;
@@ -129,7 +125,7 @@ impl<T: Item> Menu<T> {
129
125
// TODO: using fuzzy_indices could give us the char idx for match highlighting
130
126
131
127
// If prompt pattern is empty, show the preselected item as first option
132
- if use_preselect && is_pattern_empty {
128
+ if is_pattern_empty {
133
129
if option. preselected ( ) {
134
130
// The LSP server can preselect multiple items, however it doesn't give any preference
135
131
// for one over the other, so they all have the same score
0 commit comments