jangko / nim-noise Goto Github PK
View Code? Open in Web Editor NEWNim implementation of linenoise command line editor
License: MIT License
Nim implementation of linenoise command line editor
License: MIT License
zsh allows undo
last editing command, so that we can undo the effects of CTRL-W
for example
[EDIT] zsh allows to skip duplicates when navigating history (they're saved in history but only each unique instance is recalled when navigating with up arrow)
CTRL-C is used to abort a line/the program. It would be nice if the ESC-key can also be used in this context. But then readLine should return something else then a bool.
One should be able to use the ESC-key to cancel some user input (soft abort) and CTRL-C to abort the program (hard abort).
Hello, it seems this is not possible at the moment, but that it could be allowed by enabling the injection of custom procs to the Noise.procs list. Let me know what you think, thank you.
Create a tag including ac14183, otherwise it fails inim.
/Users/runner/work/Nim/Nim/pkgstemp/inim/inim.nim(4, 20) [DuplicateModuleImport]
2022-09-06T14:46:37.7595500Z ...................
2022-09-06T14:46:37.7596130Z /Users/runner/.nimble/pkgs/noise-0.1.4/noise.nim(278, 5) Error: undeclared identifier: 'shallowCopy'
2022-09-06T14:46:37.7596740Z candidates (edit distance, scope distance); see '--spellSuggest':
2022-09-06T14:46:37.7597300Z (4, 4): 'shallow' [proc declared in /Users/runner/work/Nim/Nim/lib/system.nim(2807, 6)]
2022-09-06T14:46:37.7597840Z (4, 4): 'shallow' [proc declared in /Users/runner/work/Nim/Nim/lib/system.nim(2817, 6)]
2022-09-06T14:46:37.7598210Z stack trace: (most recent call last)
First of all, good work on this library! One thing confuses me a little bit though: do you really support editing multiple lines?
I tried:
Is there any way to edit multiple lines? How?
RIGHT_ARROW_KEY works but not ALT + RIGHT_ARROW_KEY
which prints [C
instead of move cursor right by one word
could shift SHIFT + RIGHT_ARROW_KEY
be used maybe?
in bash, python3 and pretty much all repls, ctrl C doesn't run the current entered line but also doesn't exit the repl, whereas ctrl D (when there is no input written) exits the REPL.
here, both ctrl C and ctrl D exit the REPL. How can we at least distinguish whether ctrl C or ctrl D was entered?
example
bash-3.2$ asdf # control C was entered here
bash-3.2$ asdf # control D was entered here
bash-3.2$ exit
zsh allows the very useful history recall based on what you already started typing so that:
abc will recall abcfoo but not bar if abcfoo and bar are in history, see https://unix.stackexchange.com/questions/97843/how-can-i-search-history-with-text-already-entered-at-the-prompt-in-zsh
is there a way to do this in nim-noise? if not, it'd be great!
Hello, in Emacs, but also GNU readline, bash and other shell the case editing behavior is different than used here. In Emacs when you press one of these keys inside a word, only the characters up to the end of the word are affected, so if |
is the cursor, and you are in this situation foo|bar
and then you press M-C in the shell you get fooBar, with noise instead you get Foobar. This is the same for the other case commands.
I think there should be a compiler option to enable classic behavior.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.