def _(event): """ Move left to the previous occurance of c, then one char forward. """ vi_state.last_character_find = CharacterFind(event.data, True) match = event.current_buffer.document.find_backwards(event.data, in_current_line=True, count=event.arg) return CursorRegion(match + 1 if match else 0)
def _(event): """ Go to previous occurance of character. Typing 'Fx' will move the cursor to the previous occurance of character. 'x'. """ vi_state.last_character_find = CharacterFind(event.data, True) return CursorRegion(event.current_buffer.document.find_backwards(event.data, in_current_line=True, count=event.arg) or 0)
def _(event): """ Move right to the next occurance of c, then one char backward. """ vi_state.last_character_find = CharacterFind(event.data, False) match = event.current_buffer.document.find(event.data, in_current_line=True, count=event.arg) return CursorRegion(match - 1 if match else 0)
def _(event): """ Go to next occurance of character. Typing 'fx' will move the cursor to the next occurance of character. 'x'. """ vi_state.last_character_find = CharacterFind(event.data, False) match = event.current_buffer.document.find(event.data, in_current_line=True, count=event.arg) return CursorRegion(match or 0)