Commit Graph

158 Commits

Author SHA1 Message Date
Gokcehan
18fb632efa export files and options for previewer and cleaner
cc #626
2022-01-27 22:08:13 +03:00
Gokcehan
930364ce78 Revert "dirtyfiles: files that don't require cleaning before previewing them (#729)"
This reverts commit 673dad9f07.
2022-01-22 16:57:28 +03:00
Gokcehan
ac4bdccf8d add dirtyfiles to windows
cc #729
2022-01-17 13:07:24 +03:00
Lucas Mior
673dad9f07
dirtyfiles: files that don't require cleaning before previewing them (#729)
* dirtyfiles

* wrong default on man page

* respect alphabetic order for options

* clean on shell commands

* formating if
2021-12-25 20:49:30 +03:00
Gokcehan
f01fab6257 fix crash when hidden is changed
cc #615 #657
2021-10-09 22:49:12 +03:00
SPFab
ff0933ca03
Added filter command (#667)
* added first version of interactive filter

* small fix when loading new file

* don't reset filter when directory is reloaded automatically

* reapply filter when options for searching change

* current filter or arguments now prefilled in the prompt

* empty filter can now be supplied

* added new setfilter command for use in scripts

* added incfilter option

* added very basic documentation

* added filter indication in statusbar

* added option to display filter to prompt
2021-08-21 16:40:24 +03:00
Yegor Bychin
ee5b3f4813
add an option to disable directory cache (#673)
* add an option to disable directory cache

* change option name to `dircache`

* change 4 whitespaces to tab
2021-08-01 17:00:10 +03:00
Matthew Toohey
75eba115d2
implement dironly option (#669)
Co-authored-by: mtoohey31 <mtoohey31@users.noreply.github.com>
2021-07-31 16:10:25 +03:00
Gokcehan
7cdb7495ea add a command line parameter for single use
cc #177
2021-05-19 23:38:05 +03:00
Marius
0cd634e9a8
Preserve ' bookmark on sync (#624) 2021-05-13 21:31:25 +03:00
Gokcehan
1bd78220e2 avoid crash with dir preview when hidden changes
cc #615
2021-04-28 18:50:24 +03:00
Nikita
6422bd7492
Fix symlink handling (#581)
* Fix replace dialog for symlinks

If the oldPath is a symlink to the newPath or vice versa, than os.Stat()
would resolve this symlink, and both the oldStat and newStat would be
the same. Hence, the replace dialog would not appear and the newPath
file would be overwritten by the oldPath file whilst the oldPath would
be deleted.

It is the same story when the oldPath and newPath are both symlinks to
the same file.

* Fix completion in the case of broken symlinks

If the current directory contains broken symlinks then matchFile() would
return at first broken symlink.

Let's consider the following example:

$ ls -F ~/
broken@ dir/ file

The broken@ is a symlink to ~/foo - non existent file.

If one would enter the following command in lf:

:cd ~/<tab>

it would not suggest possible completion options because matchFile()
would return as soon as it meet the broken symlink.

* Don't resolve symlinks when move files/dirs (#571)

This will allow to move broken symlinks.

* Fix symlinks copying/moving (#571)

Copy symlinks, do not try to resolve it and copy the file pointed by
this symlink. Also this allows to copy symlink to directory.
2021-02-12 20:50:48 +03:00
neeshy
1163efb7aa
Avoid redundantly loading previews for search/find (#569)
* Avoid redundantly loading previews for find

* Avoid redundantly loading previews for search
2021-01-29 18:27:27 +03:00
neeshy
873cfe87a1
Reduce declaration and assignment (#564)
Some code cleanup for #562
2021-01-21 01:01:49 +03:00
neeshy
3f66f08b84
Exhaust queued entries in previewChan prior to calling preview script (#562)
* Use ranged for loop over channel

And rename variable "path" to "prev"

* Exhaust queued entries in previewChan prior to calling preview script
2021-01-19 04:42:01 +03:00
Gokcehan
e0317611ef avoid loading redundant previews for top/bottom
cc #531
2021-01-19 01:47:09 +03:00
Gokcehan
f54acae958 avoid loading redundant previews for up/down
cc #531
2021-01-18 21:30:52 +03:00
neeshy
b5f6f6edee
Don't redraw volatile previews on ticker period (#546) 2021-01-04 17:01:29 +03:00
neeshy
1e94f4533e
Guarantee preview/previewClear ordering (#537)
* Use chan struct{} in place of chan bool

* Revert "nav.checkReg now returns a boolean instead of calling nav.preview"

* Guarantee preview/previewClear ordering

* Pass the file path to the cleaner script
2020-12-27 04:23:03 +03:00
Marius
3dc7ec69ba
make sortby ext work as expected (#539) 2020-12-26 16:36:43 +03:00
neeshy
82f03102a5
Add ability to use image previewers (#531)
* Return early on error in nav.preview

* nav.checkReg now returns a boolean instead of calling nav.preview

* Pass width, height, x, and y parameters to preview script

* Check previewer for exit code

If non-zero the preview will be assumed to have side-effects.

* Add the cleaner option

This is called upon selection changes if the previous preview was
volatile. To this end, volatilePreview was added to the nav struct
2020-12-24 16:13:20 +03:00
Gokcehan
5d204a1331 avoid reloading previews modified in the future
Related #453
2020-11-25 23:43:30 +03:00
Gokcehan
c629b3d4ce fix race when options are changed while sorting
Related #502
2020-11-18 22:46:59 +03:00
Gokcehan
65e593b68f initialize ignorecase/ignoredia for loading dirs
Related #478
2020-11-07 01:13:11 +03:00
Gokcehan
70ec01fc3b fix crash for 'bottom' at startup
Related #498
2020-11-06 20:51:31 +03:00
Gokcehan
d46ccfc805 resort directories if ignorecase/ignoredia change
Related #320
2020-11-06 20:10:54 +03:00
Gokcehan
e8f115848f avoid reloading directories modified in the future
Related #453
2020-11-06 19:57:27 +03:00
Gokcehan
c2f2d54cee apply 'ignorecase' and 'ignoredia' to sorting
Related #320
2020-11-06 16:02:58 +03:00
Gokcehan
6a286673ce initialize hiddenfiles for loading directories
Related #478
2020-10-06 22:24:55 +03:00
Gokcehan
88749a3da1 check hiddenfiles option for dir updates
Related #476
2020-10-02 21:50:55 +03:00
Gokcehan
50dd374f77 fix race in previews with lazy drawing
Related #445
2020-09-25 23:08:29 +03:00
gotroyb127
7a3bd15903
always export lf_options before previewing (#468)
* always export lf_options before previewing

related functions were moved to `os.go`
and now exportOpts isn't called through
an app, so it can be called independently

* move related functions to main.go

so they get compiled on windows too
2020-09-18 00:50:45 +03:00
Gokcehan
1c8def356d log readlink errors instead of fail
Related #447 and #374
2020-08-19 23:35:42 +03:00
Gokcehan
8be63a9c83 cleanup 2020-07-22 01:55:21 +03:00
Alexey Yerin
c630293cc2
Print message in status line after copying/moving (#427)
* Print message in status line after copying/moving

* Print message only when there's no errors

* Don't print number of copied files

* Fix error handling

* Send message to channel instead of direct ui.echo
2020-07-22 01:53:02 +03:00
Gokcehan
9c891307f3 cleanup 2020-07-20 02:47:33 +03:00
Gokcehan
7174b7e307 handle broken links with 'select' command
Related #201
2020-07-20 02:15:30 +03:00
Gokcehan
ffdcb71897 make select work properly with loading directories
Related #370
2020-07-17 02:12:10 +03:00
Gokcehan
0a22e7c5c8 check reg and dir while loading 2020-07-17 00:33:37 +03:00
Gokcehan
2f056ad359 select new file after rename
Related #197
2020-07-17 00:28:32 +03:00
Gokcehan
3e36500901 check modtime/sorting again when dirs are updated
Related #338
2020-07-16 23:13:40 +03:00
Gokcehan
bc2a80fd6e handle cross-device linking in windows 2020-07-04 00:16:16 +03:00
Gokcehan
e2bf773f3b fallback to copy-del for cross-device linking
Related #151
2020-07-03 21:42:13 +03:00
Ivan Podmazov
cbb559346d
fix toggle behaviour (#352) (#386) 2020-06-17 06:17:30 +03:00
Gokcehan
5d1136abfe keep the destination file before rename
Related #343
2020-06-17 05:19:16 +03:00
Adam Abrams
72facea2a0
add hiddenFiles option (#372)
* add hiddenFiles option

* harden and improve syntax

* refactor name and add to docs
2020-06-11 02:52:15 +03:00
wedens
8933a3eafe
show symlink destination (#374)
Co-authored-by: wedens <kirill.wedens@gmail.com>
2020-06-09 02:38:46 +03:00
gotroyb127
41e0bb32cd
fix tilde expansion and numbering (#373)
* Fixed issue #346 and changed the format of numbers when both relativenumber and number are set.

* Fixed issue #349 (incorrect replacement of '~' with user's home direcotry).

* Changed where appropriate so that tilde replacements happens correctly.

* Added a function to replace tilde with user's home directory, only when it should.

* Renamed ReplaceTilde to replaceTilde so that it won't get exported and removed some ';' at the end of some lines.
2020-06-07 20:53:25 +03:00
Gokcehan
d5f989f373 show progress for delete operation
Related #238
2019-12-02 19:50:13 +03:00
Juris Arturs Majors
f76bf30f65 Asynchronous delete (#238)
* Asynchronous deletion, similar to moving

* Reversed some sloppy new lines from previous commit

* Move delete operations to delete.go

* Simplify to use RemoveAll before

* Send errors directly to ui.exprChan directly
2019-12-02 14:27:58 +03:00