@@ -1185,7 +1185,7 @@ sub edit_hunk_loop {
1185
1185
1186
1186
sub help_patch_cmd {
1187
1187
local $_ ;
1188
- my $other = $_ [0] . " ,/, ?" ;
1188
+ my $other = $_ [0] . " ,?" ;
1189
1189
print colored $help_color , __($help_patch_modes {$patch_mode }), " \n " ,
1190
1190
map { " $_ \n " } grep {
1191
1191
my $c = quotemeta (substr ($_ , 0, 1));
@@ -1308,39 +1308,39 @@ sub display_hunks {
1308
1308
1309
1309
my %patch_update_prompt_modes = (
1310
1310
stage => {
1311
- mode => N__(" Stage mode change [y,n,q,a,d,/ %s ,?]? " ),
1312
- deletion => N__(" Stage deletion [y,n,q,a,d,/ %s ,?]? " ),
1313
- hunk => N__(" Stage this hunk [y,n,q,a,d,/ %s ,?]? " ),
1311
+ mode => N__(" Stage mode change [y,n,q,a,d%s ,?]? " ),
1312
+ deletion => N__(" Stage deletion [y,n,q,a,d%s ,?]? " ),
1313
+ hunk => N__(" Stage this hunk [y,n,q,a,d%s ,?]? " ),
1314
1314
},
1315
1315
stash => {
1316
- mode => N__(" Stash mode change [y,n,q,a,d,/ %s ,?]? " ),
1317
- deletion => N__(" Stash deletion [y,n,q,a,d,/ %s ,?]? " ),
1318
- hunk => N__(" Stash this hunk [y,n,q,a,d,/ %s ,?]? " ),
1316
+ mode => N__(" Stash mode change [y,n,q,a,d%s ,?]? " ),
1317
+ deletion => N__(" Stash deletion [y,n,q,a,d%s ,?]? " ),
1318
+ hunk => N__(" Stash this hunk [y,n,q,a,d%s ,?]? " ),
1319
1319
},
1320
1320
reset_head => {
1321
- mode => N__(" Unstage mode change [y,n,q,a,d,/ %s ,?]? " ),
1322
- deletion => N__(" Unstage deletion [y,n,q,a,d,/ %s ,?]? " ),
1323
- hunk => N__(" Unstage this hunk [y,n,q,a,d,/ %s ,?]? " ),
1321
+ mode => N__(" Unstage mode change [y,n,q,a,d%s ,?]? " ),
1322
+ deletion => N__(" Unstage deletion [y,n,q,a,d%s ,?]? " ),
1323
+ hunk => N__(" Unstage this hunk [y,n,q,a,d%s ,?]? " ),
1324
1324
},
1325
1325
reset_nothead => {
1326
- mode => N__(" Apply mode change to index [y,n,q,a,d,/ %s ,?]? " ),
1327
- deletion => N__(" Apply deletion to index [y,n,q,a,d,/ %s ,?]? " ),
1328
- hunk => N__(" Apply this hunk to index [y,n,q,a,d,/ %s ,?]? " ),
1326
+ mode => N__(" Apply mode change to index [y,n,q,a,d%s ,?]? " ),
1327
+ deletion => N__(" Apply deletion to index [y,n,q,a,d%s ,?]? " ),
1328
+ hunk => N__(" Apply this hunk to index [y,n,q,a,d%s ,?]? " ),
1329
1329
},
1330
1330
checkout_index => {
1331
- mode => N__(" Discard mode change from worktree [y,n,q,a,d,/ %s ,?]? " ),
1332
- deletion => N__(" Discard deletion from worktree [y,n,q,a,d,/ %s ,?]? " ),
1333
- hunk => N__(" Discard this hunk from worktree [y,n,q,a,d,/ %s ,?]? " ),
1331
+ mode => N__(" Discard mode change from worktree [y,n,q,a,d%s ,?]? " ),
1332
+ deletion => N__(" Discard deletion from worktree [y,n,q,a,d%s ,?]? " ),
1333
+ hunk => N__(" Discard this hunk from worktree [y,n,q,a,d%s ,?]? " ),
1334
1334
},
1335
1335
checkout_head => {
1336
- mode => N__(" Discard mode change from index and worktree [y,n,q,a,d,/ %s ,?]? " ),
1337
- deletion => N__(" Discard deletion from index and worktree [y,n,q,a,d,/ %s ,?]? " ),
1338
- hunk => N__(" Discard this hunk from index and worktree [y,n,q,a,d,/ %s ,?]? " ),
1336
+ mode => N__(" Discard mode change from index and worktree [y,n,q,a,d%s ,?]? " ),
1337
+ deletion => N__(" Discard deletion from index and worktree [y,n,q,a,d%s ,?]? " ),
1338
+ hunk => N__(" Discard this hunk from index and worktree [y,n,q,a,d%s ,?]? " ),
1339
1339
},
1340
1340
checkout_nothead => {
1341
- mode => N__(" Apply mode change to index and worktree [y,n,q,a,d,/ %s ,?]? " ),
1342
- deletion => N__(" Apply deletion to index and worktree [y,n,q,a,d,/ %s ,?]? " ),
1343
- hunk => N__(" Apply this hunk to index and worktree [y,n,q,a,d,/ %s ,?]? " ),
1341
+ mode => N__(" Apply mode change to index and worktree [y,n,q,a,d%s ,?]? " ),
1342
+ deletion => N__(" Apply deletion to index and worktree [y,n,q,a,d%s ,?]? " ),
1343
+ hunk => N__(" Apply this hunk to index and worktree [y,n,q,a,d%s ,?]? " ),
1344
1344
},
1345
1345
);
1346
1346
@@ -1396,7 +1396,7 @@ sub patch_update_file {
1396
1396
$other .= ' ,J' ;
1397
1397
}
1398
1398
if ($num > 1) {
1399
- $other .= ' ,g' ;
1399
+ $other .= ' ,g,/ ' ;
1400
1400
}
1401
1401
for ($i = 0; $i < $num ; $i ++) {
1402
1402
if (!defined $hunk [$i ]{USE }) {
@@ -1484,6 +1484,10 @@ sub patch_update_file {
1484
1484
}
1485
1485
elsif ($line =~ m | ^/(.*)| ) {
1486
1486
my $regex = $1 ;
1487
+ unless ($other =~ m | /| ) {
1488
+ error_msg __(" No other hunks to search\n " );
1489
+ next ;
1490
+ }
1487
1491
if ($1 eq " " ) {
1488
1492
print colored $prompt_color , __(" search for regex? " );
1489
1493
$regex = <STDIN >;
0 commit comments