GithubHelp home page GithubHelp logo

jonathanklee / ngp Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 7.0 3.49 MB

Ncurses code parsing tool

License: GNU General Public License v3.0

C 98.29% CMake 1.71%
ag c curses grep ncurses ngp search-in-text silver-searcher

ngp's People

Contributors

ferruck avatar jonathanklee avatar jozie avatar youx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngp's Issues

ngp does not run on ubuntu

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

Suggestion: support --ignore

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.

FreeBSD: Incorrect command line parse throws "error: could not open directory"

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 dir as argument

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'.

Build on OSX/BSD

PATH_MAX is undefined unless you include <limits.h> or <sys/syslimits.h> on OSX/BSD

Navigation issues

  • the "down" key can bring us to an empty page
  • there is no support for page up/page down

What needs to be done:

  • add page up/page down functionality (bugfree!)
  • factorize the up/down code so it may use the page up/down behavior

Unicode is not supported

Currently there's a bunch of issues with non-ASCII characters:

  • text gets cut in the output
  • random rubbish appears near the text
  • currently selected text has weird partial blinking animation
  • ignore case feature doesn't work

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)

error: function may return address of local variable

$ 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!

Can't grep lines that start with dash

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)

ag / ack support

This app is super cool, just thought supporting those would be awesome. Eventually and all that.

Documentation does not list dependencies

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?

specific files issue

Specific files are not detected in other directories than the first level one.

Suggestion: support -C

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. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.