Permalink
Browse files

turned g:pad_position into a dictionary, so the list and the notes po…

…sition can be changed separatedly.

(broken compatibility with old values for g:pad_position)
  • Loading branch information...
1 parent c5796e7 commit e8991189555c38e0eb759e151df5448d70ea6fc9 @fmoralesc committed Aug 28, 2012
Showing with 12 additions and 9 deletions.
  1. +7 −4 doc/pad.txt
  2. +1 −1 plugin/pad.vim
  3. +2 −2 plugin/padlib/handler.py
  4. +2 −2 syntax/pad.vim
View
11 doc/pad.txt
@@ -139,10 +139,13 @@ Notes are opened by default in a split window the same height as the __Pad__
buffer. If you want to open the notes in the main window, set
*g:pad_open_in_split* to 0.
-vim-pad's window is opened at the bottom by default. If you want to open it
-right, you must change the value fo *g:pad_position* to "right" (the default
-is "bottom"). You can set the window width with *g:pad_window_width* (default:
-40). When vim-pad is opened this way, the timestamp is hidden.
+vim-pad's list is opened at the bottom by default. If you want to open it at
+the right side of the window, you must change the value of
+*g:pad_position["list"]* to "right" (the default is "bottom"). You can set the
+window width with *g:pad_window_width* (default: 40). When vim-pad is opened
+this way, the timestamp is hidden. Likewise, you can tell vim-pad to open the
+notes at the right side of the window by setting the value of
+*g:pad_position["pads"]* to "right".
vim-pad can search using either `grep` or `ack` (grep is the default). You can
set this using the *g:pad_search_backend* variable. By default, the search
View
2 plugin/pad.vim
@@ -34,7 +34,7 @@ if !exists('g:pad_window_width')
let g:pad_window_width = 40
endif
if !exists('g:pad_position')
- let g:pad_position = "bottom"
+ let g:pad_position = { "list" : "bottom", "pads": "bottom" }
endif
if !exists('g:pad_open_in_split')
let g:pad_open_in_split = 1
View
4 plugin/padlib/handler.py
@@ -34,7 +34,7 @@ def open_pad(path=None, first_line=None): #{{{1
path = join(get_save_dir(), timestamp())
if bool(int(vim.eval("g:pad_open_in_split"))):
- if vim.eval('g:pad_position') == 'right':
+ if vim.eval('g:pad_position["pads"]') == 'right':
vim.command("silent! rightbelow" + str(vim.eval("g:pad_window_width")) + "vsplit " + path)
else:
vim.command("silent! botright" + str(vim.eval("g:pad_window_height")) + "split " + path)
@@ -194,7 +194,7 @@ def display(query, archive): # {{{1
if len(pad_files) > 0:
if vim.eval("bufexists('__pad__')") == "1":
vim.command("bw __pad__")
- if vim.eval('g:pad_position') == "right":
+ if vim.eval('g:pad_position["list"]') == "right":
vim.command("silent! rightbelow " + str(vim.eval('g:pad_window_width')) + "vnew __pad__")
else:
vim.command("silent! botright " + str(vim.eval("g:pad_window_height")) + "new __pad__")
View
4 syntax/pad.vim
@@ -1,4 +1,4 @@
-if g:pad_position == "right"
+if g:pad_position["list"] == "right"
syn match PadTimestamp /^.\{-}│/ conceal
else
syn match PadTimestamp /^.\{-}│/ contains=PadName,PadTimestampDelimiter,PadTimestampTime
@@ -12,7 +12,7 @@ syn match PadEmptyLabel /\[EMPTY\]/ contained
syn match PadFolder / .*\%u2e25/ contained
syn match PadFolderStop /\%u2e25/ containedin=PadFolder conceal
syn match PadArchived /\/archive\// containedin=PadFolder
-if g:pad_position == "right"
+if g:pad_position["list"] == "right"
syn match PadSummaryPad / \//me=e-1 containedin=PadFolder conceal
endif
syn region PadSummary start=/\@<= /hs=s+1 end=/\(\%u21b2\|$\|[.,]\)\@=/ contains=PadHashTag,PadEmptyLabel,PadFolder

0 comments on commit e899118

Please sign in to comment.