Skip to content

Commit 0541559

Browse files
committed
screen.prompt(): make file_glob mandatory
1 parent bd003e1 commit 0541559

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

babi/screen.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,11 @@ def prompt(
393393
self,
394394
prompt: str,
395395
*,
396+
file_glob: bool,
396397
allow_empty: bool = False,
397398
history: str | None = None,
398399
default_prev: bool = False,
399400
default: str | None = None,
400-
file_glob: bool = False,
401401
) -> str | PromptResult:
402402
default = default or ''
403403
self.status.clear()
@@ -425,7 +425,7 @@ def prompt(
425425
return ret
426426

427427
def go_to_line(self) -> None:
428-
response = self.prompt('enter line number')
428+
response = self.prompt('enter line number', file_glob=False)
429429
if response is not PromptResult.CANCELLED:
430430
try:
431431
lineno = int(response)
@@ -456,7 +456,9 @@ def uncut(self) -> None:
456456
self.file.uncut(self.cut_buffer, self.layout.file)
457457

458458
def _get_search_re(self, prompt: str) -> Pattern[str] | PromptResult:
459-
response = self.prompt(prompt, history='search', default_prev=True)
459+
response = self.prompt(
460+
prompt, history='search', default_prev=True, file_glob=False,
461+
)
460462
if response is PromptResult.CANCELLED:
461463
return response
462464
try:
@@ -495,7 +497,10 @@ def replace(self) -> None:
495497
search_response = self._get_search_re('search (to replace)')
496498
if search_response is not PromptResult.CANCELLED:
497499
response = self.prompt(
498-
'replace with', history='replace', allow_empty=True,
500+
'replace with',
501+
history='replace',
502+
allow_empty=True,
503+
file_glob=False,
499504
)
500505
if response is not PromptResult.CANCELLED:
501506
try:
@@ -686,7 +691,7 @@ def _command_retheme(self, args: list[str]) -> None:
686691
}
687692

688693
def command(self) -> EditResult | None:
689-
response = self.prompt('', history='command')
694+
response = self.prompt('', history='command', file_glob=False)
690695
if response is PromptResult.CANCELLED:
691696
return None
692697

0 commit comments

Comments
 (0)