Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8940867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:09:28+00:00 2026-06-15T11:09:28+00:00

Normally when quickfix window opens it changes the screen layout, but Vim restores it

  • 0

Normally when quickfix window opens it changes the screen layout, but Vim restores
it when that window is closed.

But there is a situation where the layout restoration fails: when the
preview window is open, vertical splits are presents and :wincmd J is executed
in quickfix (or it is opened with :botright copen). In this case the size of
preview window is changed.

I came with a solution which I placed on ~/.vim/ftplugin/qf.vim,

  " Only do this when not done yet for this buffer
  if exists("b:did_ftplugin")
     finish
  endif

  " expand quickfix when there are vertical splits
  wincmd J

  func! RestorePreviewWindow()
     let l:quickfixHeight = winheight(0)
     wincmd p " include previous window on jump list
     silent! wincmd P  " jump to preview window
     if &previewwindow " if we really get there...
        exe "resize " . (&previewheight - l:quickfixHeight - 1)
        wincmd p " back to old window
     endif
  endfunc
  augroup quickfixClosing
     au!
     au BufDelete <buffer> call RestorePreviewWindow()
  augroup END

, but I was wondering if there is some better/simpler solutions to this
problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:09:29+00:00Added an answer on June 15, 2026 at 11:09 am

    If you can reproduce the problem in plain vanilla Vim (vim -N -u NONE), I’d report it to the vim_dev mailing list to have it fixed inside Vim. The preview window should not change its size when other, normal windows could stand in for it.

    If this is just a peculiarity of your setup, I think your implemented workaround is fine; I would probably solve it along the same lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally we use window.location.href=/index.php?querystring; in javascript. Is there a way to send the querystring
Normally, you don't actually edit a file in vim. If you run vim foo
Normally when I want to change the connection for a Query Editor Window in
normally when I'm using a viewcontroller that will push the current viewcontroller out of
Normally I'd use carrierwave, but they do not officially support jruby, and I've been
Normally I can call this.GetType(), but I can't access this in a static method.
Normally in IDEA, there's an option implement interface in the quick fix on an
Normally it is said that multi threaded programs are non-deterministic, meaning that if it
Normally in an HTML page we embed a flash movie now that's a know
Normally, this is a trivial question that can be answered with a simple search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.