Giter Site home page Giter Site logo

Comments (4)

michaelb avatar michaelb commented on May 29, 2024 1

Hmmmm. Several terminals for sniprun output seems like a huge waste of space at first glance. Especially when you have splits, and on smaller (laptop) screens, I don't think more 'terminal' output buffers is a good solution.

However, I agree that sniprun's term buffer closes annoyingly often.

I'd favor a 'simpler' solution: a setting (possible enabled by default) would inhibit the BufWinLeave autocommand. A single output buffer would still be shared between all splits/buffers and should not close on one of them BufWinLeave'ing or help buffers closing.
Sniprun term buffer could still be closed with :q or :SnipClose

You're welcome to implement this change if you want to, but I'll probably do it anyway in a couple days if not since I convinced myself that it's a good idea

from sniprun.

michaelb avatar michaelb commented on May 29, 2024 1

Will be included in 1.3.2 release through #231

from sniprun.

zhengpd avatar zhengpd commented on May 29, 2024

It's caused by vim.cmd("autocmd VimLeave,QuitPre,BufWinLeave ?* call Sniprun_close_term_on_leave()"). The autocmd runs on every window close.

Currently all buffer share the same output terminal buffer. I'm considering to create output terminal per buffer calling Sniprun, basic idea like:

  • document buffer has one-to-one relation with output terminal
  • VimLeave would stay as global autocmd, as we want output windows to be closed before vim quitting.
  • QuitPre, BufWinLeave would be buffer-local autocmd, which is bound to the document buffer. It's set-up on first run of Sniprun in current buffer. Whenever the doc buffer close, its output term would also close, but other doc buffers and output terms stay intact.

@michaelb Do you think this change is acceptable? I can create a PR.

from sniprun.

zhengpd avatar zhengpd commented on May 29, 2024

@michaelb Yes multiple output windows could be less nice on small screens. Your solution should be good enough. I'm focusing something else and won't check on this soon.

from sniprun.

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.