Commit graph

1894 commits

Author SHA1 Message Date
me
9aaf9491ad When handling bookmark, use readlink, not realpath
This is to cd to path as it pointed by symlink, not to it's real path. Bookmarked directory may itself contain symlinks in path, which should be respected.

For example: if directory is physically in /mnt/storage/some and it's symlinked to ~/some and directory ~/some/dir added to bookmarks, it's expected that when following bookmark directory will be changed to ~/some/dir (as in bookmark's link) not to /mnt/storage/some/dir (as dir real path).
2023-11-22 20:41:49 +03:00
NRK
60eabb6170 silence ci warning 2023-11-21 20:50:45 +06:00
NRK
3665541dac fix buffer overflow on certain platforms
the size of g_buf depends on PATH_MAX and NAME_MAX which on certain
platforms (such as mac) might not be big enough to decode the help
string. use an explicit buffer with proper size instead.

Closes: https://github.com/jarun/nnn/issues/1768
2023-11-21 19:32:00 +06:00
blissful
c0b3cc8689
factor out a setcfg function for setting the cfg global 2023-11-18 16:34:17 -05:00
blissful
703d349389
restore sort function pointers when restoring cfg 2023-11-17 17:45:06 -05:00
NRK
4d5e29c3dd fix CI 2023-09-23 12:26:58 +06:00
NRK
6d6fc3419e split clang-tidy checks into multiple lines
makes it more readable and more easily editable. also produces better
diff when editing.
2023-09-23 12:26:29 +06:00
Arun Prakash Jana
9c7c7284c0
Option -N to use native prompt
This is useful for situations where the executable is compiled with
readline support but the user wants to use the native prompt. Often
this happens because packagers build without readline disabled.
2023-09-20 23:02:04 +05:30
Arun Prakash Jana
33126ee813
Prepare for release v4.9 Elixir 2023-08-27 09:55:13 +05:30
Quan Tong
d220c50773 Double-width icons can cause duplicated first characters in the filename on macOS 2023-08-11 06:54:15 +07:00
Arun Prakash Jana
693ba757c0
Fix #1704 - Show only selected file name if sel is preferred 2023-08-05 23:53:01 +05:30
Arun Prakash Jana
3539e5c1b1
Update help 2023-07-28 20:52:21 +05:30
ANtlord
dedf0554e5 Jump to the next young file
Forward jumping to the next young file is implemented. The starting
position from which the next young file is searched is the next
position. If no young file has been found, the search starts from the
beginning. It stops at the initial position where the search has
started.
2023-07-25 08:17:21 +06:00
NRK
db8b61866b define _FILE_OFFSET_BITS 64 unconditionally
according to the manpage, it won't have any effect on 64bit system
anyways. and musl always uses 64bit so this macro doesn't have any
effect there either.
2023-07-01 08:56:18 +06:00
Arun
26d5b5c614
Merge pull request #1668 from N-R-K/better_compress
better and faster string compression
2023-06-16 12:14:02 +05:30
JingMatrix
e6ce7a614e Add djvu icon
Use paperclip as icon since it is used by DjVuLibre.
2023-06-15 16:56:51 +02:00
NRK
4c2ce0a84d better helpstring compression
this avoids multiple printf calls and instead decodes the buffer
natively. using %NN instead of %-NNc also saves two bytes per run.
helpstr is also made `static` to avoid unnecessary stack allocation.
2023-06-15 08:49:30 +06:00
NRK
b2b830e69d fix: properly update mode after xchmod
xchmod now returns the new mode through a pointer, no need to assume all
executable bits were toggled.

Closes: https://github.com/jarun/nnn/issues/1657
2023-05-26 19:31:00 +06:00
Arun
04d9f6738d
Merge pull request #1650 from leo-arch/master
Fix crash when PWD is set to empty string
2023-05-19 01:57:34 +05:30
Arun
e013a867da
Merge pull request #1651 from N-R-K/cp_mv
make the cp/mv modification more robust
2023-05-19 01:56:53 +05:30
NRK
16899bda53 make the cp/mv modification more robust
this makes it so that if the cp/mv commands are changed the in the
future, it will continue to work reliably instead of having hardcoded
indexes to modify the array.

the `#ifdef __linux__` is also removed, compilers should be smart enough
to see that PROGRESS_{CP,MV} are unused (on non-linux systems) and
optimize it out.
2023-05-15 11:29:47 +06:00
leo-arch
4babedc3e4
Fix crash when PWD is set to empty string
nnn crashes when PWD is set to empty string: `PWD="" nnn`
2023-05-14 20:12:04 +00:00
Jasper
fb3a648756 Update Haskell icon color 2023-05-12 15:19:04 +10:00
Luuk van Baal
20e944f5e5
Update nerd-font icons to v3
This is an upstream breaking change.
Update your font to the latest version if you see missing icons.
2023-05-05 01:01:43 +02:00
Arun Prakash Jana
5d81aeb477 Filter adjustment when opening context from plugin
- Clear filter only when a plugin is selected manually.
  Plugin dir should be unfiltered when opened.
- Plugins invoked by keys don't require clearing filter
  of original context. If a new context is opened using
  the plugin, it will be unfiltered by default. If the
  same context is re-used (when all the contexts are in
  use) the filter should be cleared so the the new path
  is opened unfiltered.
2023-04-29 21:53:49 +05:30
NRK
20725b0b4d icons-hash: replace assert with handmade version
since 2fc9d51, the hash-table generator inherits environmental
CFLAGS and so we shouldn't disallow setting -DNDEBUG.

fixes: https://github.com/jarun/nnn/issues/1632
2023-04-22 17:08:00 +06:00
Arun Prakash Jana
8a1dce888a
config option to specify archive mounter utility 2023-04-14 01:47:50 +05:30
Arun Prakash Jana
6dd8cf8b4d
Happy Birthday nnn!
Prepare for release v4.8 Spritz!
2023-04-13 18:37:42 +05:30
Kian-Meng Ang
3d1bc6e8e5 Fix typos
Found via `codespell -L noice,nd,fils,numer,caf,iterm`
2023-04-03 12:49:03 +08:00
yosh
98d3b2135d add jxl icon 2023-03-28 11:44:38 -04:00
NRK
57882ffab7 add shell_escape() to properly escape filenames fed to shell
Fixes: https://github.com/jarun/nnn/issues/1615
2023-03-22 10:09:39 +06:00
NRK
003228afba add some critical comments 2023-03-05 18:43:08 +06:00
NRK
3a30211e6c handle tilde more strictly in mkpath and abspath
otherwise, if a file is named "~" it will get incorrectly expanded into
$HOME and disaster can happen.
2023-02-26 18:13:26 +06:00
NRK
8dbd9da0cc convert_tilde: return whether the conversion was done or not 2023-02-25 21:15:55 +06:00
NRK
a59a91c312 handle tilde more correctly
closes: https://github.com/jarun/nnn/issues/1596
2023-02-25 21:15:46 +06:00
Arun Prakash Jana
b874da395c
Update copyright year 2023-02-19 08:28:20 +05:30
NRK
9cc4b66868 export NNN_PREFER_SELECTION to all plugins 2023-02-17 19:24:45 +06:00
NRK
8ad5c87107 nmv: prefer selection if -u is active
the rename plugin always asks for "selection vs current" even when -u
flag is active. pass it to the plugin via `NNN_PREFER_SELECTION` so that
there's less distracting prompts.
2023-02-17 19:22:46 +06:00
Arun Prakash Jana
58b77411c8
Optimize listed selection size calculation 2023-01-31 18:36:26 +05:30
Arun Prakash Jana
33827109d5
Show total size of non-filtered selected files in a directory. 2023-01-30 00:14:54 +05:30
Arun Prakash Jana
b80e047d50
Set defaults for some multiple choice prompts
Archive options: listing
Create new options: create file
Open with options: command type GUI
2023-01-28 09:50:58 +05:30
Arun Prakash Jana
ad4ecb19cb
Simplify paged and GUI commands run as plugin 2023-01-28 09:16:06 +05:30
Arun
786ecf9fc2
Merge pull request #1571 from KlzXS/plugin_simplification
Simplify the command as plugin codepath
2023-01-28 08:23:24 +05:30
KlzXS
867726d870
Add debug message for bad call 2023-01-25 18:56:48 +01:00
KlzXS
7abfb77a13
Update signatures 2023-01-25 17:37:31 +01:00
KlzXS
827e84a56f
Simplify commands as plugins
Remove restrictions on $nnn

Update the plugin README
2023-01-25 17:33:15 +01:00
KlzXS
8d21e5e832
Revert using UTIL_SH_EXEC 2023-01-25 17:26:14 +01:00
Arun Prakash Jana
6b94911bc9 Revert "Simplify get_output()"
This reverts commit 6c23fdfd5f.
2023-01-16 00:19:03 +05:30
Arun Prakash Jana
653cab9dff Revert "Give better names to variables"
This reverts commit 1a2f783b75.
2023-01-16 00:18:52 +05:30
Arun Prakash Jana
f9295780ef Revert "Make CI happy"
This reverts commit 8a1e32d9eb.
2023-01-16 00:18:41 +05:30