Skip to content
Browse files

Use sencode rather than encode("utf-8"). Fixes #202

  • Loading branch information...
1 parent 0cca8bb commit e1d5d4b960ae24894a18172b176b319d331a3c4e @quarnster committed Feb 16, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 errormarkers.py
View
14 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):

0 comments on commit e1d5d4b

Please sign in to comment.
Something went wrong with that request. Please try again.