≡

wincent.dev

  • Products
  • Blog
  • Wiki
  • Issues
You are viewing an historical archive of past issues. Please report new issues to the appropriate project issue tracker on GitHub.
Home » Issues » Bug #1896

Bug #1896: After using :CommandT, the width of buffers are not preserved, only height

Kind bug
Product Command-T
When Created 2011-10-21T02:39:04Z, updated 2011-11-06T23:55:42Z
Status closed
Reporter anonymous
Tags no tags

Description

Hello,

I like using vertical splits, but after using :CommandT the width of splits are not preserved and instead reset to default (I usually have a wide split on the left and skinny one on the right.

I tried to fix it as follows, and it seems to work but don't know if there are any side effects, especially with order problems like ticket #1493.

Using VIM 7.3 patches 1-89

diff --git a/ruby/command-t/match_window.rb b/ruby/command-t/match_window.rb
old mode 100644
new mode 100755
index f984287..805e1c2
--- a/ruby/command-t/match_window.rb
+++ b/ruby/command-t/match_window.rb
@@ -38,7 +38,7 @@ module CommandT
       # save existing window dimensions so we can restore them later
       @windows = []
       (0..(::VIM::Window.count - 1)).each do |i|
-        window = OpenStruct.new :index => i, :height => ::VIM::Window[i].height
+        window = OpenStruct.new :index => i, :height => ::VIM::Window[i].height, :width => ::VIM::Window[i].width
         @windows << window
       end

@@ -259,6 +259,7 @@ module CommandT
         # beware: window may be nil
         window = ::VIM::Window[w.index]
         window.height = w.height if window
+        window.width = w.width if window
       end
     end

Comments

  1. Greg Hurrell 2011-10-21T03:37:38Z

    Interesting. I hadn't noticed that Vim would allow the vertical splits to move when using Command-T.

    Thanks for the patch. I'll see if I can reproduce the problem, and if your patch behaves nicely with a few different configurations of splits.

  2. anonymous 2011-10-27T02:36:09Z

    I was having the same problem and was getting irritating. I googled a bit and found this patch. It has solved the problem of vsplit window width being reset after using command-t.

    No noticeable side-effects so far with this patch.

  3. Greg Hurrell 2011-10-30T17:04:24Z

    Thanks. It's nice to have confirmation from somebody else that the patch works for them.

  4. Greg Hurrell 2011-11-06T23:52:50Z

    Slightly modified version applied here:

    https://wincent.dev/repos/command-t/commits/d5631702d4000c8addb8d7f0052569226fd6d8a1

    Will mark as closed.

  5. Greg Hurrell 2011-11-06T23:55:42Z

    Status changed:

    • From: new
    • To: closed
Add a comment

Comments are now closed for this issue.

  • contact
  • legal

Menu

  • Blog
  • Wiki
  • Issues
  • Snippets