Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for universal argument before paste #11340

Closed
wants to merge 2 commits into from
Closed

Conversation

bet4it
Copy link
Contributor

@bet4it bet4it commented Sep 19, 2018

We should use (interactive "*P") in spacemacs/evil-mc-paste-before and spacemacs/evil-mc-paste-after to get the raw prefix argument.

evil-paste-before and evil-paste-after don't support plain prefix argument, so if we press SPC u p in spacemacs, we want to paste one time without indenting.
But there is already a meaning of C-u C-y in emacs, which is put point at beginning, and mark at end when yanking. So it's ambiguous when we trigger C-u C-y in spacemacs.We may want to yank with the point at beginning or just yank without indenting.
We do both of them before, which looks like a misuse. After this pull request, C-u C-y will only yank without indenting. There may be some emacs users confuse with it, but if they don't work on spacemacs-indent-sensitive-modes, they should also be confused before.
And as there is only one universal-argument in emacs, we couldn't do something like paste four times with auto indent disabled temporarily. So maybe we should find another way to temporarily disable auto indent?

By the way, as defadvice is obsolete, I replace the use of spacemacs|advise-commands with advice-add.

layers/+spacemacs/spacemacs-evil/funcs.el Show resolved Hide resolved
@duianto
Copy link
Contributor

duianto commented Apr 24, 2019

Another PR also suggests adding a universal argument to paste:
Fix pasting with universal argument #11858

How do this PR compare to that one?

@bet4it
Copy link
Contributor Author

bet4it commented Apr 25, 2019

What has done in #11858 has already been included in this pull request.
And this pull request adds two extra changes:

  1. Fix the errors related to universal argument when people enable multiple-cursors layer.
  2. Rewrite spacemacs|advise-commands with advice-add, as defadvice is obsoleted.

@duianto
Copy link
Contributor

duianto commented Apr 25, 2019

Ok then we'll prefer this one over #11858

@duianto duianto dismissed their stale review April 25, 2019 17:27

It's fine to remove the form-feed character in this instance.

@duianto
Copy link
Contributor

duianto commented Apr 25, 2019

Thank you for contributing to Spacemacs!
The PR has been cherry-picked into the develop branch, you can safely delete your branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants