Comments (2)
Thanks for bringing this up and asking it first @KenjiTakahashi .
This has been somewhat bugging me as well, having to remember calling Stat
for symlinks. In addition to the two places you mention we are also doing this in completion if I remember correctly. I thought about cleaning things when I was working on #2 but then I got distracted to something else. I remember it was not very straightforward though.
Now you mention a few different issues. I think we both agree that symlinks should not be treated identical to the files they link to. Currently symlinks pointing to directories are not grouped within other directories. This is different than ranger
but is similar to ls
with --group-directories-first
option on my machine (probably GNU coreutils). Same thing for the file permissions as well. When I'm in doubt I usually try to follow ls
behavior rather than ranger
. I don't feel very strong about this though so I guess you can change it or just create an option for it if you like.
Second issue you mention is the redundant sort inside ioutil.ReadDir
. This should probably be done with os.Readdir
or os.Readdirnames
to avoid that extra sort with sort by methods different than name
. It could also be nice to add a sort by none
option in the mean time.
from lf.
Not identical, but kinda almost ;-). I'd like to know that it is a symlink and commands should get the symlink location as well (e.g. rename or sth should not rename [or sth] the destination). But when I want to cd or open, I expect it to do so on destination, it doesn't make sense to edit a symlink in vim :-).
Personally, I like links pointing at dirs listed among other dirs, but maybe I'm just used to it. BSD ls
does not have the option you mentioned, unfortunately.
To use os.Readdirnames
is exactly what I planned to do. I wasn't really pointing at it as issue, only suggesting that we'll be able to "amortise" additional .Stat
call by avoiding the sort.
I will try to come up with some code over the weekend, let's see how it turns out.
from lf.
Related Issues (20)
- Sort_by function not work very well with hungarian letters HOT 2
- Chafa symbol preview error HOT 9
- lf image preview flickering HOT 5
- Duplicate icon
- Mouse buttons don't work
- Preview window colors HOT 14
- Yank path w/filename, filename, and file (As in Ranger) in Powershell HOT 6
- [QUESTION] Paste with overwrite for multiple files HOT 5
- Main Column Line Numbers Only HOT 8
- Outdated file information for recreated directories HOT 9
- directories have another font type HOT 2
- Feature request: highlighting of cursors when inactive HOT 3
- Feature request: add an lfrc switch to move duplicate copy suffixes at the beginning of filename. HOT 4
- `autoquit` should be enabled by default HOT 6
- how to use fribidi within lf.
- sixel preview writes out of bounds
- Broken characters of dir when I use `-print-last-dir` option / change drive option `/d` in `lfcd.cmd` HOT 3
- Issue with scrolling using alt key HOT 6
- Feature request: precalculate previews for files around the cursor HOT 3
- lf does not open terminal text editor when going right HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lf.