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

Add support for C-p/C-n for prev/next in history. #153

Merged
merged 2 commits into from Aug 12, 2015

Conversation

Projects
None yet
2 participants
@non
Contributor

non commented Aug 10, 2015

This commit also makes some adjustments to the history code
that hopefully make it a bit clearer what is going on.

It also makes a change to cursor positioning. In most
readline-based programs (e.g. bash), if the cursor is
currently at the end of the line, it will remain at the
end of the line after moving through the history. The
current behavior leaves the cursor at position 0. With
this change, a specific check is made to see if the
cursor is at the end of line, and if so the cursor
is moved to the "new" end of the line.

Add support for C-p/C-n for prev/next in history.
This commit also makes some adjustments to the history code
that hopefully make it a bit clearer what is going on.

It also makes a change to cursor positioning. In most
readline-based programs (e.g. bash), if the cursor is
currently at the end of the line, it will remain at the
end of the line after moving through the history. The
current behavior leaves the cursor at position 0. With
this change, a specific check is made to see if the
cursor is at the end of line, and if so the cursor
is moved to the "new" end of the line.
@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Aug 11, 2015

In most readline-based programs (e.g. bash), if the cursor is currently at the end of the line, it will remain at the end of the line after moving through the history.

From my experimentation, it seems that in Bash/Python/ghci, the cursor is always set to the end of the line after navigating in history, no matter where it was before you navigated. Should we do that instead? It seems to me that would simplify things.

Simplify cursor logic in history navigation.
Haoyi points out that things like bash always move the cursor
to the end of the line during history navigation. So let's just
do that here as well.

lihaoyi added a commit that referenced this pull request Aug 12, 2015

Merge pull request #153 from non/topic/cn-cp-history-nav
Add support for C-p/C-n for prev/next in history.

@lihaoyi lihaoyi merged commit 7a5198b into lihaoyi:master Aug 12, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Aug 12, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment