Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08b9747

Browse files
committed
Add lots of debug logging (related to issue#53)
1 parent9b7eb4e commit08b9747

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎autoload/xolox/notes.vim

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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-
letg:xolox#notes#version='0.33.2'
9+
letg:xolox#notes#version='0.33.3'
1010
letg:xolox#notes#url_pattern='\<\(mailto:\|#"diff-9dabcf74fee8f5a7b9ab5c351b817a2ff52dfa9fe6eaf24dddc2a0d2b53c0ba7-11-11-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">11
11
lets:scriptdir=expand('<sfile>:p:h')
1212

@@ -482,12 +482,14 @@ function! xolox#notes#search(bang, input) " {{{1
482482
endif
483483
endif
484484
ifinput=~'^/.\+/$'
485+
callxolox#misc#msg#debug("notes.vim %s: Performing pattern search (%s) ..",g:xolox#notes#version,input)
485486
calls:internal_search(a:bang,input,'','')
486487
calls:set_quickfix_title([],input)
487488
else
488489
let keywords=split(input)
489490
let all_keywords=s:match_all_keywords(keywords)
490491
let any_keyword=s:match_any_keyword(keywords)
492+
callxolox#misc#msg#debug("notes.vim %s: Performing keyword search (%s) ..",g:xolox#notes#version,input)
491493
calls:internal_search(a:bang, all_keywords,input, any_keyword)
492494
if &buftype=='quickfix'
493495
" Enable line wrapping in the quick-fix window.
@@ -696,10 +698,12 @@ function! s:internal_search(bang, pattern, keywords, phase2) " {{{2
696698
let notes= []
697699
let phase2_needed=1
698700
ifa:keywords!=''&&s:run_scanner(a:keywords, notes)
701+
callxolox#misc#msg#debug("notes.vim %s: Skipping phase 1 search (performed using Python script) ..",g:xolox#notes#version)
699702
ifa:phase2!=''
700703
let pattern=a:phase2
701704
endif
702705
else
706+
callxolox#misc#msg#debug("notes.vim %s: Performing phase 1 search to gather matching notes ..",g:xolox#notes#version)
703707
calls:vimgrep_wrapper(a:bang,a:pattern,xolox#notes#get_fnames(0))
704708
let notes=s:qflist_to_filenames()
705709
ifa:phase2!=''
@@ -717,7 +721,12 @@ function! s:internal_search(bang, pattern, keywords, phase2) " {{{2
717721
" search using :vimgrep we need to run :vimgrep another time to get the
718722
" quick-fix list in the right format :-|
719723
if phase2_needed
724+
callsetqflist([])
725+
callxolox#misc#msg#debug("notes.vim %s: Performing phase 2 search to populate quick-fix window ..",g:xolox#notes#version)
720726
calls:vimgrep_wrapper(a:bang, pattern, notes)
727+
if!empty(notes)&&empty(getqflist())
728+
throw"Failed to populate quick-fix window! Looks like you're being bitten by this bug: https://github.com/xolox/vim-notes/issues/53"
729+
endif
721730
endif
722731
ifa:bang==''&&bufnr('%')!= bufnr_save
723732
" If :vimgrep opens the first matching file while &eventignore is still
@@ -737,8 +746,8 @@ function! s:vimgrep_wrapper(bang, pattern, files) " {{{2
737746
letargs=map(copy(a:files),'fnameescape(v:val)')
738747
callinsert(args,a:pattern .'j')
739748
lets:swaphack_enabled=1
749+
let ei_save= &eventignore
740750
try
741-
let ei_save= &eventignore
742751
seteventignore=syntax,bufread
743752
letcommand=printf('vimgrep%s %s',a:bang,join(args))
744753
callxolox#misc#msg#debug("notes.vim %s: Populating quick-fix window using command: %s",g:xolox#notes#version,command)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp