Skip to content

Commit

Permalink
added binary_hex_view config
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Feb 29, 2024
1 parent ae5083c commit 9e9bfe8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cat_win/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,10 @@ def edit_content(content: list, show_bytecode: bool, file_index: int = 0,
const_dic[DKW.STRINGS_MIN_SEQUENCE_LENGTH],
const_dic[DKW.STRINGS_DELIMETER])
elif show_bytecode:
content = [(prefix, repr(line)[2:-1]) for prefix, line in content]

if const_dic[DKW.BINARY_HEX_VIEW]:
content = [(prefix, repr(line)[2:-1]) for prefix, line in content]
else:
content = [(prefix, ''.join(map(chr, line))) for prefix, line in content]

if holder.args_id[ARGS_SPECIFIC_FORMATS]:
content = Formatter.format(content)
Expand Down
1 change: 1 addition & 0 deletions cat_win/const/defaultconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ class DKW:
EDITOR_AUTO_INDENT = 'editor_auto_indent'
STRINGS_MIN_SEQUENCE_LENGTH = 'strings_minimum_sequence_length'
STRINGS_DELIMETER = 'strings_delimeter'
BINARY_HEX_VIEW = 'binary_hex_view'
1 change: 1 addition & 0 deletions cat_win/persistence/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Config:
DKW.EDITOR_AUTO_INDENT: False,
DKW.STRINGS_MIN_SEQUENCE_LENGTH: 4,
DKW.STRINGS_DELIMETER: '\n',
DKW.BINARY_HEX_VIEW: False,
}

elements = list(default_dic.keys())
Expand Down

0 comments on commit 9e9bfe8

Please sign in to comment.