From 9633044332dd2b467ee590dd5e9c3263ad9072b8 Mon Sep 17 00:00:00 2001 From: Jacob Niehus Date: Wed, 14 Oct 2015 20:34:01 -0700 Subject: [PATCH] Allow fewer columns in call signatures if 'ruler' is set --- jedi_vim.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jedi_vim.py b/jedi_vim.py index c92b7f1..d284fc6 100644 --- a/jedi_vim.py +++ b/jedi_vim.py @@ -413,9 +413,10 @@ def cmdline_call_signatures(signatures): params = get_params(signatures[0]) text = ', '.join(params).replace('"', '\\"').replace(r'\n', r'\\n') - # Allow 12 characters for ruler/showcmd - setting noruler/noshowcmd - # here causes incorrect undo history - max_msg_len = int(vim_eval('&columns')) - 12 + # Allow 12 characters for showcmd plus 18 for ruler - setting + # noruler/noshowcmd here causes incorrect undo history + max_msg_len = int(vim_eval('&columns')) - ( + 30 if int(vim_eval('&ruler')) else 12) max_num_spaces = (max_msg_len - len(signatures[0].call_name) - len(text) - 2) # 2 accounts for parentheses if max_num_spaces < 0: