Skip to content

Commit

Permalink
fix crash and highlight issue due to incorrect regexp_flag
Browse files Browse the repository at this point in the history
I made a mistake in the order of re.NOFLAG and re.I. Also, nvPY can't
use the re.NOFLAG attribute because it does not exist on Python ~3.10.

This commit fixes #231, and fixes #232.
  • Loading branch information
yuuki0xff committed Sep 27, 2023
1 parent 5a0ef81 commit f9defc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nvpy/notes_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def filter_notes_gstyle(self, search_string=None) -> FilterResult:
regexp = None
if tms_pats[1] + tms_pats[2]:
regexp_pattern = '|'.join(re.escape(p) for p in tms_pats[1] + tms_pats[2])
regexp_flag = re.I if self.config.case_sensitive else re.NOFLAG
regexp_flag = 0 if self.config.case_sensitive else re.I
try:
regexp = re.compile(regexp_pattern, regexp_flag)
except re.error:
Expand Down

0 comments on commit f9defc8

Please sign in to comment.