From 68e3cd1c5d50df621983e52f28d449b5c6aefa0f Mon Sep 17 00:00:00 2001 From: Loris Bognanni Date: Sun, 28 Aug 2022 20:19:11 +0100 Subject: [PATCH] :bug: Fix message encoding to process Now you run external commands on text with emojis --- .python-version | 1 + external_command.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..98fccd6 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.8 \ No newline at end of file diff --git a/external_command.py b/external_command.py index bdcaeb4..56b3d2b 100644 --- a/external_command.py +++ b/external_command.py @@ -105,6 +105,7 @@ def run_command(self, region_text): stderr=subprocess.PIPE, shell=True, universal_newlines=True, + encoding="utf-8", env=env) stdout, stderr = self.proc.communicate(region_text) @@ -290,7 +291,7 @@ def start(cmdline): SublimeExternalCommandHistory.index = -1 panel = self.view.window().show_input_panel('Command:', "", start, None, None) # This sets a scope to the input panel, which enables the history navigation commands. - panel.set_syntax_file('Packages/SublimeExternalCommand/external_command.hidden-tmLanguage') + panel.set_syntax_file('Packages/External Command/external_command.hidden-tmLanguage') panel.settings().set('is_widget', True) panel.settings().set('gutter', False) panel.settings().set('rulers', [])