Git Product home page Git Product logo

key-leap's People

Contributors

martinrykfors avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

key-leap's Issues

Extra key added if the last line is wrapped

Set a buffer's major mode to text mode. Enable visual-line-mode. Make the last line of the buffer long enough to wrap.

Result is that the last visual line of the wrapped line also is assigned a key at the margin. We expect there to be no keys assigned to visual lines, only "true" lines are given a key.

Tests are failing

I recently merged a big change that introduces a more fine-grained handling of how overlays are added and deleted.

The two tests that verify that the overlays are correct are currently failing because of this, and I am struggling to figure out why.
Swithching to the buffers created by the tests the overlays appear as they should, but the overlays-at function used by the tests returns an empty list.

Symbol’s value as variable is void: key-leap-evil-motion

Been getting this when loading key-leap on emacs 28.2.

When callling use-package that has ensure t in its config, it will work once installed (but a lot of warnings about docstrings), but restarting emacs will then cause this error to appear. Key-leap will not work after this.

Interference with linum

Enabling key-leap-mode and then linum-mode causes display issues. So far I've just accepted this collision as a natural consequence of them both competing to set the margin.

I'm opening this issue because of the recent discussions on emacs-devel about handling the window margins: http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00066.html

If future versions of Emacs have a way for multiple packages to alter the margin, key-leap-mode should make use of this.

Does not handle folded buffers

When hiding subtrees in org-mode, it will still enumerate the lines as if the folded lines were visible. I don't know if this also applies to folding in other modes, but that would be my guess.

Key-leap is disabled when major mode is switched

If key-leap is enabled in a buffer and the major mode of that buffer is changed, key-leap gets disabled in that buffer. This does not match the behavior of other minor modes that I use, and is kind of annoying.
Expected behavior is that key-leap remains enabled in a buffer whose major mode is changed.

Invisible overlays on the first line of the buffer makes the first key hidden

Create an elisp buffer with a few lines of text in the beginning.
Enable key-leap.
Execute the following (it inserts an invisible overlay from the beginning of the buffer to a few lines down)

(progn
  (let* ((start (point-min))
         (end (save-excursion
                (goto-char (point-min))
                (forward-line 3)
                (point)))
         (ol (make-overlay start end)))
    (overlay-put ol 'invisible t)))

The topmost key in the margin is now missing.

Integrate with evil-mode

There should be an option to make it work like an evil-motion.

By doing the following:

(evil-define-motion key-leap-motion ()
      :type line
      (key-leap-start-matching))

and then adding to the evil-motions keymap:

(define-key evil-motion-state-map (kbd "<SPC>") 'key-leap-motion)

you are able to use key-leap in visual-state and as a motion for evil-operators. You could delete all lines from point to the line indexed as va by typing d<SPC>va for instance.

Two things need doing:

  • Figure out a way for users to enable this feature in their configs. It would need to check that evil-mode is properly installed before defining a motion. Maybe just having a function key-leap-define-evil-motion, that can be added to init.el would do.
  • Document how to set this up in the readme.

Move evil integration to its own package

I'm not that happy with having the evil integration functionality as a part of key-leap.el. In order for it to work, evil must have been required before the function is called. It would be better if the integration occured in its own package that properly specifies its dependency on key-leap and evil. This would mean key-leap.el is freed of the evil integration, which did not really belong there in the first place.

The solution would be to create a new package in this repository, evil-key-leap.el that does the same thing that key-leap-create-evil-motion is currently doing.

It would require the following steps:

  • Change the melpa recipe to explicitly use only key-leap.el as the package source
  • Create evil-key-leap.el and put the integration code there. Its package header should specify key-leap and evil as dependencies
  • Remove the implementation of key-leap-create-evil-motion and mark it as obsolete

org-mode lists cause strange behavior

Create an empty buffer, enable org-mode, then key leap.
Enter a list element - hello then press M-Ret to add a new item.
The key of the first line will be wrong.

There are many more strange things going on with org-mode lists, but this is the easiest way to reliably reproduce one of them.

Option for handling wrapped lines

Currently it differentiates between lines by using forward-visible-line. If a line is wrapped, the wrapped parts are not given keys.

Consider adding an option so one can leap to wrapped lines as well.

Get it on melpa

With #6 out of the way, the only thing I feel missing is getting #9 implemented. After that, save any show-stopping bugs, I think it is time to get this on melpa to make it more accessible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.