summaryrefslogtreecommitdiff
path: root/sfeed_curses.c
AgeCommit message (Collapse)Author
2022-02-25sfeed_curses: cast character for SFEED_AUTOCMD to unsigned charHiltjo Posthuma
Otherwise a character like \xa0 (160) would be negative and goto the event, since a negative return value in readch() is used for errors or reserved for signal handling. Noticed while testing mouse X10 encoding with extended buttons, like button 7: SFEED_AUTOCMD="l$(printf '\x1b[M\xa0!!')j" ./sfeed_curses ~/.sfeed/feeds/*
2022-02-24sfeed_curses: remove continue in application key handlingHiltjo Posthuma
On an unknown or invalid sequence just use the key handling like the other keys do.
2022-02-24sfeed_curses: fix a redraw when reloading a file when reading from stdinHiltjo Posthuma
When reading data from stdin and changing the URL file externally in some way and then pressing 'R' would not redraw (and highlight/unhighlight) the marked items.
2022-02-24sfeed_curses: die(): use stdio buffered function/macroHiltjo Posthuma
vdprintf() was changed back to vfprintf() in commit 06bb4583, but the write was not changed. Change it to be more consistent and use the stdio buffered functions/macro.
2022-02-24sfeed_curses: fix a wrong comment about the arrow left and right keysHiltjo Posthuma
Add autocmd comment.
2022-02-24sfeed_curses: add keybinds for home key and home and end key in urxvtHiltjo Posthuma
\x1b[1~ home (putty and some terminals). \x1b[7~ urxvt home. \x1b[8~ urxvt end. Refactor repeated code also.
2022-02-19fix a compiler warning with (Net)BSD cursesHiltjo Posthuma
Some curses implementations have tparm(char *) (BSD and older ncurses), some have tparm(const char *). The older POSIX specification had: tparm(char *): https://pubs.opengroup.org/onlinepubs/7908799/xcurses/term.h.html Just cast it to char *. The terminfo variables are defined elsewhere so it should be safe. Also remove an unnecesary cast in minicurses. Hopefully this satisfies all curses variants and versions now.
2022-02-06fix a warning with tparm on some systemsHiltjo Posthuma
Older POSIX standards also defined it as a char * parameter (not const char *) for tparm(). https://pubs.opengroup.org/onlinepubs/7908799/xcurses/term.h.html
2022-02-06add compile-time option to improve output on dumb non-UTF8 terminalsHiltjo Posthuma
This makes atleast feeds with simple ASCII work.
2022-02-06sfeed_curses: write cmd in a more verbose wayHiltjo Posthuma
This fixes a compile error tested with HaikuOS 32-bit (gcc2h, based on gcc 2.95). It also suppresses a false-positive warning of an unused forkexec function in cppcheck.
2022-02-04improve some code commentsHiltjo Posthuma
2022-01-22add feature to go to the next bold row and previous bold row with J and KHiltjo Posthuma
This replaces the current J and K keybind, which was rarely useful. Thanks to IanJ for the suggestion and feedback!
2022-01-19sfeed_curses: code-style: remove variable name in definitionHiltjo Posthuma
2022-01-19sfeed_curses: fix a pedantic sign comparisonHiltjo Posthuma
2022-01-19fix inconsistencies in commentsHiltjo Posthuma
2022-01-19sfeed_curses: consistency: mousereport: use off_t like the other functionsHiltjo Posthuma
2022-01-19sfeed_curses: line editor: add more clear comments of signal handlingHiltjo Posthuma
2022-01-14sfeed_curses: pedantic fix for UB with an empty URL fileHiltjo Posthuma
When a new URL file is used with no URL entries then NULL is passed to qsort() and bsearch(). This is reported by clang UBsan as undefined behaviour (debatable), but no issue in practise with many implementations. Fix it anyway. To reproduce with clang UBsan: Compile with clang or gcc with CFLAGS and LDFLAGS -fsanitize=undefined touch /tmp/urls # new file which should be empty. SFEED_URL_FILE=/tmp/urls sfeed_curses 2>/tmp/log ^D q cat /tmp/log
2021-11-26sfeed_curses: reuse some functions in utilHiltjo Posthuma
2021-11-26import sfeed_cursesHiltjo Posthuma
Import sfeed_curses into sfeed. The files are based of the commit 8e151ce48b503ad0ff0e24cb1be3bc93d6fbd895