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

How to test whether a window is placed just above the command-line?

Expand Messages
  • Paul Bolle
    0) I m new to this list. 1) How should you test whether a window is placed just above the command-line? I m trying to write a hack for src/ui.c. For this hack
    Message 1 of 2 , Nov 4, 2004
      0) I'm new to this list.

      1) How should you test whether a window is placed just above the
      command-line?

      I'm trying to write a hack for src/ui.c. For this hack I need to test
      whether a window is at the bottom of the screen (directly above the
      command-line). Something like "mywin == lastwin" seems to work correctly
      with horizontally split windows. However it does not work with
      vertically split windows that are placed directly above the command line
      as only one of those windows seems to qualify as "lastwin".

      Any suggestions?

      Kind regards,


      Paul Bolle
    • Paul Bolle
      ... You seem to be correct. However, I m looking for a way to test (in C) whether a window is at the bottom of the screen. (A comparable vim function could be
      Message 2 of 2 , Nov 4, 2004
        On Thu, 2004-11-04 at 14:36, Antoine J. Mechelynck wrote:
        > Paul Bolle <pebolle@...> wrote:
        > > How should you test whether a window is placed just above the
        > > command-line?
        > >
        > > I'm trying to write a hack for src/ui.c. For this hack I need to test
        > > whether a window is at the bottom of the screen (directly above the
        > > command-line). Something like "mywin == lastwin" seems to work
        > > correctly with horizontally split windows. However it does not work
        > > with vertically split windows that are placed directly above the
        > > command line as only one of those windows seems to qualify as
        > > "lastwin".
        >
        > I believe the following (untested) will return nonzero if and only the
        > current window is the last one
        >
        > function InLastWindow()
        > wincmd w
        > let result = (winnr() == 1)
        > wincmd W
        > return result
        > endfunction

        You seem to be correct.

        However, I'm looking for a way to test (in C) whether a window is at the
        bottom of the screen. (A comparable vim function could be called
        something like: "JustAboveCommandLine()".)

        Regards,


        Paul Bolle
      Your message has been successfully submitted and would be delivered to recipients shortly.