Comments (5)
Well, obviously we're not handling the case of selecting a file if there isn't any.
I wonder where this should be handled, though. Probably the cleanest (conceptually) solution would be for currPath
(and currFile
?) to return error in such case. But I'm afraid this will quickly turn annoying in practice.
from lf.
I haven't read the codebase so I can't help you much with this. I just created this issue because I don't think its good to panic and kill the program in any circumstances. And this happens on simple key press.
from lf.
You're absolutely right @adamjedlicka . Panic is definitely not acceptable for these things. We only panic for major exceptions in a few places in lf
(e.g. initialize termbox). In this case it's an array out of bounds exception by the runtime. So we can't avoid it but only fix it. There were a few such errors previously for empty directories so I spent some time thinking about how to refactor the code to avoid these errors but I couldn't find an easy way. These should be rare though and we should get stable in time. I will try to take care of this as soon as possible. Thanks for the report.
from lf.
Sure, @adamjedlicka, thanks for taking your time to report. My comment was intended to whoever is willing to work on it, to know better what's going on in code.
I will try to get back to #20 in the coming days, hopefully I'll scratch this one on the way as well.
from lf.
@adamjedlicka With the latest commit toggling and yanking in an empty directory doesn't seem to cause any trouble. Closing this issue now. Feel free to open again if you continue to have problems after you update to the latest version.
from lf.
Related Issues (20)
- 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
- Multishell/Crossplatform handling of `--` HOT 3
- how to use `lf -remote` in cmd? HOT 3
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.