Home Explore Blog CI



neovim

43th chunk of `runtime/doc/api.txt`
446b2567c1b0746e832cd613c0eb0f8ff9feac646cefe3de0000000100000fc6
 ~
      • {window}  |window-ID|, or 0 for current window

    Return: ~
        (row, col) tuple with the window position

nvim_win_get_tabpage({window})                        *nvim_win_get_tabpage()*
    Gets the window tabpage

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window

    Return: ~
        Tabpage that contains the window

nvim_win_get_var({window}, {name})                        *nvim_win_get_var()*
    Gets a window-scoped (w:) variable

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window
      • {name}    Variable name

    Return: ~
        Variable value

nvim_win_get_width({window})                            *nvim_win_get_width()*
    Gets the window width

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window

    Return: ~
        Width as a count of columns

nvim_win_hide({window})                                      *nvim_win_hide()*
    Closes the window and hide the buffer it contains (like |:hide| with a
    |window-ID|).

    Like |:hide| the buffer becomes hidden unless another window is editing
    it, or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close|
    or |nvim_win_close()|, which will close the buffer.

    Attributes: ~
        not allowed when |textlock| is active
        Since: 0.5.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window

nvim_win_is_valid({window})                              *nvim_win_is_valid()*
    Checks if a window is valid

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window

    Return: ~
        true if the window is valid, false otherwise

nvim_win_set_buf({window}, {buffer})                      *nvim_win_set_buf()*
    Sets the current buffer in a window, without side effects

    Attributes: ~
        not allowed when |textlock| is active
        Since: 0.3.2

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window
      • {buffer}  Buffer id

nvim_win_set_cursor({window}, {pos})                   *nvim_win_set_cursor()*
    Sets the (1,0)-indexed cursor position in the window. |api-indexing| This
    scrolls the window even if it is not the current one.

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window
      • {pos}     (row, col) tuple representing the new position

nvim_win_set_height({window}, {height})                *nvim_win_set_height()*
    Sets the window height.

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window
      • {height}  Height as a count of rows

nvim_win_set_hl_ns({window}, {ns_id})                   *nvim_win_set_hl_ns()*
    Set highlight namespace for a window. This will use highlights defined
    with |nvim_set_hl()| for this namespace, but fall back to global
    highlights (ns=0) when missing.

    This takes precedence over the 'winhighlight' option.

    Attributes: ~
        Since: 0.8.0

    Parameters: ~
      • {ns_id}   the namespace to use

nvim_win_set_var({window}, {name}, {value})               *nvim_win_set_var()*
    Sets a window-scoped (w:) variable

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window
      • {name}    Variable name
      • {value}   Variable value

nvim_win_set_width({window}, {width})                   *nvim_win_set_width()*
    Sets the window width. This will only succeed if the screen is split
    vertically.

    Attributes: ~
        Since: 0.1.0

    Parameters: ~
      • {window}  |window-ID|, or 0 for current window
      • {width}   Width as a count of columns

nvim_win_text_height({window}, {opts})                *nvim_win_text_height()*
    Computes the number of screen lines occupied by a range of text in a

Title: Neovim Window Functions (Continued)
Summary
This section continues the documentation of Neovim's window-related API functions. It covers functions like `nvim_win_hide` for hiding a window, `nvim_win_is_valid` to check window validity, `nvim_win_set_buf` to set the buffer of a window, `nvim_win_set_cursor` to set the cursor position, `nvim_win_set_height` and `nvim_win_set_width` to adjust window dimensions, `nvim_win_set_hl_ns` to set the highlight namespace for the window, and `nvim_win_set_var` for setting window-scoped variables. It also introduces `nvim_win_text_height` to compute the number of screen lines occupied by a range of text in a window.