PlainTasks icon indicating copy to clipboard operation
PlainTasks copied to clipboard

Open file triggers searching in the whole project

Open chaonan99 opened this issue 7 years ago • 7 comments

Thanks for the nice plugin! But as my project is huge (containing some dataset folder), when I try to open file link with ctrl+o, it starts searching the entire project tree and cause sublime to crash. How can I restrict the search just relative to the current open file?

chaonan99 avatar Jun 24 '18 15:06 chaonan99

You can only use a full path in a link to avoid waiting a long search.

But crash? how many folders and files you have?

vovkkk avatar Jun 24 '18 19:06 vovkkk

Thanks! What I mean by crash is that when I "stop search" after searching has started for some time, sublime is frozen and I have to do a force quit. I cannot get a precise number in a short time. For more reference, I'm using sshfs and let it follow symlinks, which is known to be not working well with sublime. I'm not sure if that causes the problem.

chaonan99 avatar Jun 24 '18 20:06 chaonan99

I cannot get a precise number in a short time

I’d really like to know tho.

when I "stop search" after searching has started for some time, sublime is frozen and I have to do a force quit

When you press Stop search, the code joins a thread, in which search happen, to the main one; so it is blocking operations. Taking into account that we’re talking about network here, did you try to wait instead of force quite? 10 seconds? 30 seconds? a minute?

Do you absolutely need to use sshfs? They say that unison & unox workaround most issues of ssh.

vovkkk avatar Jun 25 '18 03:06 vovkkk

That's 335804 files

chaonan99 avatar Nov 12 '18 03:11 chaonan99

All in one directory? well, as I said stopping search have to join a thread which is blocking operation, so if it takes too long to finish one iteration (we go though one directory per an iteration) then it will block main thread until it has a chance to exit the function: https://github.com/aziz/PlainTasks/blob/master/PlainTasks.py#L594

The reason for joining is to make sure that sequent searches will work as expected, i.e. a new search must not be started unless a previous is finished or cancelled, so results won’t be messed up in any way. I think we can avoid joining, but since we’ll have simultaneously-running threads it will be less reliable and more complicated. I don’t know when I’ll have a chance to try implementing this.

vovkkk avatar Nov 12 '18 05:11 vovkkk

Can this be implemented as a relative path to the current file, or add a configuration file to choose between searching or not? I guess traversal of a large directory will be expensive any way.

chaonan99 avatar Nov 12 '18 16:11 chaonan99