From f7debaf1cf6fc7fd1b771ee9278829b07cf4b0e9 Mon Sep 17 00:00:00 2001 From: atomicules Date: Wed, 31 Aug 2016 17:50:36 +0100 Subject: [PATCH] When using vertical split try to use correct width for note list index Before, the entire width of the window was used and as soon as one note was opened the tags and date, etc would be invisible. This is inspired by the work of @sanchon in implementing the SimplenoteListSize setting. This doesn't account for the Vim configuration setting of numberwidth, but I'm not sure if it should. References #87 --- autoload/SimplenoteUtilities.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autoload/SimplenoteUtilities.py b/autoload/SimplenoteUtilities.py index 967471c..6ba7e2d 100644 --- a/autoload/SimplenoteUtilities.py +++ b/autoload/SimplenoteUtilities.py @@ -147,6 +147,13 @@ def format_title(self, note): # get window width for proper formatting width = vim.current.window.width + # But if vertical, then we want to adjust this + # Doesn't take into account numberwidth vim setting, but I think that is a Vim issue/bug. + if vim.eval('s:vbuff == 1') == "1": + if vim.eval('s:listsize > 0') == "1": + width = int(vim.eval('s:listsize')) + else: + width = width/2 # get note flags if "systemtags" in note: