From 160444ec7fd7c6df81826b8e06aa32a2ac1df856 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 24 Jan 2022 22:02:59 +0000 Subject: gdb/tui: add new 'tui window width' command and 'winwidth' alias This commit adds a new command 'tui window width', and an alias 'winwidth'. This command is equivalent to the old 'winheight' command (which was recently renamed 'tui window height'). Even though I recently moved the old tui commands under the tui namespace, and I would strongly encourage all new tui commands to be added as 'tui ....' only (users can create their own top-level aliases if they want), I'm breaking that suggestion here, and adding a 'winwidth' alias. Given that we already have 'winheight' and have done for years, it just didn't seem right to no have the matching 'winwidth'. You might notice in the test that the window resizing doesn't quite work right. I setup a horizontal layout, then grow and shrink the windows. At the end of the test the windows should be back to their original size... ... they are not. This isn't my fault, honest! GDB's window resizing is a little ... temperamental, and is prone to getting things slightly wrong during resizes, off by 1 type things. This is true for height resizing, as well as the new width resizing. Later patches in this series will rework the resizing algorithm, which should improve things in this area. For now, I'm happy that the width resizing is as good as the height resizing, given the existing quirks. For the docs side I include a paragraph that explains how multiple windows are required before the width can be adjusted. For completeness, I've added the same paragraph to the winheight description. With the predefined layouts this extra paragraph is not really needed for winheight, as there are always multiple windows on the screen. However, with custom layouts, this might not be true, so adding the paragraph seems like a good idea. As for the changes in gdb itself, I've mostly just taken the existing height adjustment code, changed the name to make it generic 'size' adjustment, and added a boolean flag to indicate if we are adjusting the width or the height. --- gdb/NEWS | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/NEWS') diff --git a/gdb/NEWS b/gdb/NEWS index 10090af..b1c4d95 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -148,6 +148,12 @@ tui window height and 'winheight' tui commands respectively. The old names still exist as aliases to these new commands. +tui window width +winwidth + The new command 'tui window width', and the alias 'winwidth' allow + the width of a tui window to be adjusted when windows are laid out + in horizontal mode. + * Changed commands print -- cgit v1.1