Permalink
Browse files

Bug fix: Don't search shadow notes in scanner.py

  • Loading branch information...
1 parent 273aa01 commit bb627d54abca39d1a5d43454d53428a9b8f13d41 @xolox committed Nov 3, 2011
Showing with 8 additions and 10 deletions.
  1. +3 −3 autoload/xolox/notes.vim
  2. +5 −7 misc/notes/scanner.py
View
@@ -1,12 +1,12 @@
" Vim auto-load script
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: October 23, 2011
+" Last Change: November 3, 2011
" URL: http://peterodding.com/code/vim/notes/
" Note: This file is encoded in UTF-8 including a byte order mark so
" that Vim loads the script using the right encoding transparently.
-let g:xolox#notes#version = '0.12.2'
+let g:xolox#notes#version = '0.12.3'
function! xolox#notes#shortcut() " {{{1
" The "note:" pseudo protocol is just a shortcut for the :Note command.
@@ -552,7 +552,7 @@ function! s:run_scanner(keywords, matches) " {{{2
if !(executable(python) && filereadable(scanner))
call xolox#misc#msg#debug("notes.vim %s: The %s script isn't executable.", g:xolox#notes#version, scanner)
else
- let arguments = [scanner, g:notes_indexfile, g:notes_directory, g:notes_shadowdir, a:keywords]
+ let arguments = [scanner, g:notes_indexfile, g:notes_directory, a:keywords]
call map(arguments, 'shellescape(v:val)')
let output = xolox#misc#str#trim(system(join([python] + arguments)))
if !v:shell_error
View
@@ -36,8 +36,7 @@ def decodestr(s):
database_file = mungepath(sys.argv[1])
user_directory = mungepath(sys.argv[2])
-shadow_directory = mungepath(sys.argv[3])
-keywords = decodestr(' '.join(sys.argv[4:]))
+keywords = decodestr(' '.join(sys.argv[3:]))
# Create or open SQLite database. {{{1
@@ -93,11 +92,10 @@ def tokenize(text):
# Find filenames & last modified times of existing notes. {{{1
notes_on_disk = {}
-for directory in user_directory, shadow_directory:
- for filename in os.listdir(directory):
- if filename != '.swp' and not fnmatch.fnmatch(filename, '.*.sw?'): # (Vim swap files are ignored)
- filename = os.path.join(directory, filename)
- notes_on_disk[filename] = dict(filename=filename, last_modified=os.path.getmtime(filename))
+for filename in os.listdir(user_directory):
+ if filename != '.swp' and not fnmatch.fnmatch(filename, '.*.sw?'): # (Vim swap files are ignored)
+ filename = os.path.join(user_directory, filename)
+ notes_on_disk[filename] = dict(filename=filename, last_modified=os.path.getmtime(filename))
if first_use:
for note in notes_on_disk.itervalues():
scan_note(note)

0 comments on commit bb627d5

Please sign in to comment.