Beispiel #1
0
 def cb_tab( self ):
     if re.search(r'^\s*$', env.before):
         o = '    '
     else:
         o = '\<C-X>\<C-O>'
     feedkeys(o)
     return True
Beispiel #2
0
    def cb_enter(self):
        feedkeys('\<C-e>')

        if Status.name != 'wubi':
            feedkeys('\<cr>')

        return True
Beispiel #3
0
    def cb_jump(self):
        string = env.after
        tag=r'\'"([{}])'

        n_list=[ ]
        for i in tag:
            t=string.find( i )
            if t > -1:
                n_list.append( t )

        if len( n_list ) > 0:
            feedkeys( '\<right>' * ( min( n_list ) +1))
        return True
Beispiel #4
0
    def cb_backspace(self):
        #for c in env.before:
        #    if c != ' ':
        #        break
        #else: #
        #    l = len(env.before)
        #    if l != 0:
        #        left = l % 4
        #        if left == 0:
        #            left = 4
        #        feedkeys('\<bs>' * left)
        #        return True

        feedkeys('\<bs>')
        return True
Beispiel #5
0
 def cb_space(self):
     log.info("status.name %s", Status.name)
     if Status.name == 'wubi':
         feedkeys('\<C-N>')
         feedkeys('\<C-Y>')
         return True
     else:
         #feedkeys('\<C-Y>')
         feedkeys(' ')
         return True
Beispiel #6
0
 def cb_backspace(self):
     feedkeys('\<bs>')
     #feedkeys('\<C-X>\<C-O>\<C-P>')  # TODO   should auto
     return True
Beispiel #7
0
 def cb_space(self):
         #feedkeys('\<C-Y>')
         feedkeys(' ')
         return True
Beispiel #8
0
    def cb_enter(self):
        feedkeys('\<C-e>')

        return True
Beispiel #9
0
 def cb_esc(self):
     feedkeys('\<esc>')
     return True
Beispiel #10
0
 def cb_tab(self):
     feedkeys('\<C-n>')
     return True
Beispiel #11
0
 def cb_underline(self):
     feedkeys('_')
     return True
Beispiel #12
0
 def cb_dot(self):
     if env.before.endswith('.'):
         feedkeys('\<bs>->')
     else:
         feedkeys('.')
     return True
Beispiel #13
0
 def cb_brace(self):#{  }
     if env.after == '' and  env.before.endswith(')'):
         feedkeys('\<cr>{\<cr>}\<up>\<cr>')
         return True
     self.double_out('{', '}')
     return True
Beispiel #14
0
 def double_out(self, d, b):
     if env.after == '':
         feedkeys([d , b , '\\<left>'])
     else:
         feedkeys(d)
     return True
Beispiel #15
0
 def cb_dot(self):
     feedkeys('.')
     return True