Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Petar Popovic <pjoetri@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Fix tui new-layout -horizontal argument placement
Date: Sat, 29 Nov 2025 18:40:01 +0100	[thread overview]
Message-ID: <CAD1v46vK5QXoNudAep5dMKSEAmB6nRZTkv9ptATvqASX86fz1w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

From c3506f07eaf79a3c26e00bc6750708323cac4c99 Mon Sep 17 00:00:00 2001
From: Petar Popovic <pjoetri@gmail.com>
Date: Sat, 29 Nov 2025 17:41:30 +0100
Subject: [PATCH] Fix tui new-layout -horizontal argument placement

The optional argument `-horizontal` from `tui new-layout` is supposed
to be checked directly after the command but instead it is checked
after the layout name.
This commit moves the check to the correct place.
---

First time using an email list for patches.
Sorry for the previous "just copy/pasted" patches:
https://sourceware.org/pipermail/gdb-patches/2025-November/222937.html
https://sourceware.org/pipermail/gdb-patches/2025-November/223021.html

 gdb/tui/tui-layout.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
index 95d20fbf22c..1dcd7086cac 100644
--- a/gdb/tui/tui-layout.c
+++ b/gdb/tui/tui-layout.c
@@ -1207,17 +1207,17 @@ validate_window_name (const std::string &name)
 static void
 tui_new_layout_command (const char *spec, int from_tty)
 {
+  bool is_vertical = true;
+  spec = skip_spaces (spec);
+  if (check_for_argument (&spec, "-horizontal"))
+    is_vertical = false;
+
   std::string new_name = extract_arg (&spec);
   if (new_name.empty ())
     error (_("No layout name specified"));
   if (new_name[0] == '-')
     error (_("Layout name cannot start with '-'"));

-  bool is_vertical = true;
-  spec = skip_spaces (spec);
-  if (check_for_argument (&spec, "-horizontal"))
-    is_vertical = false;
-
   std::vector<std::unique_ptr<tui_layout_split>> splits;
   splits.emplace_back (new tui_layout_split (is_vertical));
   gdb::unordered_set<std::string> seen_windows;
-- 
2.52.0

[-- Attachment #2: Type: text/html, Size: 2225 bytes --]

             reply	other threads:[~2025-11-29 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-29 17:40 Petar Popovic [this message]
2025-12-03 22:30 ` Tom Tromey
2025-12-04 10:04   ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD1v46vK5QXoNudAep5dMKSEAmB6nRZTkv9ptATvqASX86fz1w@mail.gmail.com \
    --to=pjoetri@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox