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

Use em_delete in key_delete #504

Merged
merged 3 commits into from
Mar 24, 2023

Commits on Mar 24, 2023

  1. Test existing behavior

    Typing Ctrl-D ends editing but typing <Del> does not.
    
    Also renamed a test that is not testing ed_delete_next_char but
    key_delete.
    etiennebarrie committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    8e97956 View commit details
    Browse the repository at this point in the history
  2. Check if line empty first in em_delete

    By distributivity of AND over OR, we can factor out this condition. This
    will make the next commit simpler.
    etiennebarrie committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    83588f4 View commit details
    Browse the repository at this point in the history
  3. Use em_delete in key_delete

    When the editing mode is emacs, use `em_delete` in `key_delete`. We need
    to add a condition though to `em_delete`, because it implements both
    `delete-char` and `end-of-file`. We only want the `end-of-file` behavior
    is the key is really Ctrl-D.
    
    This matches the behavior of the <Del> key with readline, i.e. deleting
    the next character if there is one, but not moving the cursor, while not
    finishing the editing if there are no characters.
    etiennebarrie committed Mar 24, 2023
    Configuration menu
    Copy the full SHA
    c0d4086 View commit details
    Browse the repository at this point in the history