Sublime Forum

Indexing every few seconds

#1

The problem I’ve been having is that, after indexing has finished, every few seconds the indexer tries again, and the UI get’s locked up for a second or two.

I’ve asked about how indexing works in Sublime Text 3, and it only does this when it sees that a file has changed. That obviously makes sense, but what didn’t make sense was that I didn’t see any files being changed on my end.

For months I’ve just dealt with it, but the other day I happen to notice something interesting. I was going to change a value in my .git/config file, and I noticed that the .git/index.lock file popped up in the sidebar, and then disappeared! Of course, I had the Git plugin installed, and it was calling git status every few seconds, which created the index.lock file and then destroyed it.

I actually don’t use that plugin at all, so I removed it, and I haven’t seen the issue since. There may be a different way to deal with this, so please comment on this if you have a different solution. I hope this helps someone else having this issue!

2 Likes

#2

A look onto a SysInternals procmon protocol reveals both sublime_text.exe and plugin_host.exe are walking through the .git directory and all its sub directories of a package repository. They seem to be included in the index and file change handler by default.

This happens with all git using packages disabled.

As soon as I call git status in a repository located under Packages sublime_text.exe starts scanning the whole sub tree of the .git folder.

Not sure whether this is a bug or not, but a .git directory should not be watched for changes or included in the list of indexed directories.

1 Like

#3

I agree with this. A simple solution may be to augment the “index_exclude_patterns” setting to also understand directories instead of just files. For example:

{
    "index_exclude_patterns":
    [
        "*.log",
        "*/.git/*"
    ]
}
2 Likes

#4

Yesterday, I also had ST re-indexing all my projects (2) every few seconds for no apparent reason. After a restart this issue went away, however.

0 Likes

#5

Have this idea in mind, too.

0 Likes

#6

You may have had a different issue then. I would have been happy with that same outcome, but I had been dealing with this issue for months (and many restarts), with no luck. For my case, it definitely was the Git plugin.

0 Likes

#7

In case anyone is interested, I’ve created a feature request for this “index_exclude_patterns” behavior augmentation. Maybe others can add more justification for this feature to be implemented.

0 Likes

#8

have you considered just adding .git/* to your binary_file_patterns preference? Files matching this pattern will still show up in the side bar, so you can edit your .git/config, but won’t be included in Goto Anything (i.e. the index) or Find in Files

1 Like

#9

Yes, I did try that, and it didn’t work…

0 Likes