From e1d5d4b960ae24894a18172b176b319d331a3c4e Mon Sep 17 00:00:00 2001 From: Fredrik Ehnbom Date: Sat, 16 Feb 2013 14:04:02 +0100 Subject: [PATCH] Use sencode rather than encode("utf-8"). Fixes #202 --- errormarkers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/errormarkers.py b/errormarkers.py index 6a7251d..58bda34 100644 --- a/errormarkers.py +++ b/errormarkers.py @@ -2,9 +2,9 @@ import sublime_plugin from collections import defaultdict try: - from .internals.common import get_setting, sdecode + from .internals.common import get_setting, sdecode, sencode except: - from internals.common import get_setting, sdecode + from internals.common import get_setting, sdecode, sencode ERRORS = {} @@ -18,7 +18,7 @@ class ClangNext(sublime_plugin.TextCommand): def run(self, edit): v = self.view - fn = v.file_name().encode("utf-8") + fn = sencode(v.file_name()) line, column = v.rowcol(v.sel()[0].a) gotoline = -1 if fn in ERRORS: @@ -41,7 +41,7 @@ def run(self, edit): class ClangPrevious(sublime_plugin.TextCommand): def run(self, edit): v = self.view - fn = v.file_name().encode("utf-8") + fn = sencode(v.file_name()) line, column = v.rowcol(v.sel()[0].a) gotoline = -1 if fn in ERRORS: @@ -150,7 +150,7 @@ def show_error_marks(view): fill_outlines = False gutter_mark = 'dot' outlines = {'warning': [], 'illegal': []} - fn = view.file_name().encode("utf-8") + fn = sencode(view.file_name()) markers = {'warning': get_setting("marker_warning_scope", "comment"), 'illegal': get_setting("marker_error_scope", "invalid") } @@ -186,7 +186,7 @@ def last_selected_lineno(view): def update_statusbar(view): fn = view.file_name() if fn is not None: - fn = fn.encode("utf-8") + fn = sencode(fn) lineno = last_selected_lineno(view) if fn in ERRORS and lineno in ERRORS[fn]: @@ -226,7 +226,7 @@ def has_errors(self, view): fn = view.file_name() if fn is None: return False - return fn.encode("utf-8") in ERRORS or fn in WARNINGS + return sencode(fn) in ERRORS or fn in WARNINGS def show_errors(self, view): if self.has_errors(view) and not get_setting("error_marks_on_panel_only", False, view):