Skip to content

Commit

Permalink
Update img-txt_viewer.pyw - Suggestion fix
Browse files Browse the repository at this point in the history
Fixed suggestions breaking when typing a parentheses.
  • Loading branch information
Nenotriple authored Dec 22, 2023
1 parent e54ef6f commit 96d821d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions img-txt_viewer.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ More info here: https://github.com/Nenotriple/img-txt_viewer
"""

VERSION = "v1.83"
VERSION = "v1.84"

################################################################################################################################################
################################################################################################################################################
Expand Down Expand Up @@ -278,7 +278,7 @@ class Autocomplete:
if not hasattr(self, 'data') or not self.data:
return None
text_with_underscores = text.replace(" ", "_")
text_with_asterisks = text_with_underscores.replace("*", ".*")
text_with_asterisks = re.escape(text_with_underscores).replace("\\*", ".*")
pattern = re.compile(text_with_asterisks)
if self.previous_text is not None and text.startswith(self.previous_text):
suggestions = [suggestion for suggestion in self.previous_suggestions if pattern.match(suggestion[0])]
Expand Down Expand Up @@ -1834,21 +1834,20 @@ root.mainloop()

'''
[v1.83 changes:](https://github.com/Nenotriple/img-txt_viewer/releases/tag/v1.83)
[v1.84 changes:](https://github.com/Nenotriple/img-txt_viewer/releases/tag/v1.84)
- New:
-
<br>
- Fixed:
- Fix text box duplicating when selecting a new directory.
- Fixed some small issues with the file watcher, and image index.
- Fixed suggestions breaking when typing a parentheses.
<br>
- Other changes:
- Minor code cleanup and internal changes.
-
<!-- New -->
Expand Down

0 comments on commit 96d821d

Please sign in to comment.