Skip to content

Commit

Permalink
Fix p from visual mode pasting over one char too many
Browse files Browse the repository at this point in the history
  • Loading branch information
misfo committed Feb 16, 2012
1 parent 52622a7 commit b679520
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vintage.py
Expand Up @@ -765,9 +765,11 @@ def advance(self, pt):
return pt + 1

def run(self, edit, register = '"'):
if not self.view.has_non_empty_selection_region():
visual_mode = self.view.has_non_empty_selection_region()
if not visual_mode:
transform_selection(self.view, lambda pt: self.advance(pt))
self.view.run_command('paste_from_register', {'forward': True, 'register': register})
self.view.run_command('paste_from_register', {'forward': not visual_mode,
'register': register})

class ViPasteLeft(sublime_plugin.TextCommand):
# Ensure the register is picked up from g_input_state, and that it'll be
Expand Down

0 comments on commit b679520

Please sign in to comment.