fixes #100 - pasting at EOF should create new line #103

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

guillermooo commented Mar 28, 2012

I think ViPasteRight needs to account for the case where the sel is at EOF to position the caret at the beginning of the last line. At the moment it incorrectly places it after EOL of the last line that existed before the paste operation.

Contributor

guillermooo commented Mar 29, 2012

Thanks for the feedback. I'm not sure how to check whether we're in visual line mode/visual characterwise selection and at the same time make yy still insert a new line when it's the last line of the buffer.

Contributor

guillermooo commented Mar 29, 2012

Btw, if #104 is accepted, I will have to redo this against those changes.

+ if (self.view.rowcol(s.end())[0] == \
+ self.view.rowcol(self.view.size())[0]):
+ text = '\n' + text[:-1]
+
@misfo

misfo Apr 6, 2012

Collaborator

This last set of changes to pasting looks good. Can you submit this as a separate fix (for #117)?

Collaborator

misfo commented Apr 6, 2012

I'm thinking the fix for #100 can be a lot simpler (the fix for #117 is great!) If the motion mode indicates a linewise motion/selection, ensure what's being put in the register has a trailing newline. So we don't really have to have special EOF conditions; we'll just always check that linewise yanks always have the newline.

Contributor

guillermooo commented Apr 12, 2012

Deprecating this patch. There will be a new series of patches addressing operations at EOF and other newline-related problems when yanking/deleting/pasting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment