Skip to content

Commit

Permalink
fixes #166 - improve pasting in visual line mode
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermooo committed Mar 29, 2013
1 parent ced9544 commit fc73df9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions action_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def paste_all(self, edit, sel, at, text, count):
text = text + '\n'
else:
text = text * count

if state.mode == MODE_VISUAL_LINE:
if text.startswith('\n'):
text = text[1:]

self.view.replace(edit, sel, text)


Expand Down
4 changes: 2 additions & 2 deletions vi/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ def vi_p(vi_cmd_data):
vi_cmd_data['post_action'] = ['dont_stay_on_eol_backward',]

if vi_cmd_data['mode'] == MODE_VISUAL:
vi_cmd_data['post_action'] = ['collapse_to_a', 'dont_stay_on_eol_backward']
vi_cmd_data['post_action'] = ['collapse_to_a',]
vi_cmd_data['follow_up_mode'] = 'vi_enter_normal_mode'
elif vi_cmd_data['mode'] == MODE_VISUAL_LINE:
vi_cmd_data['post_action'] = ['collapse_to_a', 'dont_stay_on_eol_backward']
vi_cmd_data['post_action'] = ['collapse_to_a',]
vi_cmd_data['follow_up_mode'] = 'vi_enter_normal_mode'

return vi_cmd_data
Expand Down

0 comments on commit fc73df9

Please sign in to comment.