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

Multi-line command history #108

Merged

Conversation

stevesims
Copy link
Contributor

Adds multi-line command history to the MOS line editor, allowing the user to step thru up to their last 16 commands, rather than just the previous command.

Multi-line history is accessed via the up/down arrow keys. When at the beginning of a line, up will replace the current buffer with the previous history entry. When at the end of a line, down goes to next entry. When editing a line that is spread across multiple rows up/down will move between rows. If pressing up or down and not at the beginning/end of a command and the cursor cannot go up/down a row it will go to beginning/end of line.

First iteration of this was by @HeathenUK

HeathenUK and others added 2 commits November 1, 2023 08:55
# Conflicts:
#	main.c
up/down works within a line

if you are at the start of a line and press up, it will go to the previous history item if there is one, otherwise do nothing
if you are somewhere along a line and press up it will either go up a line within the current string or if you’re already at the top line of that string go to the beginning
if you are at the end of a line and press down it will go to the next history item if there is one, otherwise do nothing
if you are somewhere along a line and press down it will either go down a line within the current string, or if you’re already on the bottom line go to the end

you’re always left at the end of a line when moving position in history - this means that you’ll usually need to press up twice to go to a previous entry
@breakintoprogram breakintoprogram added the enhancement New feature or request label Nov 5, 2023
@breakintoprogram
Copy link
Owner

Brilliant! I was going to get around to doing that at some point. Will merge later.

@breakintoprogram breakintoprogram self-assigned this Nov 10, 2023
@breakintoprogram breakintoprogram merged commit 868bbe9 into breakintoprogram:main Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants