summaryrefslogtreecommitdiff
path: root/src/core/wee-command.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-02-21 19:31:44 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-02-21 19:31:44 +0100
commit412332653a74e3f7a9c629d88cb7d71c1c3f254b (patch)
tree895c173b04ec70e84648086931e0bf3069453ab8 /src/core/wee-command.c
parent8b273613dfca3b21a3c808d14002cc70f2588fe5 (diff)
downloadweechat-412332653a74e3f7a9c629d88cb7d71c1c3f254b.zip
Allow relative size for command /window resize
Diffstat (limited to 'src/core/wee-command.c')
-rw-r--r--src/core/wee-command.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 3666694e5..32eff9737 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -4418,11 +4418,27 @@ COMMAND_CALLBACK(window)
{
if (argc > 2)
{
- error = NULL;
- number = strtol (argv[2], &error, 10);
- if (error && !error[0]
- && (number > 0) && (number < 100))
- gui_window_resize (gui_current_window, number);
+ if ((argv[2][0] == '+') || (argv[2][0] == '-'))
+ {
+ error = NULL;
+ number = strtol (argv[2] + 1, &error, 10);
+ if (error && !error[0])
+ {
+ if (argv[2][0] == '-')
+ number *= -1;
+ gui_window_resize_delta (gui_current_window, number);
+ }
+ }
+ else
+ {
+ error = NULL;
+ number = strtol (argv[2], &error, 10);
+ if (error && !error[0]
+ && (number > 0) && (number < 100))
+ {
+ gui_window_resize (gui_current_window, number);
+ }
+ }
}
return WEECHAT_RC_OK;
}
@@ -5162,7 +5178,7 @@ command_init ()
N_("list"
" || -1|+1|b#|up|down|left|right"
" || splith|splitv [<pct>]"
- " || resize <pct>"
+ " || resize [+/-]<pct>"
" || merge [all]"
" || page_up|page_down"
" || refresh"