Commit graph

1450 commits

Author SHA1 Message Date
Arun Prakash Jana
37e5e6189a
Simplify check 2020-06-25 19:59:47 +05:30
Sijmen J. Mulder
235eb29614
Fix check when char is unsigned (#665)
If char is unsigned (as on ARM) subtracting a larger number would
result in a wrap around, not a negative value.

  src/nnn.c: In function 'readpipe':
  src/nnn.c:4325:11: warning: comparison is always false due to limited
  range of data type [-Wtype-limits]

     if (ctx < 0 || ctx > CTX_MAX)
             ^
2020-06-24 04:35:42 +05:30
Sijmen J. Mulder
3686ef756a
Always use builtin alloca() (#666)
Fixes the build on NetBSD 9 on arm64.

GCC expands alloca() to __builtin_alloca() but only in nonstandard mode,
e.g. when -std=... is not supplied.  In standards mode (with -std=...)
alloca() is left undefined by GCC. The C library may define it but it
also may not, as on NetBSD on arm64:

    $ uname -srp
    NetBSD 9.0 aarch64

    $ cat alloca.c
    #include <stdlib.h>
    int main() { char *p = alloca(10); }

    $ gcc alloca.c

    $ gcc -std=c99 alloca.c
    alloca.c:(.text+0xc): warning: Warning: reference to the libc
     supplied alloca(3); this most likely will not work. Please use the
     compiler provided version of alloca(3), by supplying the
     appropriate compiler flags (e.g. not -std=c89).
    ld: alloca.c:(.text+0xc): undefined reference to `alloca'

The fix is to either not use standards mode (undesirable) or to
explicitly use the builtin, which is what this patch does.

This is also sufficient for Solarius/Illumos so that check and include
are removed.
2020-06-24 04:17:05 +05:30
Arun Prakash Jana
306af787ca
Add -Wshadow to CFLAGS and fixes 2020-06-22 09:17:59 +05:30
lvgx
7a1a4e293e
Avoid SIGWINCH interruptions of NNN_PIPE IO (#659)
Fixes #656
2020-06-19 07:10:37 +05:30
Arun Prakash Jana
4b4bf6cca5
Option -u to disable current/selection prompt 2020-06-15 19:54:44 +05:30
Arun Prakash Jana
d9b8b0e821
Clear selection after some operations (see notes)
Selection is cleared after successful:
- file removal
- batch rename
- link creation

However, selection is not cleared after:
- archive creation: user may want to delete the files after archiving
2020-06-15 19:13:08 +05:30
Arun Prakash Jana
7c802cce60
Show '+' in statusbar instead of 's' for selection 2020-06-14 09:56:34 +05:30
Arun Prakash Jana
b3076e35d6
Refactor key-val pair parsing 2020-06-14 00:31:48 +05:30
Arun Prakash Jana
a1ec2236d8
Make once-used function inline 2020-06-14 00:09:16 +05:30
Ian R
1f22da2994
Feature #534: Support hardware cursor sync 2020-06-11 11:30:43 +05:30
Arun Prakash Jana
b3e2ffc2e6
Selection mode don't need to be persistent 2020-06-09 23:43:49 +05:30
Arun Prakash Jana
05b1db059e
Plugin run flags don't need to be persistent 2020-06-09 23:33:32 +05:30
Arun Prakash Jana
796334354e
Picker mode doesn't need to be persistent 2020-06-09 23:03:36 +05:30
Arun Prakash Jana
b481b23280
Retain order on session load 2020-06-09 22:26:35 +05:30
Arun Prakash Jana
c5f0a25e7e
Simplify subdir creation 2020-06-08 21:56:33 +05:30
Arun Prakash Jana
d19d8d5f02
Derive session and mount paths, shorten paths 2020-06-08 09:44:53 +05:30
Arun Prakash Jana
b62adec72c
Subdir 'mounts' for remote/archive mounts 2020-06-08 08:48:20 +05:30
Arun Prakash Jana
fdfbac0386 Fix #639: store NNNLVL in tmp var 2020-06-07 00:35:05 +05:30
Arun Prakash Jana
65cf067dc4 Fix #637: remove mount dir after unmount 2020-06-06 16:22:32 +05:30
Arun Prakash Jana
58fd92c7ae
Add new ToDo list 2020-06-03 16:12:27 +05:30
Arun Prakash Jana
2fc115bddc
Esc to send hovered path to FIFO 2020-06-03 15:56:10 +05:30
Arun Prakash Jana
709c0d209e
Force notify on left click (right selects & updates) 2020-06-03 14:51:52 +05:30
Arun Prakash Jana
1dbbc45c78
Key | to send file path to FIFO 2020-06-02 16:50:06 +05:30
Arun Prakash Jana
61b4416e08
Refresh hovered for preview on mouse click 2020-06-02 16:29:26 +05:30
Arun Prakash Jana
0ebc6db163
Fix #624: wait for user input if cmd fails 2020-06-01 21:21:01 +05:30
Sijmen J. Mulder
68b9185071
Wrap FILE_MIME_OPTS use in check (#622)
We leave it undefined on Solaris/Illumos because no such options exist,
so only use it if we have it.
2020-06-01 06:47:03 +05:30
Arun Prakash Jana
8549121d86
Remove redundant key F5 2020-05-31 23:20:08 +05:30
Arun Prakash Jana
7263a5f89b
Do not auto-revive filter in nav-to-type mode 2020-05-31 23:05:59 +05:30
Arun Prakash Jana
4a2d978630
Simplify get_input() 2020-05-31 20:10:11 +05:30
Arun Prakash Jana
984cffecc4
Set the corrent keybind for plugin 2020-05-31 13:27:05 +05:30
Arun Prakash Jana
8e9c4ec88b
F5 to redraw (even with filter) 2020-05-30 23:25:01 +05:30
Arun Prakash Jana
04f9698d86 Retire ^S as select plugin 2020-05-30 22:02:55 +05:30
Arun Prakash Jana
309ed0ed67
Remove NNN_PIPE on exit 2020-05-30 15:31:37 +05:30
Arun Prakash Jana
e3d90a98ce
Support make option O_CTX8 for 8 contexts
Note that this is not compatible with 4 contexts.
2020-05-30 07:01:34 +05:30
Arun Prakash Jana
4d291d0ac2
Use bitfields for runtime transient states 2020-05-30 06:45:45 +05:30
Arun Prakash Jana
32ab43a9ff
Handle number of contexts in a generic fashion
This supports using a power of 2 number of contexts like 2, 4 or 8.
Note that the number of contexts are not backward compatible. So if
user is having 8 contexts and plans to use 4, his sessions with > 1
contexts open may break.

We can have a make option to enable 8 contexts. 4 remains default.
2020-05-30 06:07:53 +05:30
Arun Prakash Jana
c48b8d02a1 Revert "Alt+Enter: clear filter and exit filter prompt"
This reverts commit 2232772db4.
2020-05-30 05:24:41 +05:30
Mischievous Meerkat
e47a04865e
Merge pull request #607 from leovilok/signals
Cleanly handle SIGTERM and SIGHUP
2020-05-30 05:08:45 +05:30
lvgx
41dc17883a
Fix detecting end of evironment options (#610)
This allow using both NNN_OPTS and options with arguments from argv.
2020-05-30 04:51:16 +05:30
Léo Villeveygoux
75e8bf44be Use sigaction() instead of signal() 2020-05-29 22:48:36 +02:00
Léo Villeveygoux
3426d0d0a3 Cleanly handle SIGTERM and SIGHUP 2020-05-29 22:48:36 +02:00
Arun Prakash Jana
2232772db4
Alt+Enter: clear filter and exit filter prompt 2020-05-29 22:16:36 +05:30
Arun Prakash Jana
87bb2d7742
Remove F5 for toggle hidden (misfit) 2020-05-29 09:25:33 +05:30
Arun Prakash Jana
2599564e64
Set Escape delay to 0 2020-05-29 08:51:22 +05:30
Arun Prakash Jana
dd5a936bf4
Alt+Esc to clear filter and exit filter prompt
It's a little annoying that one has to press ^L followed by Esc to go back
to the normal view. We cannot reload the directory on Esc because that will
break the filter filtered view feature. So we take this route.
2020-05-29 08:50:33 +05:30
Arun Prakash Jana
713bab21ea
Prepare for release v3.2 2020-05-26 05:38:38 +05:30
Arun Prakash Jana
38829e5610
Fix build break 2020-05-24 09:28:29 +05:30
Arun Prakash Jana
56886922a6
Select file if file path is passed 2020-05-24 03:33:39 +05:30
Arun Prakash Jana
c1f88d00ff
Fix filterfn not in sync with cfg.regex 2020-05-24 01:51:59 +05:30