Skip to content

Commit bb627d5

Browse files
committed
Bug fix: Don't search shadow notes in scanner.py
1 parent 273aa01 commit bb627d5

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

autoload/xolox/notes.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: October 23, 2011
3+
" Last Change: November 3, 2011
44
" URL: http://peterodding.com/code/vim/notes/
55

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.12.2'
9+
let g:xolox#notes#version = '0.12.3'
1010

1111
function! xolox#notes#shortcut() " {{{1
1212
" The "note:" pseudo protocol is just a shortcut for the :Note command.
@@ -552,7 +552,7 @@ function! s:run_scanner(keywords, matches) " {{{2
552552
if !(executable(python) && filereadable(scanner))
553553
call xolox#misc#msg#debug("notes.vim %s: The %s script isn't executable.", g:xolox#notes#version, scanner)
554554
else
555-
let arguments = [scanner, g:notes_indexfile, g:notes_directory, g:notes_shadowdir, a:keywords]
555+
let arguments = [scanner, g:notes_indexfile, g:notes_directory, a:keywords]
556556
call map(arguments, 'shellescape(v:val)')
557557
let output = xolox#misc#str#trim(system(join([python] + arguments)))
558558
if !v:shell_error

misc/notes/scanner.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ def decodestr(s):
3636

3737
database_file = mungepath(sys.argv[1])
3838
user_directory = mungepath(sys.argv[2])
39-
shadow_directory = mungepath(sys.argv[3])
40-
keywords = decodestr(' '.join(sys.argv[4:]))
39+
keywords = decodestr(' '.join(sys.argv[3:]))
4140

4241
# Create or open SQLite database. {{{1
4342

@@ -93,11 +92,10 @@ def tokenize(text):
9392
# Find filenames & last modified times of existing notes. {{{1
9493

9594
notes_on_disk = {}
96-
for directory in user_directory, shadow_directory:
97-
for filename in os.listdir(directory):
98-
if filename != '.swp' and not fnmatch.fnmatch(filename, '.*.sw?'): # (Vim swap files are ignored)
99-
filename = os.path.join(directory, filename)
100-
notes_on_disk[filename] = dict(filename=filename, last_modified=os.path.getmtime(filename))
95+
for filename in os.listdir(user_directory):
96+
if filename != '.swp' and not fnmatch.fnmatch(filename, '.*.sw?'): # (Vim swap files are ignored)
97+
filename = os.path.join(user_directory, filename)
98+
notes_on_disk[filename] = dict(filename=filename, last_modified=os.path.getmtime(filename))
10199
if first_use:
102100
for note in notes_on_disk.itervalues():
103101
scan_note(note)

0 commit comments

Comments
 (0)