@@ -1185,7 +1185,7 @@ sub edit_hunk_loop {
11851185
11861186sub help_patch_cmd {
11871187 local $_ ;
1188- my $other = $_ [0] . " ,/, ?" ;
1188+ my $other = $_ [0] . " ,?" ;
11891189 print colored $help_color , __($help_patch_modes {$patch_mode }), " \n " ,
11901190 map { " $_ \n " } grep {
11911191 my $c = quotemeta (substr ($_ , 0, 1));
@@ -1308,39 +1308,39 @@ sub display_hunks {
13081308
13091309my %patch_update_prompt_modes = (
13101310 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 ,?]? " ),
13141314 },
13151315 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 ,?]? " ),
13191319 },
13201320 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 ,?]? " ),
13241324 },
13251325 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 ,?]? " ),
13291329 },
13301330 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 ,?]? " ),
13341334 },
13351335 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 ,?]? " ),
13391339 },
13401340 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 ,?]? " ),
13441344 },
13451345);
13461346
@@ -1396,7 +1396,7 @@ sub patch_update_file {
13961396 $other .= ' ,J' ;
13971397 }
13981398 if ($num > 1) {
1399- $other .= ' ,g' ;
1399+ $other .= ' ,g,/ ' ;
14001400 }
14011401 for ($i = 0; $i < $num ; $i ++) {
14021402 if (!defined $hunk [$i ]{USE }) {
@@ -1484,6 +1484,10 @@ sub patch_update_file {
14841484 }
14851485 elsif ($line =~ m | ^/(.*)| ) {
14861486 my $regex = $1 ;
1487+ unless ($other =~ m | /| ) {
1488+ error_msg __(" No other hunks to search\n " );
1489+ next ;
1490+ }
14871491 if ($1 eq " " ) {
14881492 print colored $prompt_color , __(" search for regex? " );
14891493 $regex = <STDIN >;
0 commit comments