-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search not working unless I comment out try block #53
Comments
Search seems to be failing for me, too. I am running on Windows. When I run ":SearchNotes posit", I see that python is launched. However, in Vim, I get "notes.vim 0.023.4: No matches" When I run the same python command line, I get the following output:
|
jedverity, it sounds like you have a workaround. I couldn't see the workaround in your vim-notes fork - are you able to push it up? |
Here's the commit – glortho@6c49d36 – or you can just use this fork, though it's a bad and temporary fix for sure! https://github.com/jedverity/vim-notes/tree/search-fix |
Unfortunately, that doesn't seem to fix the problem for me. Back to the drawing board - but thanks for taking the time to push your fix up! Note: I get identical behaviour on Debian testing. |
This fixes it for me though! Thanks @jedverity |
works for me too, thanks |
Can this be pulled please? |
Can one of you run the Vim command
Hopefully the verbose messages will tell me / us what is going wrong here. Thanks! |
existing keyword:
Non-existing keyword:
From the error message, I assume something with loading autoload/xolox/shell.vim fails, in fact, I don't have it at all. I'm using Vundle here. Does that help you? Thanks for picking it up, |
OK, installing xolox/vim-shell fixed it for me. If it is required, you should probably add this to README.md in vim-notes. Cheers, |
Hey Sven, The dependency on vim-shell is supposed to be optional. Thanks for the feedback. Now I have something concrete to look into. Will (hopefully) report back here soon. |
@svenXY: Going by the first fragment you posted it seems like everything works fine... I suppose that despite these messages:
It really doesn't work? (just trying to make sure I understand the full situation). |
Correct, it does seem to find something, but then does not populate quickfix (it seems to keep the old quickfix instead, but I'm not sure about that) |
Long story short: I just pushed a small change to GitHub which includes some additional logging. Can someone who can reproduce the problem rerun the two tests I previously asked for with this 'new version' of the vim-notes plug-in? Now for the long story: I thought this might be a problem with Windows support but judging by the pathnames in the vim-notes output quoted by @svenXY he appears to be running UNIX so that rules that out. Then I thought it might be a problem with case sensitivity, because
I can see the potential for inconsistent behavior here when the keyword search in the Python script and the Assuming this hypothesis is correct, the next useful question to ask is why all of you are consistently hitting this inconsistency (no pun intended ;-) while this has never happened for me. I can think of a couple of reasons, all having to do with how a keyword search is translated into a Vim regular expression pattern by the vim-notes plug-in. Hence the opening question :-). |
With existing keyword (and after having removed vim-shell): notes.vim 0.23.10: Searching notes using keyword index ..
notes.vim 0.23.10: Executing external command python2 '/home/svh/.vim/bundle/vim-notes/misc/notes/search-notes.py' '--database' '/home/svh/.vim/bundle/vim-notes/misc/notes/index.pickle' '--ignore-case' '--notes' '/home/svh/somepath/notes'
'@diy'
im 'runtimepath' nicht gefunden: "autoload/xolox/shell.vim"
vim-misc 1.11: Generated shell expression: (python2 '/home/svh/.vim/bundle/vim-notes/misc/notes/search-notes.py' '--database' '/home/svh/.vim/bundle/vim-notes/misc/notes/index.pickle' '--ignore-case' '--notes' '/home/svh/somepath/notes' '@
diy') 1>'/tmp/vfhPp9X/7' 2>'/tmp/vfhPp9X/8'
vim-misc 1.11: Executing external command using system() function: sh -c '(python2 '\''/home/svh/.vim/bundle/vim-notes/misc/notes/search-notes.py'\'' '\''--database'\'' '\''/home/svh/.vim/bundle/vim-notes/misc/notes/index.pickle'\'' '\''--
ignore-case'\'' '\''--notes'\'' '\''/home/svh/somepath/notes'\'' '\''@diy'\'') 1>'\''/tmp/vfhPp9X/7'\'' 2>'\''/tmp/vfhPp9X/8'\'''
notes.vim 0.23.10: Search script output (raw): ['Python works fine!', '/home/svh/somepath/notes/LVM', '/home/svh/somepath/notes/diy misc', '/home/svh/somepath/notes/diy version control', '/home/svh/somepath/notes/diypuppet']
notes.vim 0.23.10: Search script output (processed): ['/home/svh/somepath/notes/LVM', '/home/svh/somepath/notes/diy misc', '/home/svh/somepath/notes/diy version control', '/home/svh/somepath/notes/diypuppet']
notes.vim 0.23.10: Search script reported 4 matching notes.
notes.vim 0.23.10: Populating quick-fix window using command: vimgrep /@diy/j /home/svh/somepath/notes/LVM /home/svh/somepath/notes/diy\ misc /home/svh/somepath/notes/diy\ version\ control /home/svh/somepath/notes/diypuppet
notes.vim 0.23.10: Populated quick-fix window in 0.0011 seconds.
notes.vim 0.23.10: Searched notes in 0.066 seconds. |
@svenXY: Thanks for the feedback. The potential issue I saw is not relevant apparently (judging by the messages you posted). My next suspect: Somewhere in the integration between vim-notes, vim-misc and vim-shell something is broken. The thing is, I can't seem to reproduce it. From some issues on GitHub I get the impression that it's a Windows only thing, but @svenXY is clearly running UNIX, so that surprises me. Nevertheless, yesterday evening I revived an old Windows XP virtual machine from backups so that I can at least try to test this myself on multiple operating systems. |
@xolox FYI I'm also on unix. |
FWIW - I am running Ubuntu 14.04. Had the same problem. Installing xolox/vim-shell fixed it. |
Same here. Ubuntu 14.04, didn't work before I installed vim-shell, but worked after. |
I also had this problem on my Linux machine and installing vim-shell solved the problem. @xolox, if you need any logs, please let me know and I'll try to reproduce it by uninstalling vim-shell. For the time being adding a note to README may be worthwhile for those users who may have problems with the search function. Edit: I use Pathogen. |
I'm having this issue as well. Running on OSX and using vundle. I see that it's searching, but nothing comes up. I get the correct alert if I search using a keyword that doesn't exist, but on searches that should easily succeed I get: |
Linux, Vundle, Vim 7.4. :verbose shows me that the Python script does find the correct matching notes (if any), but the quickfix window does not appear. However, if I specifically search with a pattern (:SearchNotes /foo/), then searching works as expected. Installing vim-shell fixes normal search for me as well, so I can do ":SearchNotes foo" and the quickfix appears containing correct results. |
I am having the same problem. Running OSX Yosemite, with VIM 7.4. I have installed vim-shell as suggested above, and the search works, but only with tags; every other search is unreliable. By the way, thank you for the plugin, it is allowing me to implement zettelkasten in VIM. |
Having the same problem here running OS X Yosemite. I have installed VIm-Shell, as per other commenters and still no luck. However if I search via regexp it returns expected results. |
Having same issue in Win7, known existing text string existing in several files. I have also manually installed vim-shell, but search still not working for me. Thanks for a fantastic plug-in! Before installing vim-shell:
After vim-shell installed:
|
The output that @cahartm quoted shows a different issue then previously discussed here. I'm specifically referring to the following line in the output:
The "Found 27 notes ..." message is not supposed to be there; it's printed on standard error and shouldn't be captured as standard output. Not sure whether Windows, Vim or Cygwin is to blame there but I think I just fixed that issue, so the latest version of vim-notes should work for @cahartm unless he's also affected by the other bug discussed here... |
As suggested by @canpolat: #53 (comment)
The good news is that I'm able to reproduce this issue now. The bad news is that Vim and I have been butting heads for the better part of my afternoon now and I'm not winning :-(. I'm absolutely flabbergasted by the behavior I'm seeing:
I've tried adding a lot more logging in my local checkout and gradually raising the
As can be seen in the log above I tried prefixing the pattern given to |
I just committed and released 08b9747 which at the very least recognizes the buggy situation and alerts the user about it instead of keeping silent and provoking frustration all around. At this point I'm gravitating between two expectations:
The new version indeed consistently reports the new error when performing a keyword search without vim-shell installed and consistently doesn't report the error (i.e. works fine) when vim-shell is installed. The thing that I don't understand is that the Python script works fine in either case, and this is the only part which has interaction with vim-shell. So either the mere presence of vim-shell changes global state which hides the bug, or the detection of whether vim-shell is installed somehow causes these obscure problems? |
Okay I'm sick of fighting obscure Vim script 'features' so have now decided to go with the flow, remove the try/catch construct, forget this issue ever happened and get on with my life (doing more productive things than fighting obscure corners of Vim [script] for hours on end ;-). Thanks for the copious amounts of feedback on this issue and sorry for dragging this out for so long, I usually try to understand what I'm doing, even if that takes a lot of time (because one can usually learn from obscure bugs like these). In my testing Happy Vimming all! |
|
Every search I performed would show that it was searching keyword index (0.23.4), but it would just go away errorlessly after a few seconds yielding no results, even when searching for tags or other keywords that I could see existed in the index.pickle and tags.txt files.
Commenting out the try block in autoload/xolox/notes.vim#search solved the problem, however. Surely it's not a good idea to keep it this way. How can I assist in the resolution of this?
Awesome plugin otherwise!
The text was updated successfully, but these errors were encountered: