From 3316d8b8badd1d94dff88fae1649e2f83674c02e Mon Sep 17 00:00:00 2001 From: Peter Bui Date: Mon, 8 Aug 2011 16:18:55 -0400 Subject: [PATCH 1/2] Resize uses up and down, not bottom and top - Fix userguide resize example - Update migration script --- docs/userguide | 8 ++++---- i3-migrate-config-to-v4 | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/userguide b/docs/userguide index 4a11cb1b..f4dd8cb1 100644 --- a/docs/userguide +++ b/docs/userguide @@ -789,11 +789,11 @@ mode "resize" { bindsym j resize shrink left bindsym Shift+j resize grow left - bindsym k resize grow bottom - bindsym Shift+k resize shrink bottom + bindsym k resize grow up + bindsym Shift+k resize shrink up - bindsym l resize shrink top - bindsym Shift+l resize grow top + bindsym l resize shrink down + bindsym Shift+l resize grow down bindsym semicolon resize grow right bindsym Shift+semicolon resize shrink right diff --git a/i3-migrate-config-to-v4 b/i3-migrate-config-to-v4 index 5f20cba1..65d6bdce 100755 --- a/i3-migrate-config-to-v4 +++ b/i3-migrate-config-to-v4 @@ -289,6 +289,11 @@ sub convert_command { my ($direction, $sign, $px) = ($command =~ /^resize (left|right|top|bottom) ([+-])([0-9]+)/); my $cmd = 'resize '; $cmd .= ($sign eq '+' ? 'grow' : 'shrink') . ' '; + if ($direction eq 'top') { + $direction = 'down'; + } elsif ($direction eq 'bottom') { + $direction = 'up'; + } $cmd .= "$direction "; $cmd .= "$px px"; print qq|$statement $key $cmd\n|; From 98cc37e223c53d40648536c61b52de10c45a2967 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 9 Aug 2011 09:46:02 +0200 Subject: [PATCH 2/2] swap up/down, also modify the testcase --- docs/userguide | 8 ++++---- i3-migrate-config-to-v4 | 4 ++-- testcases/t/71-config-migrate.t | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/userguide b/docs/userguide index f4dd8cb1..158ed553 100644 --- a/docs/userguide +++ b/docs/userguide @@ -789,11 +789,11 @@ mode "resize" { bindsym j resize shrink left bindsym Shift+j resize grow left - bindsym k resize grow up - bindsym Shift+k resize shrink up + bindsym k resize grow down + bindsym Shift+k resize shrink down - bindsym l resize shrink down - bindsym Shift+l resize grow down + bindsym l resize shrink up + bindsym Shift+l resize grow up bindsym semicolon resize grow right bindsym Shift+semicolon resize shrink right diff --git a/i3-migrate-config-to-v4 b/i3-migrate-config-to-v4 index 65d6bdce..0a8db2de 100755 --- a/i3-migrate-config-to-v4 +++ b/i3-migrate-config-to-v4 @@ -290,9 +290,9 @@ sub convert_command { my $cmd = 'resize '; $cmd .= ($sign eq '+' ? 'grow' : 'shrink') . ' '; if ($direction eq 'top') { - $direction = 'down'; - } elsif ($direction eq 'bottom') { $direction = 'up'; + } elsif ($direction eq 'bottom') { + $direction = 'down'; } $cmd .= "$direction "; $cmd .= "$px px"; diff --git a/testcases/t/71-config-migrate.t b/testcases/t/71-config-migrate.t index 4e97fb27..fb331c48 100644 --- a/testcases/t/71-config-migrate.t +++ b/testcases/t/71-config-migrate.t @@ -256,13 +256,13 @@ $output = migrate_config('bindsym Mod1+f resize left +10'); ok(line_exists($output, qr|^bindsym Mod1\+f resize grow left 10 px$|), 'resize left changed'); $output = migrate_config('bindsym Mod1+f resize top -20'); -ok(line_exists($output, qr|^bindsym Mod1\+f resize shrink top 20 px$|), 'resize top changed'); +ok(line_exists($output, qr|^bindsym Mod1\+f resize shrink up 20 px$|), 'resize top changed'); $output = migrate_config('bindsym Mod1+f resize right -20'); ok(line_exists($output, qr|^bindsym Mod1\+f resize shrink right 20 px$|), 'resize right changed'); $output = migrate_config('bindsym Mod1+f resize bottom +23'); -ok(line_exists($output, qr|^bindsym Mod1\+f resize grow bottom 23 px$|), 'resize bottom changed'); +ok(line_exists($output, qr|^bindsym Mod1\+f resize grow down 23 px$|), 'resize bottom changed'); ##################################################################### # check whether jump's parameters get changed correctly