@@ -12,11 +12,10 @@ use promkit::{
1212 Widget ,
1313 } ,
1414 suggest:: Suggest ,
15- validate:: { ErrorMessageGenerator , Validator , ValidatorManager } ,
15+ validate:: ValidatorManager ,
1616 widgets:: {
1717 listbox:: { self , Listbox } ,
18- text:: { self , Text } ,
19- text_editor:: { self , History } ,
18+ text, text_editor,
2019 } ,
2120 Prompt , Signal ,
2221} ;
@@ -158,80 +157,6 @@ impl Prompt for Readline {
158157}
159158
160159impl Readline {
161- pub fn title < T : AsRef < str > > ( mut self , text : T ) -> Self {
162- self . title . text = Text :: from ( text) ;
163- self
164- }
165-
166- pub fn title_style ( mut self , style : ContentStyle ) -> Self {
167- self . title . config . style = Some ( style) ;
168- self
169- }
170-
171- pub fn enable_suggest ( mut self , suggest : Suggest ) -> Self {
172- self . suggest = Some ( suggest) ;
173- self
174- }
175-
176- pub fn enable_history ( mut self ) -> Self {
177- self . readline . history = Some ( History :: default ( ) ) ;
178- self
179- }
180-
181- pub fn prefix < T : AsRef < str > > ( mut self , prefix : T ) -> Self {
182- self . readline . config . prefix = prefix. as_ref ( ) . to_string ( ) ;
183- self
184- }
185-
186- pub fn mask ( mut self , mask : char ) -> Self {
187- self . readline . config . mask = Some ( mask) ;
188- self
189- }
190-
191- pub fn prefix_style ( mut self , style : ContentStyle ) -> Self {
192- self . readline . config . prefix_style = style;
193- self
194- }
195-
196- pub fn active_char_style ( mut self , style : ContentStyle ) -> Self {
197- self . readline . config . active_char_style = style;
198- self
199- }
200-
201- pub fn inactive_char_style ( mut self , style : ContentStyle ) -> Self {
202- self . readline . config . inactive_char_style = style;
203- self
204- }
205-
206- pub fn edit_mode ( mut self , mode : text_editor:: Mode ) -> Self {
207- self . readline . config . edit_mode = mode;
208- self
209- }
210-
211- pub fn word_break_chars ( mut self , characters : HashSet < char > ) -> Self {
212- self . readline . config . word_break_chars = characters;
213- self
214- }
215-
216- pub fn text_editor_lines ( mut self , lines : usize ) -> Self {
217- self . readline . config . lines = Some ( lines) ;
218- self
219- }
220-
221- pub fn evaluator ( mut self , evaluator : Evaluator < Self > ) -> Self {
222- self . evaluator = evaluator;
223- self
224- }
225-
226- pub fn validator (
227- mut self ,
228- validator : Validator < str > ,
229- error_message_generator : ErrorMessageGenerator < str > ,
230- ) -> Self {
231- self . validator = Some ( ValidatorManager :: new ( validator, error_message_generator) ) ;
232- self
233- }
234-
235160 async fn render ( & mut self ) -> anyhow:: Result < ( ) > {
236161 match self . renderer . as_ref ( ) {
237162 Some ( renderer) => {
0 commit comments