Loading ...
Sorry, an error occurred while loading the content.

Bug in 'help help' documentation wrt 'splitbelow'

Expand Messages
  • Spencer Collyer
    (I originally posted this as part of a message to vim-support, but I m reposting this part here as I believe it s a bug in either the documentation or the
    Message 1 of 7 , Sep 7, 2009
    • 0 Attachment
      (I originally posted this as part of a message to vim-support, but I'm reposting this part here as I believe it's a bug in either the documentation or the implementation.)

      In the help for the 'help' command it states the following:

      -----8<--------8<--------------------8<--------8<--------------------8<-------
      :h[elp] Open a window and display the help file in read-only
      mode. If there is a help window open already, use
      that one. Otherwise, if the current window uses the
      full width of the screen or is at least 80 characters
      wide, the help window will appear just above the
      current window. Otherwise the new window is put at
      the very top.
      -----8<--------8<--------------------8<--------8<--------------------8<-------

      However, I have the 'splitbelow' option set and my help windows always
      open below the current window. This is consistent with the help for
      'splitbelow' but not for the help for 'help'. Is this a bug in the help
      or the behaviour of 'help' when splitbelow is set?

      --
      <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
      9:06am up 10 days 15:01, 1 user, load average: 0.45, 0.33, 0.33
      Registered Linux User #232457 | LFS ID 11703

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Spencer Collyer
      ... Hate to reply to my own message, so this is just a ping to see if anyone has an opinion as to whether this is a documentation or implementation bug?
      Message 2 of 7 , Sep 14, 2009
      • 0 Attachment
        On Mon, 7 Sep 2009 09:08:15 +0100, Spencer Collyer wrote:
        > In the help for the 'help' command it states the following:
        >
        > -----8<--------8<--------------------8<--------8<--------------------8<-------
        > :h[elp] Open a window and display the help file in
        > read-only mode. If there is a help window open already, use
        > that one. Otherwise, if the current window
        > uses the full width of the screen or is at least 80 characters
        > wide, the help window will appear just above
        > the current window. Otherwise the new window is put at
        > the very top.
        > -----8<--------8<--------------------8<--------8<--------------------8<-------
        >
        > However, I have the 'splitbelow' option set and my help windows always
        > open below the current window. This is consistent with the help for
        > 'splitbelow' but not for the help for 'help'. Is this a bug in the
        > help or the behaviour of 'help' when splitbelow is set?

        Hate to reply to my own message, so this is just a ping to see if anyone has an opinion as to whether this is a documentation or implementation bug?

        Spencer

        --
        <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
        1:38pm up 17 days 19:33, 1 user, load average: 0.52, 0.27, 0.15
        Registered Linux User #232457 | LFS ID 11703

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Ingo Karkat
        ... IMHO, neither. The help just states the default, i.e. nosplitbelow case. It goes without mentioning that splitbelow also applies to the help window
        Message 3 of 7 , Sep 14, 2009
        • 0 Attachment
          On 14-Sep-09 14:40, Spencer Collyer wrote:
          > On Mon, 7 Sep 2009 09:08:15 +0100, Spencer Collyer wrote:
          >> In the help for the 'help' command it states the following:
          >>
          >> -----8<--------8<--------------------8<--------8<--------------------8<-------
          >> :h[elp] Open a window and display the help file in
          >> read-only mode. If there is a help window open already, use
          >> that one. Otherwise, if the current window
          >> uses the full width of the screen or is at least 80 characters
          >> wide, the help window will appear just above
          >> the current window. Otherwise the new window is put at
          >> the very top.
          >> -----8<--------8<--------------------8<--------8<--------------------8<-------
          >>
          >> However, I have the 'splitbelow' option set and my help windows always
          >> open below the current window. This is consistent with the help for
          >> 'splitbelow' but not for the help for 'help'. Is this a bug in the
          >> help or the behaviour of 'help' when splitbelow is set?
          >
          > Hate to reply to my own message, so this is just a ping to see if anyone has an opinion as to whether this is a documentation or implementation bug?

          IMHO, neither. The help just states the default, i.e. 'nosplitbelow' case. It
          goes without mentioning that 'splitbelow' also applies to the help window (which
          is just an ordinary window hosting a special buffer type).

          Remember, this is a help (as in helpful) document, not a watertight spec. Does
          the behavior bother you?

          -- regards, ingo
          --
          -- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
          -- http://vim.sourceforge.net/account/profile.php?user_id=9713 --

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Spencer Collyer
          ... I wouldn t say exactly that it bothers me, but I would prefer it if the help window could be made to always open at the top of the current window, no
          Message 4 of 7 , Sep 14, 2009
          • 0 Attachment
            On Mon, 14 Sep 2009 14:48:51 +0200, Ingo Karkat wrote:
            > IMHO, neither. The help just states the default, i.e. 'nosplitbelow'
            > case. It goes without mentioning that 'splitbelow' also applies to
            > the help window (which is just an ordinary window hosting a special
            > buffer type).
            >
            > Remember, this is a help (as in helpful) document, not a watertight
            > spec. Does the behavior bother you?

            I wouldn't say exactly that it bothers me, but I would prefer it if the
            help window could be made to always open at the top of the current
            window, no matter what the setting of 'splitbelow' is. It's just a
            personal preference, and I'll probably try writing a function to cope
            with it.

            Given that other inconsistencies in the help have been raised before I
            thought I'd mention it on here, but as you say, the 'help' system isn't
            a spec for the program :)

            Spencer

            --
            <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
            2:02pm up 17 days 19:57, 1 user, load average: 1.21, 1.30, 0.93
            Registered Linux User #232457 | LFS ID 11703

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Ingo Karkat
            ... You could override the :help command with the help of the cmdalias plugin, http://www.vim.org/scripts/script.php?script_id=746. Or use the filetype
            Message 5 of 7 , Sep 14, 2009
            • 0 Attachment
              On 14-Sep-09 15:05, Spencer Collyer wrote:
              > I wouldn't say exactly that it bothers me, but I would prefer it if the
              > help window could be made to always open at the top of the current
              > window, no matter what the setting of 'splitbelow' is. It's just a
              > personal preference, and I'll probably try writing a function to cope
              > with it.
              You could override the :help command with the help of the "cmdalias" plugin,
              http://www.vim.org/scripts/script.php?script_id=746.

              Or use the 'filetype' event; for example, I have an autocmd that automatically
              maximizes the help window when in a blank tab page:

              " Do not create a split for a help window if the only other window is a blank
              " buffer. Instead, maximize the help window. This is useful when a help page is
              " opened in a new tab page as a reference.
              function! s:MaximizeHelpWindow()
              if winnr('$') == 2
              let l:otherBufNr = winbufnr(2)
              if (empty(bufname(l:otherBufNr)) &&
              \ getbufvar(l:otherBufNr, '&modified') == 0 &&
              \ empty(getbufvar(l:otherBufNr, '&buftype'))
              \)
              only
              endif
              endif
              endfunction
              augroup MaximizeHelpWindow
              autocmd!
              autocmd FileType help call <SID>MaximizeHelpWindow()
              augroup END

              -- cheers, ingo

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • James Vega
              On Mon, Sep 14, 2009 at 9:05 AM, Spencer Collyer ... or if you don t want to type two words ... --~--~---------~--~----~------------~-------~--~----~ You
              Message 6 of 7 , Sep 14, 2009
              • 0 Attachment
                On Mon, Sep 14, 2009 at 9:05 AM, Spencer Collyer
                <spencer@...> wrote:
                >
                > On Mon, 14 Sep 2009 14:48:51 +0200, Ingo Karkat wrote:
                >> IMHO, neither. The help just states the default, i.e. 'nosplitbelow'
                >> case. It goes without mentioning that 'splitbelow' also applies to
                >> the help window (which is just an ordinary window hosting a special
                >> buffer type).
                >>
                >> Remember, this is a help (as in helpful) document, not a watertight
                >> spec. Does the behavior bother you?
                >
                > I wouldn't say exactly that it bothers me, but I would prefer it if the
                > help window could be made to always open at the top of the current
                > window, no matter what the setting of 'splitbelow' is. It's just a
                > personal preference, and I'll probably try writing a function to cope
                > with it.

                :top help

                or if you don't want to type two words

                :command! -nargs=? -complete=help Help top help <args>

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_dev" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Spencer Collyer
                ... Ah, of course, should have thought of filetype . I ll add something similar to your function into my .vimrc. I _knew_ there would be a (relatively) simple
                Message 7 of 7 , Sep 14, 2009
                • 0 Attachment
                  On Mon, 14 Sep 2009 15:18:24 +0200, Ingo Karkat wrote:
                  > ... use the 'filetype' event ...

                  Ah, of course, should have thought of 'filetype'. I'll add something similar to your function into my .vimrc.

                  I _knew_ there would be a (relatively) simple way to get what I wanted in VIm :)

                  Thanks to James Vega for his suggestions as well, but I think I'll try Ingo's first.

                  Spencer


                  --
                  <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
                  3:53pm up 17 days 21:49, 1 user, load average: 1.14, 0.76, 0.51
                  Registered Linux User #232457 | LFS ID 11703

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_dev" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                Your message has been successfully submitted and would be delivered to recipients shortly.