def cb_tab( self ): if re.search(r'^\s*$', env.before): o = ' ' else: o = '\<C-X>\<C-O>' feedkeys(o) return True
def cb_enter(self): feedkeys('\<C-e>') if Status.name != 'wubi': feedkeys('\<cr>') return True
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
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
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
def cb_backspace(self): feedkeys('\<bs>') #feedkeys('\<C-X>\<C-O>\<C-P>') # TODO should auto return True
def cb_space(self): #feedkeys('\<C-Y>') feedkeys(' ') return True
def cb_enter(self): feedkeys('\<C-e>') return True
def cb_esc(self): feedkeys('\<esc>') return True
def cb_tab(self): feedkeys('\<C-n>') return True
def cb_underline(self): feedkeys('_') return True
def cb_dot(self): if env.before.endswith('.'): feedkeys('\<bs>->') else: feedkeys('.') return True
def cb_brace(self):#{ } if env.after == '' and env.before.endswith(')'): feedkeys('\<cr>{\<cr>}\<up>\<cr>') return True self.double_out('{', '}') return True
def double_out(self, d, b): if env.after == '': feedkeys([d , b , '\\<left>']) else: feedkeys(d) return True
def cb_dot(self): feedkeys('.') return True