parent
2f23872896
commit
348e6eee2a
|
@ -104,7 +104,7 @@ class Application(object):
|
|||
'method', 'method.svn', 'method.cvs', 'method.search',
|
||||
'method.buffers', 'method.move', 'method.shell',
|
||||
'method.introspect', 'method.help', 'method.numbers',
|
||||
'method.spell', 'method.hg',
|
||||
'method.spell', 'method.hg', 'method.utf8',
|
||||
)
|
||||
for name in names:
|
||||
exec("import %s" % name)
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
import os, commands, re, tempfile
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
|
||||
import buffer, default, dirutil, lex, regex, util, window
|
||||
from point import Point
|
||||
|
||||
from method import Method, Argument, arg
|
||||
|
||||
class Utf8Get(Method):
|
||||
def _execute(self, w, **vargs):
|
||||
p = w.logical_cursor()
|
||||
c = w.buffer.get_substring(p, p.add(1, 0))
|
||||
w.set_error(repr(c))
|
||||
|
||||
class Utf8Describe(Method):
|
||||
def _execute(self, w, **vargs):
|
||||
w.set_error("not implemented")
|
||||
|
||||
class Utf8Insert(Method):
|
||||
'''insert the specified UTF-8 character into the buffer'''
|
||||
args = [arg("data", t=type(""), p="Data: ",
|
||||
h="the UTF-8 escaped data to use to use")]
|
||||
def _execute(self, w, **vargs):
|
||||
s = "u'" + vargs['data'] + "'"
|
||||
try:
|
||||
u = eval(s, {}, {})
|
||||
w.insert_string_at_cursor(u)
|
||||
except:
|
||||
w.set_error("invalid: %s" % vargs['data'])
|
Loading…
Reference in New Issue