This fixed what can be considered a bug or a missing feature :smirk: If one uses directory local variables to configure this mode, this doesn't work correctly when you're working in more than one project, because the values are being taken from the current buffer, not the one of the project being updated. This change fixes that.
Note: this change also undoes an optimization that was present on the code before, where the buffer list would be iterated to get the file names and cached, now this is done once per project, but only until the right buffer is found, not the whole list. I tried it with three projects and ~10 buffers and didn't visually notice any difference, but I didn't do any benchmarking.
It also changes the way it checks if a buffer is editing a file in a project, using string-prefix-p instead of compare-strings. I think it does the same, but to be honest I didn't fully understand the previous version, so I might be missing something.
Lastly, I think the dependency on cl-lib can be removed, I didn't do it though, also in case I'm missing something.
This fixed what can be considered a bug or a missing feature :smirk: If one uses directory local variables to configure this mode, this doesn't work correctly when you're working in more than one project, because the values are being taken from the current buffer, not the one of the project being updated. This change fixes that.
Note: this change also undoes an optimization that was present on the code before, where the buffer list would be iterated to get the file names and cached, now this is done once per project, but only until the right buffer is found, not the whole list. I tried it with three projects and ~10 buffers and didn't visually notice any difference, but I didn't do any benchmarking.
It also changes the way it checks if a buffer is editing a file in a project, using
string-prefix-p
instead ofcompare-strings
. I think it does the same, but to be honest I didn't fully understand the previous version, so I might be missing something.Lastly, I think the dependency on
cl-lib
can be removed, I didn't do it though, also in case I'm missing something.