Allow fewer columns in call signatures if 'ruler' is set

This commit is contained in:
Jacob Niehus
2015-10-14 20:34:01 -07:00
committed by Daniel Hahler
parent 067ab1ea4b
commit 9633044332

View File

@@ -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: