Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

restore ctrl-enter functionality #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Laeeth
Copy link

@Laeeth Laeeth commented Jan 6, 2016

Hi.

This is unpolished (although suits my own purposes) but I thought you might want to consider restoring the ctrl-enter functionality for entering multi-line entries. At the moment I think you are missing one function from the original API: linenoiseSetMultiLine - which may become more useful again if this feature is restored.

The other suggestion is allowing user to press a defined key (maybe F2 as a default) to have enter just map to new line in the buffer and shift-enter complete the entry. useful for a REPL to be able to copy and paste multi-line code (I am using with Lua).

@jsteemann
Copy link

I think we're generally happy to accept the patch, but for legal reasons we need you to fill out and sign our Contributor Agreement. You can scan and email the pdf file to [email protected] or send it via fax to +49-221-2722999-88. Sorry for the inconvenience, but once the agreement is there I can merge the PR and adjust the failing Windows build.

I have also added the missing linenoiseSetMultiLine function in linenoise-ng though it is there for API-compatibility only. It will do nothing, as the input in linenoise-ng is always multi-line. Regarding the special input mode that ignores the enter key: sounds good, too!

@Laeeth
Copy link
Author

Laeeth commented Jan 6, 2016

Hi.

Thanks for writing back. I understand the environment we are in. I will get that back to you but it may be a little while.

I haven't written the special input mode yet but will look at when time.

Separate to that, can you think of another way one can copy and paste code into a single entry ?

The other thing is another guy has a password entry mode with stars. Might be nice to have.

On 6 January 2016 10:21:52 GMT+00:00, Jan [email protected] wrote:

I think we're generally happy to accept the patch, but for legal
reasons we need you to fill out and sign our Contributor
Agreement
. You can scan
and email the pdf file to [email protected] or send it via fax to
+49-221-2722999-88. Sorry for the inconvenience, but once the agreement
is there I can merge the PR and adjust the failing Windows build.

I have also added the missing linenoiseSetMultiLine function in
linenoise-ng though it is there for API-compatibility only. It will do
nothing, as the input in linenoise-ng is always multi-line. Regarding
the special input mode that ignores the enter key: sounds good, too!


Reply to this email directly or view it on GitHub:
#1 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@fceller
Copy link

fceller commented Mar 2, 2017

@Laeeth thanks a lot for your fix. Can you sign a contributor licence agreement available at https://www.arangodb.com/documents/cla.pdf?

@fceller
Copy link

fceller commented Mar 29, 2017

@Laeeth the intended behavior is, that a new line is added to the input. What should happen if I press CTRL-J within a line? Currently

linenoise> aaabbb

If the cursor is inbetween aaa and bbb then I end up with

linenoise> aaa
bbb                  X

where X marks the cursor. Is that intended?

@Laeeth
Copy link
Author

Laeeth commented Mar 29, 2017

Hi. Sorry it's taken me so long to fill out the form. I haven't time to work on this at the moment - if you would like to fix behaviour so it works as expected, very happy for you to take this little suggestion over. Otherwise might take me a little while...

@fceller
Copy link

fceller commented Mar 29, 2017

No worries, this is an open source project and we all have other projects for which we are paid. I'll will have a look in the next days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants