Skip to content

Commit

Permalink
When using vertical split try to use correct width for note list index
Browse files Browse the repository at this point in the history
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
  • Loading branch information
atomicules committed Sep 3, 2016
1 parent 8e9bcb8 commit f7debaf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/SimplenoteUtilities.py
Expand Up @@ -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:
Expand Down

0 comments on commit f7debaf

Please sign in to comment.