Code Monkey home page Code Monkey logo

Comments (11)

zefei avatar zefei commented on August 13, 2024

wintabs stores a list of "local" buffers to each window, so it's unlikely I can re-use any code from undoquit. That being said, undo closing buffer/window/tab sounds like a great feature to have. I'll look into it when I have time.

from vim-wintabs.

jordwalke avatar jordwalke commented on August 13, 2024

Thank you for considering the feature, and thanks for this wonderful plugin.

Bountysource

from vim-wintabs.

jordwalke avatar jordwalke commented on August 13, 2024

Did you give any thought to this? Have you found the need for such a feature in your day to day use? Once you get use to undoquit, it's hard to loose the feature.

from vim-wintabs.

jordwalke avatar jordwalke commented on August 13, 2024

I was thinking that 90% of the value could be gotten from only supporting the use case of one undo level - the ability to revert the most recently closed wintab, regardless of which window it was closed from.

from vim-wintabs.

zefei avatar zefei commented on August 13, 2024

I've thought about this and would implement it as undo closing buffers without considering window and vimtab configurations, just like what you suggested. I haven't got the time yet, but will do it in the next round of clean ups (a few bugs and documentation).

from vim-wintabs.

zefei avatar zefei commented on August 13, 2024

This is implemented in the last commit, please check it out!

from vim-wintabs.

jordwalke avatar jordwalke commented on August 13, 2024

Very cool can’t wait to check it out

from vim-wintabs.

jordwalke avatar jordwalke commented on August 13, 2024

I think the only thing remaining here is to track which "approximate window" the tab was closed from. Was it the last open tab in a window that resulted in the window closing? If so, then a new window should probably be opened (it's hard to restore the exact window position of course but some simple setting could configure how new windows are opened if not instructed specifically (vert/horiz)).

If it was closed from a window that is still open, then it should probably reappear in that window it was removed from.

Either way, this is still a nice feature as it is.

from vim-wintabs.

zefei avatar zefei commented on August 13, 2024

Opening in original window is doable, it requires giving windows unique ids, which isn't too hard. It however is a bit too jumpy to my taste: e.g. I really hate how Chrome undoes closed tabs inside different windows. I'll think about what's the best next step here after some other features.

from vim-wintabs.

jordwalke avatar jordwalke commented on August 13, 2024

I think one compromise is to only "Undo Close" within the same tab. WintabsUndo would then undo the closing of the most recent buffer/window in the currently focused tab. That's not as jarring as jumping to a completely different tab to undo the close. Jumping to another tab would feel like jumping to another Chrome window to undo the close.
If you can accept that, then you might want to keep track of the most recently closed buffer on a per-tab basis.

from vim-wintabs.

zefei avatar zefei commented on August 13, 2024

I decided not doing window scoped undo for now as it involves some unnecessarily challenging edge cases. I added some commands to move buffer across windows. That combined with current undo should be able to satisfy most use cases. I'm closing this but please open another issue if these two are not enough for your workflow.

from vim-wintabs.

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.