Skip to content

Commit

Permalink
Fix selection issue (#71)
Browse files Browse the repository at this point in the history
Fixes #66
  • Loading branch information
facelessuser authored Jan 17, 2019
1 parent 8d50e13 commit af42cd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# HexViewer 2.6.4

- **FIX**: Fix issue with with selecting the correct hex byte when a character in the ASCII column is selected on the last row.

# HexViewer 2.6.3

- **FIX**: Fix change log auto-linking issue.
Expand Down
8 changes: 7 additions & 1 deletion hex_highlighter.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,19 @@ def ascii_to_hex(self, sel):
end = sel.end()
num_bytes = 0
ascii_range = view.extract_scope(sel.begin())
if view.match_selector(ascii_range.begin(), 'keyword.ascii-start.hex'):
ascii_range = sublime.Region(ascii_range.begin() + 1, ascii_range.end())
if view.substr(ascii_range.end()) == '\x00':
offset = 0
else:
offset = 1

# Determine if selection is within ascii range
if (
start >= ascii_range.begin() and
(
# Single selection should ignore the end of line selection
(end == start and end < ascii_range.end() - 1) or
(end == start and end < ascii_range.end() - offset) or
(end != start and end < ascii_range.end())
)
):
Expand Down
2 changes: 1 addition & 1 deletion support.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import webbrowser
import re

__version__ = "2.6.3"
__version__ = "2.6.4"
__pc_name__ = 'HexViewer'

CSS = '''
Expand Down

0 comments on commit af42cd3

Please sign in to comment.