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

Fix move to line start in multi-line history entries #584

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

markmurphydev
Copy link
Contributor

Fixes #582

Reverts part of #97 -- Normal traversal sets history string at cursor to line buffer. It's not clear to me what that was added in response to.

Added tests covering the problem and the fix in engine.rs. The bug occurs in engine.rs, so it's not possible to test in core_editor/line_buffer.rs, where the other edit command tests are.

Completed the UX checklist the best I could, and ran nushell with the fix for a bit.

Manual checks

Relevant features tested (leave open if you did not consider those areas touched by your PR):

  • core editing and default Emacs keybindings
  • history
  • syntax highlighting
  • completion/hinting
  • vi mode

Info

Build: [x] debug / [ ] release

Platform:

Terminal emulator:

Inside a [ ] ssh,[ ] tmux or [ ] screen session?

Basics

  • Typing of a short line containing both upper- and lowercase characters.
  • Movement left/right using the arrow keys
  • Word to the left with Ctrl-b or Ctrl-Left, Word to the right with Ctrl-f
  • Enter to complete entry

Clearing

  • Type something and abort the entry with Ctrl-c, you should end up on an empty prompt below.
  • Type something and press Ctrl-l to clear the screen. Your current entry should still be there and passed through when pressing Enter

Unicode and Emojis

  • Paste the line Emoji test 😊 checks 🤦🏼‍♂️ unicode and move the cursor over the emojis.
  • Are you able to delete the smiley?
  • Home/End at accurate positions
  • Check that the emoji containing line can be entered

History

  • On the empty line press the up-arrow key to see if you can recall the previous entry
  • Press Enter to execute this line (it should not be duplicated in the history, after checking leave history recall by down-arrow)
  • On an empty line start typing the beginning of a line in the history. Hit the up-arrow to find the matching entry.
  • After that run Ctrl-r to start traditional reverse search. Type your initial search. Can you find more hits by pressing Ctrl-r or up-arrow?
  • Abort this search by pressing Ctrl-c

@fdncred fdncred merged commit 7404f70 into nushell:main Jan 11, 2024
@fdncred
Copy link
Collaborator

fdncred commented Jan 11, 2024

Thanks

@fdncred
Copy link
Collaborator

fdncred commented Jan 11, 2024

@boathouse2112 Can you change these tests. They're acting weird in WSL Ubuntu. It's like it's messing things up with raw mode or ansi escapes or something. I shouldn't be seeing a reedline prompt in the middle of tests.

This is the command I'm using.

cargo test --features=bashisms,sqlite,external_printer

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.

In multiline commands from history, pressing 0 in vi normal mode jumps to the beginning of the last line.
2 participants