Code Monkey home page Code Monkey logo

Comments (3)

eric1234 avatar eric1234 commented on September 27, 2024

I might be able to work around this by updating the focus to to a different view if the focus is on the view being closed but I've search the API docs and haven't been able to figure out how to programmatically change the view focus yet.

I'm an idiot as another piece of code in that same module does change the view focus. The function I was looking for was ui.goto_view. If I prepend ui.goto_view(_VIEWS[#_VIEWS-1]) prior to my unsplit no more crashing. Therefore is the answer to maybe handle this within Lua and have unsplit automatically move the focus if the item being removed is focused?

from textadept.

orbitalquark avatar orbitalquark commented on September 27, 2024

Thanks for the detailed report. It seems that calling unsplit on a non-focused view resulted in undefined behavior. This should be fixed via c659b31.

Regardless, if you want control over which view has focus after a split, it is wise to call ui.goto_view() if you're going to call unsplit() on something other than view.

from textadept.

orbitalquark avatar orbitalquark commented on September 27, 2024

Actually, forget that last bit of my comment. You can always call ui.goto_view() after the fact since Textadept hasn't crashed :)

from textadept.

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.