joaodanielrufino / go-input-autocomplete Goto Github PK
View Code? Open in Web Editor NEWA useful input that can autocomplete users path to directories or files when tab key is pressed
License: MIT License
A useful input that can autocomplete users path to directories or files when tab key is pressed
License: MIT License
Add support to autocomplete hidden files and directories as well.
This program does not handle relative path. It is necessary to create this feature.
Having a Makefile
will be very helpfull for use.
Hi,
I have pressed tab once input was asked. go-input-autocomplete was crashed with the following error.
`$ go run cmd/main.go
Path: panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/JoaoDanielRufino/go-input-autocomplete.autocomplete.unixAutocomplete(0x5115a0, 0x5e1088, 0x0, 0x0, 0x1000000010000, 0x9, 0x0, 0x0)
/media/sf_gopath/src/go-input-autocomplete/autocomplete.go:35 +0x56c
github.com/JoaoDanielRufino/go-input-autocomplete.Autocomplete(0x0, 0x0, 0x0, 0xc0000942a0, 0xc0000a2ddf, 0x1)
/media/sf_gopath/src/go-input-autocomplete/autocomplete.go:20 +0x77
github.com/JoaoDanielRufino/go-input-autocomplete.(*Input).Autocomplete(0xc0000a2ee8, 0x0, 0x0)
/media/sf_gopath/src/go-input-autocomplete/input.go:65 +0x3c
github.com/JoaoDanielRufino/go-input-autocomplete.keyboardListener(0xc0000a2ee8, 0xc0000b4020, 0x0)
/media/sf_gopath/src/go-input-autocomplete/input_autocomplete.go:28 +0xf1
github.com/JoaoDanielRufino/go-input-autocomplete.Read(0x4f068d, 0x6, 0x0, 0x0, 0x0, 0x0)
/media/sf_gopath/src/go-input-autocomplete/input_autocomplete.go:50 +0xd4
main.main()
/media/sf_gopath/src/go-input-autocomplete/cmd/main.go:9 +0x3a
exit status 2
`
You can not autocomplete the first directory, it throws an error, it is working only after the first directory informed. For example if you are starting with /ho
, on linux, it does not autocomplete to /home/
.
Any improvement on the code will be accepted
To make it more user friendly tab should show or cycle through all possible suggestions to the provided path. Example:
I have a directory with files:
test1, test2
When I type test and press tab it should show test1, when I press it again it should show test2, again and it should show test1 back again.
This program only handles Linux autocompletion. It is necessary to create the autocompletion for windows as well
Any help with clean code and a better structure is wanted.
The code for Unix autocompletion is not good and not optimized. Any help on that code will be accepted
This program only handles linux autocompletion. It is necessary to create Darwin autocompletion as well
Hi,
currently , when ctrl+c is pressed, the interrupt signal is caught by autocomplete but no action is taken on it and is ignored.
Issue is to define the behavior of system when such key sequences are pressed and throw error if desired to parent functions.
Regards.
Tab autocomplete works with directories with spaces but only when spaces are not typed directly. Example:
On Windows I want to autocomplete "C:\Program Files", I have to type "C:\Program" and press tab. When I type "C:\Program<space>F" and press tab, it won't autocomplete. Issue also exists on Linux.
Hi @JoaoDanielRufino ,
currently autocomplete doesn't give flexibility of listing sub-directories of given directory. This may pose little inconvenience to user if she doesn't already know the name of sub-directory. So , proposal is along with tab key, we should support up/down arrow keys, which will display the sub-directories name one by one. This will help user in selecting particular sub-directory more easily.
What you say?
Regards.
Add tests to increase coverage of the code
Like bash/cmd if you have a directory that starts with an uppercase letter and if you type it's name starting with a lowercase, the autocompletion handle the case sensitive. This program is not handling it, you need to type the uppercase letter in order to autocomplete.
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.