refactor: extract URL opening functionality into dedicated io.offer_url method

This commit is contained in:
Paul Gauthier (aider) 2024-11-07 10:26:33 -08:00
parent 2cf93ccb54
commit 0368c3fae9
2 changed files with 10 additions and 3 deletions

View file

@ -829,9 +829,7 @@ class Coder:
urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates
for url in urls:
url = url.rstrip(".',\"")
#ai refactor this into a io.offer_url() function!
if self.io.confirm_ask("Open URL for more info?", subject=url):
webbrowser.open(url)
self.io.offer_url(url)
return urls
def check_for_urls(self, inp: str) -> List[str]: