Commit Graph

187 Commits

Author SHA1 Message Date
NRK ddcf331205 Makefile: use -g3 for debug builds
-g3 builds additional information such as macro definition and so on.
2023-05-14 22:13:44 +06:00
Jacob Moena 2dc7f19be0
Added patch for colemak keyboard layout. Existing renamed to colemak-dh (#1587)
* Added patch for colemak keyboard layout. Existing renamed

to colemak-dh

* Missed two spots of O_COLEMAK

* Update check-patches.sh
2023-02-19 17:22:32 +01:00
Sijmen J. Mulder 2fc9d518d1 Respect CFLAGS and LDFLAGS when building generator 2022-11-25 16:40:17 +01:00
NRK 61e1356fbd fix emoji tar command
Fixes: https://github.com/jarun/nnn/pull/1356#discussion_r930094949
2022-07-26 21:37:38 +06:00
N-R-K f618b78866
Makefile: more robust generated header tracking (#1439)
give each generated header it's own unique file so that it's not
possible to try and build `O_EMOJI=1` with the generated header for
`O_NERD=1`.
2022-07-26 20:26:49 +05:30
NRK 3b09fd1c75 Revise and optimize icons handling
This pretty much reworks the entire icon system. Some notable changes:

* The extensions are put into a statically generated hash-table instead
  of a sorted array. We use Robin-Hood insertion to reduce the max probe
  length. Currently we need to probe only 2 slots for `O_EMOJI` and only
  3 for `O_NERD`/`O_ICONS`.
* I've opted not to use a perfect-hash since the perfect hashes
  generated by [`gperf`](https://www.gnu.org/software/gperf) used some
  huge lookup table. The hash function also wasn't as minimal as I'd
  like.
* Colors are now using X-Macros. This should speed up startup since we
  don't have to search `icons_ext` linearly to find unique colors.
* The hash-table generator outputs a more space optimized `struct
  icon_pair` using a char array instead of char pointer. This brings
  down the binary size from `145KiB` when using `O_NERD` down to
  `137KiB`.
* Some unnecessary duplication and indirection has been reduced by using
  the `ICON_STR()` macro.
2022-07-22 17:08:42 +06:00
Arun Prakash Jana b0580905f2
Add Makefile target shellcheck 2022-07-18 18:28:16 +05:30
Luuk van Baal a3cef1611d
Add colemak patch 2022-07-09 13:42:38 +02:00
NRK fd69fc2dca make it easy to check for failing patches locally
adds a script `check-patches.sh` to check for patch failures and also
adds a make target `checkpatches` which will invoke the check-patches
script.
2022-07-01 05:47:23 +06:00
Arun Prakash Jana 0c626d49a6 Revert "Add bookmarknav patch"
This reverts commit fbd6f69f25.
2022-06-14 17:43:50 +05:30
Luuk van Baal fbd6f69f25
Add bookmarknav patch 2022-06-11 19:44:44 +02:00
Luuk van Baal 3072aa7891
Update patch conflict instructions/workflow 2022-05-31 11:07:31 +02:00
Luuk van Baal 4c974f286c
Add patch conflict instructions 2022-05-30 14:43:59 +02:00
NRK 6f332e5260 add headers as make dependancy 2022-05-12 00:32:10 +06:00
Desmond Kabus b45be9bc5b
Add build option EMOJI for Unicode emoji as file icons 2022-05-10 20:31:11 +05:30
Arun 866612bfda
Merge pull request #1302 from N-R-K/makefile_rebuild
rebuild if Makefile changes
2022-02-04 08:57:40 +05:30
NRK ff1c1eb2e1 rebuild if Makefile changes 2022-02-03 22:20:55 +06:00
Arun Prakash Jana aa2147f3ef
make option O_NOSORT to disable sort on dir load 2022-01-23 10:52:33 +05:30
Arun Prakash Jana a06ff83c22
Add option -i to show file information on hover 2021-10-17 12:01:01 +05:30
Arun Prakash Jana 3490a959be
make var O_FILEINFO to show file info on hover 2021-10-16 22:48:01 +05:30
Luuk van Baal d96a7bc2b7 Add restorepreview patch 2021-09-22 04:13:57 +02:00
elder-n00b e4813f06c1
MacOSX legacy (#1138)
* Branched v4.2
Added workaround for Mac OS X < 10.12.0
(Only tested on 10.11.6, lower versions may need more workaround)

* Added *.dSYM to .gitignore

* Added comments for the macosx detection in Makefile

* Fixed indentation, formatting and missing newline at eof

* Moved includes inside include guard

Co-authored-by: elder-n00b <elder-n00b@yandex.com>
2021-08-22 12:17:27 +05:30
Arun Prakash Jana 87380732dc
make option O_MATCHFLTR to disable filters without match 2021-08-05 22:15:02 +05:30
NRK 5fcd3d1198 fix misleading comment in Makefile
reading the source code, setting NOSSN to 1 _disables_ session support,
not enable it.
2021-07-29 15:33:19 +06:00
Arun Prakash Jana baca4693ec
Remove redundant prompt 2021-07-12 01:22:39 +05:30
KlzXS c0dceb18c6
Persistent selection (#1086)
* Add persistsel

* Fix Makefile spacing

* Update Haiku Makefile

* Do a double pass on inversion

* Split single and double pass for easier testing

Removed lastappendpos

Eliminate suffix matches

* Check if dir is in selection before searching for files

Fix double pass

* Switch to mainline

Optimize memory moving

Handle large selection in invertsel()

Going forward with 2pass

* Update Makefiles

* Fix style

* Move forward declarations

* Remove edit selection in inversion

Replace buf with g_buf to fix CI

Fix CI

* Style changes

* Comment the code

* Style fixes

* Fix infinite loop

* Fix crash on empty invert

* Fix off-by-one-in-two-places

Off-by-twice?

* Adopt changes from master

* Only check directory if entry in it is selected

* Better organization

* Wrong variable

* Tiny optimizations

* Style fixes and updated man page

* Update man page

* Remember where we found directory path in selection

Add in progress message on invert
2021-07-10 07:30:02 +05:30
Luuk van Baal ddf845be88 Remove gitstatus libgit2 dependency 2021-07-06 02:01:19 +02:00
Arun Prakash Jana 2df1e64127
Post-release formalities 2021-06-03 22:54:12 +05:30
Arun Prakash Jana 29ef232301
Add Makefile target to compile nnn with musl libc 2021-06-03 04:34:44 +05:30
Arun Prakash Jana b52c09dd23
Move patches to top level 2021-06-02 12:25:31 +05:30
luukvbaal 93e7995ab5
Add user patch framework (#1037)
* Add user patch framework

* Add git status patch

* Add namefirst-gitstatus compatibility

* Add patch targets

* Fix gitstatus colors and patch order
2021-06-02 09:57:06 +05:30
luukvbaal 78b2170e03
Ignore NOLC when ICONS/NERD are set (#1027) 2021-05-26 23:47:38 +05:30
Arun Prakash Jana 284a3c4866
Multi-threaded FTS-based disk usage calculation
Implements pthreads based du using FTS. Currently 4 threads are used.
NFTW is dropped as there is no way to pass any custom values to fn().

FTS does not require any per entry function callback.
The performance numbers are best with FTS:

./nnn-fts -T d /  5.29s user 0.94s system 116% cpu 5.335 total
1/21 du:102.402G free:8.476G files:397644 101132550144B

./nnn-ftw -T d /  5.52s user 0.94s system 116% cpu 5.534 total
1/21 du:102.400G free:8.474G files:397653 101133148160B

./nnn-4.0 -T d /  0.20s user 2.27s system 24% cpu 10.241 total
1/21 du:102.400G free:8.475G files:397654 101133299712B
2021-05-26 22:28:38 +05:30
Arun Prakash Jana db8079f552
Make option O_NOLOC renamed to O_NOLC 2021-05-24 22:38:08 +05:30
Arun Prakash Jana d0b4508798
Change debug macro DBGMODE to DEBUG 2021-05-14 00:20:59 +05:30
Arun Prakash Jana 0691c4fb47
Reversed block for hovered entry in detail mode 2021-05-08 17:05:22 +05:30
Arun Prakash Jana 25157592df
make option NOX11: disable notis, sel to clipboard sync, xterm title 2021-04-17 13:08:34 +05:30
Arun Prakash Jana a1cb764943
make option O_CKBOARD for checker board indicator in detail mode 2021-04-09 12:05:03 +05:30
KlzXS 7310a9a773
Fix #835 2021-01-13 14:13:07 +00:00
Arun Prakash Jana 0bfc590f90
upx compress all static binaries before upload 2020-11-14 10:56:18 +05:30
Arun Prakash Jana 9f6808a35a
make target upx (https://upx.github.io/) 2020-11-02 00:02:47 +05:30
Arun Prakash Jana 0b31414c9a
make option O_NOUG to compile out user group info 2020-10-31 21:22:01 +05:30
Arun Prakash Jana 56757860d4
Generate static binaries with icon support 2020-10-20 17:59:39 +05:30
Arun Prakash Jana faddaa5c3a
make option O_NOSSN to compile out session 2020-09-20 12:13:00 +05:30
Dave Snider 1fc1b8be8b
Add nerdfont defs file and normalize vars (#722)
* Add nerdfont defs file and normalize vars

* some cleanup

* address feedback

* one more spacing issue

* address feedback
2020-09-14 22:09:52 +05:30
lvgx bcbe8080be
Add support for Alexey Tourbin's QSORT code (#708)
* Add support for Alexey Tourbin's QSORT code

See https://github.com/svpv/qsort

* Add benchmark scripts and compilation mode

Compile with `make O_BENCHMARK=1`, and run benchmarks with e.g.:
  ./misc/test/benchmark.sh ./nnn '/' '/usr/bin' '/usr/lib' > benchdata
You can then plot basic violin graphs with:
  ./misc/test/plot-bench.py benchdata

* Update style, doc, haiku support, fix lint
2020-08-21 08:15:45 +05:30
Arun Prakash Jana d86810a425
Minor reformat 2020-08-16 06:54:47 +05:30
KlzXS a85467d462
Icons (#697)
* Add icons

* Fix build break

* Fix icon position in detailed mode

* Various fixes

* Provision for icon specific colors

No icons with oldcolor. Small optimizatons

* Update Makefiles

Small refinement for other matching
2020-08-16 06:30:58 +05:30
Arun Prakash Jana fbd5e77ec1
Initialize all make options 2020-08-14 00:02:54 +05:30
Arun Prakash Jana 42fd2a4d13
Program option to use older 2020-08-04 20:36:19 +05:30