Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 1 | From b00b8332ab19e41c75ce143f45ab4585502c020b Mon Sep 17 00:00:00 2001 |
| 2 | From: Logan Rathbone <poprocks@gmail.com> |
| 3 | Date: Tue, 24 Oct 2023 14:06:04 -0400 |
| 4 | Subject: [PATCH] gtkhex: Local variables in switch statement should be in own |
| 5 | scope |
| 6 | |
| 7 | Fixes: #74 |
| 8 | |
| 9 | Thanks to: David C. Manuelda |
| 10 | |
| 11 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/ghex/-/commit/b00b8332ab19e41c75ce143f45ab4585502c020b] |
| 12 | --- |
| 13 | src/gtkhex.c | 4 ++++ |
| 14 | 1 file changed, 4 insertions(+) |
| 15 | |
| 16 | diff --git a/src/gtkhex.c b/src/gtkhex.c |
| 17 | index b401cd9..18e0433 100644 |
| 18 | --- a/src/gtkhex.c |
| 19 | +++ b/src/gtkhex.c |
| 20 | @@ -1941,6 +1941,7 @@ key_press_cb (GtkEventControllerKey *controller, |
| 21 | break; |
| 22 | |
| 23 | case GDK_KEY_Home: |
| 24 | + { |
| 25 | gint64 line_beg = self->cursor_pos; |
| 26 | |
| 27 | while (line_beg % self->cpl != 0) |
| 28 | @@ -1948,9 +1949,11 @@ key_press_cb (GtkEventControllerKey *controller, |
| 29 | |
| 30 | hex_widget_set_cursor (self, line_beg); |
| 31 | ret = GDK_EVENT_STOP; |
| 32 | + } |
| 33 | break; |
| 34 | |
| 35 | case GDK_KEY_End: |
| 36 | + { |
| 37 | gint64 line_end = self->cursor_pos; |
| 38 | |
| 39 | while (line_end % self->cpl != self->cpl - 1) |
| 40 | @@ -1958,6 +1961,7 @@ key_press_cb (GtkEventControllerKey *controller, |
| 41 | |
| 42 | hex_widget_set_cursor (self, MIN (line_end, payload_size)); |
| 43 | ret = GDK_EVENT_STOP; |
| 44 | + } |
| 45 | break; |
| 46 | |
| 47 | default: |
| 48 | -- |
| 49 | 2.42.0 |
| 50 | |