Skip to content

Commit 574d8ad

Browse files
committed
Removed obsolete code
1 parent 2d212ba commit 574d8ad

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

unicodecomplete.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,6 @@ def get_line_contents(view, location):
2929
return view.substr(sublime.Region(view.line(location).a, location))
3030

3131

32-
def get_unicode_prefix(view, location):
33-
"""
34-
Returns unicode prefix at given location and it's region
35-
or None if there is no unicode prefix
36-
"""
37-
cts = get_line_contents(view, location)
38-
res = LIST_PREFIX_RE.match(cts) or UNICODE_PREFIX_RE.match(cts)
39-
if res:
40-
(full_, pref_) = res.groups()
41-
return (pref_, sublime.Region(location - len(full_), location))
42-
else:
43-
return None
44-
45-
46-
def is_unicode_prefix(view, location):
47-
"""
48-
Returns True if prefix at given location is prefixed with backslash
49-
"""
50-
cts = get_line_contents(view, location)
51-
return (UNICODE_PREFIX_RE.match(cts) is not None) or (LIST_PREFIX_RE.match(cts) is not None)
52-
53-
5432
def is_script(s):
5533
"""
5634
Subscript _... or superscript ^...
@@ -62,14 +40,6 @@ def get_script(s):
6240
return (s[0], list(s[1:]))
6341

6442

65-
def get_list_prefix(s):
66-
# prefix\abc -> (prefix, [a, b, c])
67-
m = LIST_RE.match(s)
68-
if not m:
69-
return (None, None)
70-
return (m.group('prefix'), list(m.group('list')))
71-
72-
7343
def enabled(name, default=True):
7444
return get_settings().get(name, default)
7545

@@ -269,24 +239,6 @@ def run(self, edit):
269239
self.view.insert(edit, r.a, " ")
270240

271241

272-
class UnicodeMathSwap(sublime_plugin.TextCommand):
273-
def run(self, edit):
274-
for r in self.view.sel():
275-
upref = get_unicode_prefix(self.view, self.view.word(r).b)
276-
sym = symbol_by_name(upref[0]) if upref else None
277-
symc = symbol_by_code(u'\\' + upref[0]) if upref else None
278-
if upref and (sym or symc):
279-
self.view.replace(edit, upref[1], sym or symc)
280-
elif r.b - r.a <= 1:
281-
u = sublime.Region(r.b - 1, r.b)
282-
usym = self.view.substr(u)
283-
names = names_by_symbol(usym)
284-
if not names:
285-
self.view.replace(edit, u, code_by_symbol(usym))
286-
else:
287-
self.view.replace(edit, u, u'\\' + names[0])
288-
289-
290242
class UnicodeMathReplaceInView(sublime_plugin.TextCommand):
291243
def run(self, edit, replace_with=None, begin=None, end=None):
292244
if not replace_with:

0 commit comments

Comments
 (0)