Files
neovim/src/nvim/window.h
luukvbaal 06ff5480ce vim-patch:9.1.0993: New 'cmdheight' behavior may be surprising #31892
Problem:  Although patch 9.1.0990 fixed a real problem/inconsistency,
          it also introduced new behavior that may break BWC and/or be
          unexpected. Before 9.1.0990, window commands could make the
          topframe smaller (without changing 'cmdheight'; quirk that is
          now fixed), but did not allow extending the topframe beyond
          the 'cmdheight' set by the user. After 9.1.0990, the user can
          reduce the 'cmdheight' below the value they set explicitly,
          through window commands, which may lead to confusion.
          (aftere v9.1.0990)
Solution: Store the value explicitly set by the user and clamp the
          'cmdheight' when resizing the topframe. This also applies to
          dragging laststatus, which in contrast to window commands
          _did_ allow reducing the 'cmdheight' to values below the one
          set by the user. So with this patch there is still new
          behavior, but I think in a way that is less surprising.
          While at it, also fix a Coverity warning, introduced in
          v9.1.0990 (Luuk van Baal)

c97e869535
2025-01-06 17:00:09 -08:00

41 lines
1.3 KiB
C

#pragma once
#include <stdbool.h>
#include "nvim/buffer_defs.h" // IWYU pragma: keep
#include "nvim/garray_defs.h" // IWYU pragma: keep
#include "nvim/macros_defs.h"
#include "nvim/option_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
/// arguments for win_split()
enum {
WSP_ROOM = 0x01, ///< require enough room
WSP_VERT = 0x02, ///< split/equalize vertically
WSP_HOR = 0x04, ///< equalize horizontally
WSP_TOP = 0x08, ///< window at top-left of shell
WSP_BOT = 0x10, ///< window at bottom-right of shell
WSP_HELP = 0x20, ///< creating the help window
WSP_BELOW = 0x40, ///< put new window below/right
WSP_ABOVE = 0x80, ///< put new window above/left
WSP_NEWLOC = 0x100, ///< don't copy location list
WSP_NOENTER = 0x200, ///< don't enter the new window
};
enum {
MIN_COLUMNS = 12, ///< minimal columns for screen
MIN_LINES = 2, ///< minimal lines for screen
STATUS_HEIGHT = 1, ///< height of a status line under a window
};
enum {
/// Lowest number used for window ID. Cannot have this many windows per tab.
LOWEST_WIN_ID = 1000,
};
EXTERN int tabpage_move_disallowed INIT( = 0); ///< moving tabpages around disallowed
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "window.h.generated.h"
#endif