@@ -1091,27 +1091,18 @@ fn extend_next_long_word_end(cx: &mut Context) {
1091
1091
extend_word_impl ( cx, movement:: move_next_long_word_end)
1092
1092
}
1093
1093
1094
- fn will_find_char < F > (
1095
- cx : & mut Context ,
1096
- search_fn : F ,
1097
- inclusive : bool ,
1098
- extend : bool ,
1099
- pseudo_pending : & str ,
1100
- ) where
1094
+ fn will_find_char < F > ( cx : & mut Context , search_fn : F , inclusive : bool , extend : bool )
1095
+ where
1101
1096
F : Fn ( RopeSlice , char , usize , usize , bool ) -> Option < usize > + ' static ,
1102
1097
{
1103
1098
// TODO: count is reset to 1 before next key so we move it into the closure here.
1104
1099
// Would be nice to carry over.
1105
1100
let count = cx. count ( ) ;
1106
1101
1107
- cx. editor . pseudo_pending = Some ( pseudo_pending. to_string ( ) ) ;
1108
-
1109
1102
// need to wait for next key
1110
1103
// TODO: should this be done by grapheme rather than char? For example,
1111
1104
// we can't properly handle the line-ending CRLF case here in terms of char.
1112
1105
cx. on_next_key ( move |cx, event| {
1113
- cx. editor . pseudo_pending = None ;
1114
-
1115
1106
let ch = match event {
1116
1107
KeyEvent {
1117
1108
code : KeyCode :: Enter ,
@@ -1214,35 +1205,35 @@ fn find_prev_char_impl(
1214
1205
}
1215
1206
1216
1207
fn find_till_char ( cx : & mut Context ) {
1217
- will_find_char ( cx, find_next_char_impl, false , false , "t" )
1208
+ will_find_char ( cx, find_next_char_impl, false , false )
1218
1209
}
1219
1210
1220
1211
fn find_next_char ( cx : & mut Context ) {
1221
- will_find_char ( cx, find_next_char_impl, true , false , "f" )
1212
+ will_find_char ( cx, find_next_char_impl, true , false )
1222
1213
}
1223
1214
1224
1215
fn extend_till_char ( cx : & mut Context ) {
1225
- will_find_char ( cx, find_next_char_impl, false , true , "t" )
1216
+ will_find_char ( cx, find_next_char_impl, false , true )
1226
1217
}
1227
1218
1228
1219
fn extend_next_char ( cx : & mut Context ) {
1229
- will_find_char ( cx, find_next_char_impl, true , true , "f" )
1220
+ will_find_char ( cx, find_next_char_impl, true , true )
1230
1221
}
1231
1222
1232
1223
fn till_prev_char ( cx : & mut Context ) {
1233
- will_find_char ( cx, find_prev_char_impl, false , false , "T" )
1224
+ will_find_char ( cx, find_prev_char_impl, false , false )
1234
1225
}
1235
1226
1236
1227
fn find_prev_char ( cx : & mut Context ) {
1237
- will_find_char ( cx, find_prev_char_impl, true , false , "F" )
1228
+ will_find_char ( cx, find_prev_char_impl, true , false )
1238
1229
}
1239
1230
1240
1231
fn extend_till_prev_char ( cx : & mut Context ) {
1241
- will_find_char ( cx, find_prev_char_impl, false , true , "T" )
1232
+ will_find_char ( cx, find_prev_char_impl, false , true )
1242
1233
}
1243
1234
1244
1235
fn extend_prev_char ( cx : & mut Context ) {
1245
- will_find_char ( cx, find_prev_char_impl, true , true , "F" )
1236
+ will_find_char ( cx, find_prev_char_impl, true , true )
1246
1237
}
1247
1238
1248
1239
fn repeat_last_motion ( cx : & mut Context ) {
@@ -4392,7 +4383,6 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
4392
4383
4393
4384
cx. on_next_key ( move |cx, event| {
4394
4385
cx. editor . autoinfo = None ;
4395
- cx. editor . pseudo_pending = None ;
4396
4386
if let Some ( ch) = event. char ( ) {
4397
4387
let textobject = move |editor : & mut Editor | {
4398
4388
let ( view, doc) = current ! ( editor) ;
@@ -4441,33 +4431,31 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
4441
4431
}
4442
4432
} ) ;
4443
4433
4444
- if let Some ( ( title, abbrev ) ) = match objtype {
4445
- textobject:: TextObject :: Inside => Some ( ( "Match inside" , "mi" ) ) ,
4446
- textobject:: TextObject :: Around => Some ( ( "Match around" , "ma" ) ) ,
4434
+ let title = match objtype {
4435
+ textobject:: TextObject :: Inside => "Match inside" ,
4436
+ textobject:: TextObject :: Around => "Match around" ,
4447
4437
_ => return ,
4448
- } {
4449
- let help_text = [
4450
- ( "w" , "Word" ) ,
4451
- ( "W" , "WORD" ) ,
4452
- ( "p" , "Paragraph" ) ,
4453
- ( "c" , "Class (tree-sitter)" ) ,
4454
- ( "f" , "Function (tree-sitter)" ) ,
4455
- ( "a" , "Argument/parameter (tree-sitter)" ) ,
4456
- ( "o" , "Comment (tree-sitter)" ) ,
4457
- ( "t" , "Test (tree-sitter)" ) ,
4458
- ( "m" , "Closest surrounding pair to cursor" ) ,
4459
- ( " " , "... or any character acting as a pair" ) ,
4460
- ] ;
4461
-
4462
- cx. editor . autoinfo = Some ( Info :: new (
4463
- title,
4464
- help_text
4465
- . into_iter ( )
4466
- . map ( |( col1, col2) | ( col1. to_string ( ) , col2. to_string ( ) ) )
4467
- . collect ( ) ,
4468
- ) ) ;
4469
- cx. editor . pseudo_pending = Some ( abbrev. to_string ( ) ) ;
4470
4438
} ;
4439
+ let help_text = [
4440
+ ( "w" , "Word" ) ,
4441
+ ( "W" , "WORD" ) ,
4442
+ ( "p" , "Paragraph" ) ,
4443
+ ( "c" , "Class (tree-sitter)" ) ,
4444
+ ( "f" , "Function (tree-sitter)" ) ,
4445
+ ( "a" , "Argument/parameter (tree-sitter)" ) ,
4446
+ ( "o" , "Comment (tree-sitter)" ) ,
4447
+ ( "t" , "Test (tree-sitter)" ) ,
4448
+ ( "m" , "Closest surrounding pair to cursor" ) ,
4449
+ ( " " , "... or any character acting as a pair" ) ,
4450
+ ] ;
4451
+
4452
+ cx. editor . autoinfo = Some ( Info :: new (
4453
+ title,
4454
+ help_text
4455
+ . into_iter ( )
4456
+ . map ( |( col1, col2) | ( col1. to_string ( ) , col2. to_string ( ) ) )
4457
+ . collect ( ) ,
4458
+ ) ) ;
4471
4459
}
4472
4460
4473
4461
fn surround_add ( cx : & mut Context ) {
0 commit comments