jonathanklee / ngp Goto Github PK
View Code? Open in Web Editor NEWNcurses code parsing tool
License: GNU General Public License v3.0
Ncurses code parsing tool
License: GNU General Public License v3.0
I am using it for 1 year now and i like it very much. Just wanted to say thanks. So thanks. :)
On an ubuntu distribution:
error in /etc/ngprc
Configuration file has not been found
With ngprc in /etc/ngprc and /home/$USER/.ngprc
And installed packages:
- libconfig8
- libconfig-dev
It would be nice if you could ignore certain directories and files. Manily through a switch but it would also be nice if it could be configured through a config file.
Dear Jonathan,
Here is some difficulties running ngp on FreeBSD (13-STABLE). It compiles successfuly but when trying to run with actual command line parameters like:
ngp PATTERN
Moving forward in the order of execution:
int main(int argc, char *argv[]) {
..
struct options_t *options = create_options(config, argc, argv);
..
parse_args(options, argc, argv);
And reaches the piece of code where everything stops:
int first_argument = 0;
for (; optind < arg_count; optind++) {
if (!first_argument) {
strcpy(options->pattern, args[optind]);
first_argument = 1;
} else {
strcpy(options->directory, args[optind]);
}
}
free(args);
DIR *dirp = opendir(options->directory);
if (!dirp) {
fprintf(stderr, "error: could not open directory \"%s\"\n",
options->directory);
Using a directory as argument does not work so far. The file name is cropped when results are displayed and there is no way to open the file when using 'p'.
PATH_MAX is undefined unless you include <limits.h> or <sys/syslimits.h> on OSX/BSD
We are having an issue with filenames with spaces in it.
It works with GNU find but not BSD find, so it cannot build on OSX
What needs to be done:
This seems related to the fact that we remove the 2 first chars to remove "./" before file names.
Adding -ltinfo to ngp_LDFLAGS fixes it.
The search thread is blocked when a file is open.
There are #defines in ncurse for that
Currently there's a bunch of issues with non-ASCII characters:
Is it planned to be supported? Thank you!
(And of course I don't have any non-ASCII source code, I use your awesome tool for Jupyter, to search and navigate to a particular section in page; I've got dozens of notes and it was very painful to navigate before I discovered your awesome tool, so thank you a lot)
$ CFLAGS="-fstack-protector-strong -O2" cmake . && make -j8
...
src/ngp_search.c: In function ‘get_file_name’:
cc1: error: function may return address of local variable [-Werror=return-local-addr]
src/ngp_search.c:60:10: note: declared here
char copy[FILENAME_MAX];
I'd also enable other warnings to see more potential issues
-pedantic-errors -pedantic -Wextra -Wall
For some weird reason it disables the local variable issue for me.
I'm using gcc 6.4.0 on Gentoo GNU/Linux.
Thank you!
It sets cursor to LINES - 1, but the last page may be not full
It's a minor issue that can be avoided using -e
$ echo '-i' > test.txt
$ grep -r '\-i'
test.txt:-i
$ ngp '\-i'
(produces no output)
$ ngp -e '\-i'
(works fine)
This app is super cool, just thought supporting those would be awesome. Eventually and all that.
Rather than leaving people to hunt around for the appropriate development libraries perhaps you could specify in your README* files the libraries necessary for building?
Some black lines are displayed sometimes
Do something like a little autotool builder
dos goes out of memory (6Gb) easily
Specific files are not detected in other directories than the first level one.
Hi,
Thanks for this very nice tool. Are there any plans of supporting the -C (probably also -A and -B) parameters of grep to be able to see more context around matches (to decide whether to edit them?).
Just a suggestion, in case you find it relevant. :)
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.