Skip to content

Commit

Permalink
Raise the special "sel" minimap tag above others (fixes #1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 19, 2023
1 parent 2845a5d commit f24e014
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ Unlike the Git commit history, this changelog does not include code cleanups
and other details that don't affect using Porcupine.


## Unreleased

Fixes a bug where on some computers, the minimap would show keywords and other highlighted parts of the code with a ridiculously large font (see [#](https://github.com/Akuli/porcupine/issues/1171)). The minimap is the narrow view of the file being edited on the side.


## v2022.11.25

New keyboard shortcuts and UI fixes:
Expand Down
6 changes: 6 additions & 0 deletions porcupine/plugins/minimap.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ def _scroll_callback(self) -> None:
def _update_sel_tag(self, junk: object = None) -> None:
self.tag_add("sel", "1.0", "end")

# This is also done in use_pygments_tags(), but that doesn't apply
# to peer widgets like this one (#1171)
for tag in self.tag_names():
if tag.startswith("Token."):
self.tag_raise("sel", tag)

def _update_lines(self, *junk: object) -> None:
if not self.tag_cget("sel", "font"):
# view was created just a moment ago, set_font() hasn't ran yet
Expand Down

0 comments on commit f24e014

Please sign in to comment.