Giter Club home page Giter Club logo

Comments (5)

KenjiTakahashi avatar KenjiTakahashi commented on August 16, 2024

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.

adamjedlicka avatar adamjedlicka commented on August 16, 2024

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.

gokcehan avatar gokcehan commented on August 16, 2024

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.

KenjiTakahashi avatar KenjiTakahashi commented on August 16, 2024

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.

gokcehan avatar gokcehan commented on August 16, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.