On Wed, 29 Sep 2010, Benjamin R. Haskell wrote:

This placement probably makes more sense (supersedes the prior patch), but the ternaries are getting really ugly.

Not sure what I was referring to in the first post (p_pvh didn't seem to be used in prepare_tagpreview). There's somewhere though that checks that a new window isn't taller than p_pvh (which is how I knew the variable name was p_pvh).


Didn't see any response to this. It fixes the issue reported in two threads[1,2]. Updated to make it less ugly (no complicated ternaries), and match Vim coding style (I think -- didn't see a response to my query about that).

[1] "Is this a bug with 'previewheight'?" - Daniel Vim - Sep 25
http://groups.google.com/group/vim_use/browse_thread/thread/3c365eac4c8b814c

[2] "how to set omnifunc complete window height (with img)" - Zac Lee - Sep 28
http://groups.google.com/group/vim_use/browse_thread/thread/a2a99470e827662b

Best,
Ben

---
 src/ex_cmds.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index d53652f..801e325 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5464,6 +5464,9 @@ prepare_tagpreview(undo_sync)
            /*
             * There is no preview window open yet.  Create one.
             */
+           /* Prefer previewheight over tagpreview, if set and smaller */
+           if (g_do_tagpreview && p_pvh && p_pvh < g_do_tagpreview)
+               g_do_tagpreview = p_pvh;
            if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0)
                                                                      == FAIL)
                return FALSE;
--
1.7.1

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui