* 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
* Refactor fifo code and add explorer
* add explorer option and flag
* notify explorer fifo on selection
* close explorer fifo file descriptor
* Try to create explorer fifo if doesn't exist
This doesn't quite work
* Allow uncreated fifos
* delete persistence fifo on cleanup
with correct formatting
Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
* Work correctly with NOFIFO
* Refactor variable names
* fix
* Use -X flag for explorer mode
* Update manpage with explorer mode
Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
Plugins like fzopen have the capability to pick files.
This comes handy if nnn is executing as a file picker.
This is a 2-way communication:
- nnn sends the picker output file to plugin ("-" for stdout)
- the plugin tells nnn if it has overwritten the output file
If you have selected some files, you intend to work on them. Also, this prompt
expects <kbd>c</kbd> / <kbd>s</kbd> which should cancel the next prompt in the
delete workflow. Rest of the three workflows are non-fatal.
Benefits of removing this option:
- code reduction
- one less step in the relevant workflows (more than one prompt feels dragged)
This prompt shows in the following workflows:
- delete: users have explicitly requested to prefer sel over current
- batch rename: key <kbd>^R</kbd> renames a single file
- archive: in most of the cases the user would want to archive the selection
- create sym/hard link: not a frequently used workflow (in general)
If an input stream is available, prioritize that over sessions. find/grep
syntax can be very complex and can be scripted. On the contrary, sessions
can be loaded at runtime and the persistent session can be "restored".
An interesting use case is the listing is done in picker mode from a script
and the user expects to "pick" some entries among the listed search results.
Another important change is - if the user tries to load the "last session"
explicitly by name instead of using the session option _restore_, we should
not overwrite the "last session" ("@") before loading the it.
Without this, there is a conflict with using the `-u` option (use selection).
After copying selected files, the selection is intact and if the user issues
a deletion next, the source files (meant for copying) are deleted.
* Add -a option to generate a temporary NNN_FIFO
* Add documentation for -a option
* plugins/README.md: promote the use of -a
This obsoletes the global FIFO unlink trick, so I remove mentions of it.
@jarun update:
Polish -a
* Allow launching plugins with Alt + plugin's key
* Fix Alt key in filter/prompts modes
* Fix handling Alt key in nextsel()
In filter mode: run the associated plugin.
In prompt mode: just throw out the Alt+key input.
In nextsel(): differentiate Alt+key and Esc
* Add an option to print hovered files to a FIFO
This adds an env variable, `NNN_FIFO`, that can be set to a path that
`nnn` will open/create as a FIFO, and where every hovered file's path is
printed. This allows creating external perview/quick open plugins, ...
It can be compiled out with the make variable `O_NOFIFO`.
* Check filename ptr instead of full path (for FIFO)
* Add documentation to use NNN_FIFO in plugins
* Fix path sent to FIFO in empty dirs