parent
ec2d1ab3ea
commit
eff5bef2bb
19
method.py
19
method.py
|
@ -1427,6 +1427,25 @@ class SomethingCrazy(Method):
|
|||
def _execute(self, w, **vargs):
|
||||
pass
|
||||
|
||||
class InsertSquotes(Method):
|
||||
'''Insert a pair of single-quotes into the buffer'''
|
||||
def _execute(self, w, **vargs):
|
||||
w.insert_string_at_cursor("''")
|
||||
w.backward()
|
||||
class InsertDquotes(Method):
|
||||
'''Insert a pair of double-quotes into the buffer'''
|
||||
def _execute(self, w, **vargs):
|
||||
w.insert_string_at_cursor('""')
|
||||
w.backward()
|
||||
class InsertEscapedSquote(Method):
|
||||
'''Insert an escaped single-quote'''
|
||||
def _execute(self, w, **vargs):
|
||||
w.insert_string_at_cursor("\\'")
|
||||
class InsertEscapedDquote(Method):
|
||||
'''Insert an escaped double-quote'''
|
||||
def _execute(self, w, **vargs):
|
||||
w.insert_string_at_cursor('\\"')
|
||||
|
||||
class CloseTag(Method):
|
||||
mytag = ')'
|
||||
def _execute(self, w, **vargs):
|
||||
|
|
|
@ -179,6 +179,10 @@ class Fundamental(Handler):
|
|||
self.add_bindings('grep', ('C-c g',))
|
||||
self.add_bindings('pipe', ('C-c p',))
|
||||
self.add_bindings('view-buffer-parent', ('C-c .',))
|
||||
self.add_bindings('insert-squotes', ('M-\'',))
|
||||
self.add_bindings('insert-dquotes', ('M-"',))
|
||||
self.add_bindings('insert-escaped-squote', ('C-c M-\'',))
|
||||
self.add_bindings('insert-escaped-dquote', ('C-c M-"',))
|
||||
|
||||
# unbound actions
|
||||
self.add_action(method.GetToken())
|
||||
|
|
Loading…
Reference in New Issue