From 6d1e8945d34d451c5e6b2d0a34d771d325ab2519 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Tue, 4 Jun 2019 21:44:50 +0200 Subject: Resolve relative paths for upload command The tab completion for the upload command tab completes paths relative to weechat_dir, not the directory weechat was started from. Resolve the path given to the upload command to that directory, so tab completed relative paths work. --- wee_slack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'wee_slack.py') diff --git a/wee_slack.py b/wee_slack.py index e29b463..8f0f03e 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -4090,7 +4090,8 @@ def command_upload(data, current_buffer, args): Uploads a file to the current buffer. """ channel = EVENTROUTER.weechat_controller.buffers[current_buffer] - file_path = os.path.expanduser(args) + weechat_dir = w.info_get("weechat_dir", "") + file_path = os.path.join(weechat_dir, os.path.expanduser(args)) if channel.type == 'team': w.prnt('', "ERROR: Can't upload a file to the team buffer") -- cgit