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

beginend support breaks several features #533

Closed
leungbk opened this issue Sep 12, 2021 · 4 comments
Closed

beginend support breaks several features #533

leungbk opened this issue Sep 12, 2021 · 4 comments

Comments

@leungbk
Copy link
Contributor

leungbk commented Sep 12, 2021

  1. beginend-foo-goto-beginning and -end don't presently have the :jump property set to t.
  2. In Vim, pressing 123G should take me to line 123. The beginend-foo-goto-end commands don't support this. We might have to make some wrappers.

cc @balajisivaraman

@balajisivaraman
Copy link
Contributor

@leungbk, Thanks for pointing this out. I'm working on a fix for it. (I didn't know that this motion existed either in Vim or Evil, since I have never used it.)

@balajisivaraman
Copy link
Contributor

balajisivaraman commented Sep 13, 2021

@leungbk, Does this look like an acceptable fix?

(evil-define-motion evil-beginend-prog-mode-goto-beginning (count)
  :jump t
  :type line
  (if count
      (evil-goto-first-line count)
    (beginend-prog-mode-goto-beginning)))

(evil-define-motion evil-beginend-prog-mode-goto-end (count)
  :jump t
  :type line
  (if count
      (evil-goto-line count)
    (beginend-prog-mode-goto-end)))kk

It works when I tried it locally. I will have to use a macro probably to do this for all the beginend-foo-goto-beginning functions.

I originally tried just doing (evil-add-command-properties 'beginend-foo-goto-beginning :jump t) and (evil-set-command-property 'beginend-foo-goto-beginning :jump t), but this did not work. This is why I had to resort to the above solution of defining a new motion, which is working.

If this is acceptable, I'll work on a proper fix for all the beginend modes. Cheers.

cc: @condy0919

@condy0919
Copy link
Collaborator

Looks good to me.

@leungbk
Copy link
Contributor Author

leungbk commented Sep 13, 2021

Looks good to me, too.

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

No branches or pull requests

3 participants