Giter Site home page Giter Site logo

Comments (9)

junegunn avatar junegunn commented on August 16, 2024

visually, but might also "eat" some keys

Could you elaborate? I can understand that the flashing sidebar can be annoying sometimes, but peekaboo is not supposed to "eat" any keys.

from vim-peekaboo.

blueyed avatar blueyed commented on August 16, 2024

"eat" any keys

It's not peekaboo itself, but the interaction with Vim. It's not reproducible in a new Vim instance, but might be related to a more complex window / tab layout, where the flashing sidebar is slow to open, and then the register itself wasn't handled properly.
It's good to know that this is not meant to happen - I will investigate in case it happens again.

from vim-peekaboo.

blueyed avatar blueyed commented on August 16, 2024

One annoyance in this regard is with the equalalways setting, which is on by default.
This causes windows to be resized because of the opening/closing of the peekaboo window.

Maybe the equalalways setting could be disabled temporarily?

from vim-peekaboo.

junegunn avatar junegunn commented on August 16, 2024

I'm not sure if it's possible, according to :help equalalways

'equalalways' 'ea'  boolean (default on)
            global
            {not in Vi}
    When on, all the windows are automatically made the same size after
    splitting or closing a window.  *This also happens the moment the
    option is switched on.*

So even if I temporarily disable the option, windows will be resized right at the moment when I restore the option.

from vim-peekaboo.

blueyed avatar blueyed commented on August 16, 2024

This also happens the moment the option is switched on.

Ok, then it's not really an option. But maybe it can be taken into consideration for the timeout handling, e.g. with ea peekaboo would have the timeout by default or something like that.

from vim-peekaboo.

junegunn avatar junegunn commented on August 16, 2024

Yep, I see your point.

from vim-peekaboo.

junegunn avatar junegunn commented on August 16, 2024

Added g:peekaboo_delay (ms). Please test it and let me know if it doesn't work as expected. Thanks.

from vim-peekaboo.

blueyed avatar blueyed commented on August 16, 2024

Very nice!
Thanks!

from vim-peekaboo.

hallettj avatar hallettj commented on August 16, 2024

I came found this discussion while searching for a way to close a window without losing sizes of other windows when equalalways is set. In my case I wanted to close a preview window. In case this is useful for peekaboo, or in case anyone else arrives here with the same problem, here is a solution that I am experimenting with:

function! s:isPreviewWindowOpen()
  for nr in range(1, winnr('$'))
    if getwinvar(nr, "&pvw") == 1
      return 1
    endif
  endfor
  return 0
endfunction

" Close preview window without changing the sizes of other windows.
function! s:closePreview()
  if !s:isPreviewWindowOpen()
    return
  endif

  let eq = &equalalways
  set noequalalways
  pclose
  if eq
    let cmd = winrestcmd()
    let &equalalways = eq
    exe cmd
  endif
endfunction

Turning equalalways back on at the end of the function resizes windows immediately, which we do not want. So I use winrestcmd to capture the size of each window before restoring the equalalways setting, and I run the restore command immediately after to get those sizes back.

from vim-peekaboo.

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.