Giter Site home page Giter Site logo

snb's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

snb's Issues

Build fails with ncurses 6.0

After patching the Makefile to use ncursesw6-config, I get the following output from make debug (building using the snb-git AUR package):

cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c99 -Wall -Werror -Wno-implicit-function-declaration -fstack-protector-all -fPIC -fPIE -DDEBUG -g  -D_GNU_SOURCE -c src/data.c -o src/data.o
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c99 -Wall -Werror -Wno-implicit-function-declaration -fstack-protector-all -fPIC -fPIE -DDEBUG -g  -D_GNU_SOURCE -c src/ui.c -o src/ui.o
cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c99 -Wall -Werror -Wno-implicit-function-declaration -fstack-protector-all -fPIC -fPIE -DDEBUG -g  -D_GNU_SOURCE -c src/colors.c -o src/colors.o
src/data.c:10:0: error: "_GNU_SOURCE" redefined [-Werror]
 #define _GNU_SOURCE
 ^
<command-line>:0:0: note: this is the location of the previous definition
src/colors.c:5:0: error: "_GNU_SOURCE" redefined [-Werror]
 #define _GNU_SOURCE
 ^
src/ui.c:5:0: error: "_GNU_SOURCE" redefined [-Werror]
 #define _GNU_SOURCE
 ^
<command-line>:0:0: note: this is the location of the previous definition
<command-line>:0:0: note: this is the location of the previous definition
cc1: all warnings being treated as errors
Makefile:68: recipe for target 'src/colors.o' failed
make: *** [src/colors.o] Error 1
make: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
Makefile:68: recipe for target 'src/data.o' failed
make: *** [src/data.o] Error 1
cc1: all warnings being treated as errors
Makefile:68: recipe for target 'src/ui.o' failed
make: *** [src/ui.o] Error 1

Create new file when editing inexistent file

snb doesnotexist.md says Can't open your file: No such file or directory. I think it'd be better if it created that file, i.e. treats it like it'd contain a single, empty entry.

Remove flicker when scrolling

When pressing the j and k (up and down scroll) keys the sceen flickers, due to beeing redrawn.
This is quite annoying, maybe there is a way to fix it.

Supporting readline bindings in edit mode

Hi,

Interesting project! :)

It would be nice if readline bindings such as Ctrl-H (backspace), Ctrl-W (delete word), Ctrl-U (kill line), Ctrl-B and Ctrl-F (cursor movement) were supported when editing entries. Ideally the best would be to use readline proper (to have all bindings, including the ones from ~/.inputrc). I'm not sure if that's possible, but if it's not it would be nice to reimplement at least the most common ones.

Thanks!

Segfault in vitree_rebuild when opening empty file

When running snb emptyfile.md I get a segfault here:

#0  vitree_rebuild (s=s@entry=0x555555843350, e=e@entry=0x0) at src/ui.c:1046
#1  0x0000555555559c7c in ui_set_root (e=0x0) at src/ui.c:1752
#2  0x0000555555555a13 in main (argc=<optimized out>, argv=<optimized out>) at src/snb.c:136

Sane and portable Makefile

The big question:

Is there a sane way to make a Makefile smart-enough to figure out whether it should call ncursesw5-config or ncursesw6-config, or to report a human-readable error when it doesn't know how to deal with that, without resorting to contraptions like autotools.

Second question:

Is it possible to do a single, portable Makefile - i.e. one that will work on Linuxes and BSD/OS X (perhaps only when invoked with gmake, but that would be acceptable).

Third question:

My opinion right now is that the compiler and linker flags should at the same time be: as strict on errors as possible; and as non-assuming as possible. This is not currently the case, as there are some optimisation/hardening flags on and -Wno-implicit-function-declaration (presumably to deal with ncurses weirdness).

I'm tempted to remove the additional flags because:

  • They assume compiler features to be present
  • Any 'sane' build system should apply such flags anyway (e.g. ArchLinux's makepkg, BSD ports (if snb ever gets there)) - in a way that's actually appropriate for the particular platform

The above approach is debatable, so I'm leaving the flags as-is.

Errors in make

I get the following errors when I make debug.

gcc -Wall -Werror -DDEBUG -g  -I/usr/include/ncursesw -c src/ui.c -o src/ui.o
src/ui.c: In function ‘dlg_newwin’:
src/ui.c:238:5: error: implicit declaration of function ‘waddwstr’ [-Werror=implicit-function-declaration]
src/ui.c: In function ‘dlg_simple’:
src/ui.c:271:3: error: implicit declaration of function ‘waddnwstr’ [-Werror=implicit-function-declaration]
src/ui.c:273:5: error: implicit declaration of function ‘mvwaddwstr’ [-Werror=implicit-function-declaration]
src/ui.c: In function ‘dlg_bool’:
src/ui.c:314:5: error: implicit declaration of function ‘get_wch’ [-Werror=implicit-function-declaration]
src/ui.c: In function ‘dlg_file_path’:
src/ui.c:429:7: error: implicit declaration of function ‘mvwaddnwstr’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make: *** [src/ui.o] Error 1

Also, running ncursesw5-config works properly.

With malformed input: Unix error: Success

When doing snb file.md where the file contains foo:

ERROR: Malformed input at line 1.
Unix error: Success

The first error makes sense, I don't think the second one does 😉

With malformed input: Unix error: Illegal seek

It appears that any line not starting with a - spits out

ERROR: Malformed input at line <line_without_dash>.
Unix error: Illegal seek

As is the case than the accompanying file help.md works fine but not README.md or similar markdown. This is a show stopper currently but overall great program.

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.