make it possible to disable highlighters

This commit is contained in:
2023-01-26 19:31:33 +01:00
parent 8eee09680e
commit 07a6ec69fa
4 changed files with 47 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ class Highlighting:
if not section.startswith("highlighting."):
continue
active = session.getboolean(section, "active", fallback=True)
query = session.get(section, "query", fallback="")
if len(query) == 0:
continue
@@ -31,7 +32,8 @@ class Highlighting:
ignore_case=ignore_case,
is_regex=is_regex,
hit_background_color=hit_background_color,
line_background_color=line_background_color
line_background_color=line_background_color,
active=active
)
result.append(highlight)
except:
@@ -49,6 +51,7 @@ class Highlighting:
section = "highlighting.%d" % section_counter
section_counter = section_counter + 1
settings.session.add_section(section)
settings.session.set(section, "active", str(highlighter.active))
settings.session.set(section, "query", highlighter.query)
settings.session.set(section, "ignore-case", str(highlighter.ignore_case))
settings.session.set(section, "is-regex", str(highlighter.is_regex))