Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
Use sencode rather than encode("utf-8"). Fixes #202
Browse files Browse the repository at this point in the history
  • Loading branch information
quarnster committed Feb 16, 2013
1 parent 0cca8bb commit e1d5d4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions errormarkers.py
Expand Up @@ -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 = {}
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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")
}
Expand Down Expand Up @@ -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]:
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit e1d5d4b

Please sign in to comment.