tajmone / ST4-Asciidoctor

AsciiDoc Package for SublimeText 4
https://tajmone.github.io/ST4-Asciidoctor
MIT License
11 stars 6 forks source link

(ST4 Bug) color_scheme setting is broken #46

Closed polyglot-jones closed 6 months ago

polyglot-jones commented 6 months ago

The "color_scheme": "AsciiDoc Dark.sublime-color-scheme" line that was recently added to Asciidoctor.sublime-settings is problematic. When ST4 loads, it tries to find AsciiDoc Dark.sublime-color-scheme in the Color Scheme - Default package and hangs with an OS Error. The ST4 bug is, obviously, that it needs to keep looking further.

In the mean time, we should remove this line, and change the verbiage in features.adoc to just recommend that users try out the provided color scheme, rather than attempting to force it upon them.

tajmone commented 6 months ago

The "color_scheme": "AsciiDoc Dark.sublime-color-scheme" line that was recently added to Asciidoctor.sublime-settings is problematic. When ST4 loads, it tries to find AsciiDoc Dark.sublime-color-scheme in the Color Scheme - Default package and hangs with an OS Error. The ST4 bug is, obviously, that it needs to keep looking further.

I haven't experienced this problem on my PC, and wasn't able to reproduce it.

I'm aware that ST has always been buggy when it comes to changes in key assets paths (especially syntaxes and color schemes), and even switching between Git branches which alter these paths can often lead to problems with ST complaining that it can't find the syntax. Sometimes, restarting ST fixes the problems, other times it requires tweaking the ST cache files.

In the mean time, we should remove this line, and change the verbiage in features.adoc to just recommend that users try out the provided color scheme, rather than attempting to force it upon them.

Before changing the scheme settings — enforcing the scheme by default was a deliberate and pondered-upon choice — I'd rather try to fix the problem, especially if it's due to a bug.

I've now created a test branch where I tweaked the scheme path, providing a more qualified relative path:

{
  "color_scheme": "Packages/ST4-Asciidoctor/Color-Schemes/AsciiDoc Dark.sublime-color-scheme",

Can you please pull locally and checkout my color-scheme-fix branch and test if it solves the problem on your side?

Thanks!

polyglot-jones commented 6 months ago

I'm also worried about the guy who is only just getting started with AsciiDoc. Currently, he uses ST for, say, C++ and he's chugging along with a color scheme he likes for his C++ work. Then, he installs ST4-Asciidoctor so he can begin to dabble with AsciiDoc, and all of a sudden his color scheme has changed on him for no apparent reason.

tajmone commented 6 months ago

I'm also worried about the guy who is only just getting started with AsciiDoc [...] he installs ST4-Asciidoctor so he can begin to dabble with AsciiDoc, and all of a sudden his color scheme has changed on him for no apparent reason.

I get your point.

Anyhow, could you please confirm me if the fix I've published on the test branch works or not — I still want to figure out why you're having problems and I don't (maybe it's just that ST knows where the scheme is because it's cached on my machine, since I've used it before).

polyglot-jones commented 6 months ago

Yes, I just confirmed that it's still broken for me.

File "C:\Program Files\Sublime Text 3\Lib\python33\sublime.py", line 435, in load_resource raise IOError('resource "%s" not found' % name) OSError: resource "Packages/Color Scheme - Default/AsciiDoc Dark.sublime-color-scheme" not found reloading settings Packages/ST4-Asciidoctor/Asciidoctor.sublime-settings

tajmone commented 6 months ago

I'm afraid that's the cache problem I mentioned earlier, then!

It's an awful bug that has been haunting ST users for years — since ST2!

There's no fix expect fiddling with the cache files — either simply delete them, but then you'll loose all your history and "quick open" cached entries, or to manually fix all occurences of the scheme via S&R.

Unfortunately this is a frequent problem, especially when installed packages rename or move around their syntaxes or schemes. Often it fixes itself by restarting the editor, but other times it simply won't go away (probably something goes wrong and the cache file is compromised).

Anyhow, thanks for trying!

I've added your contribution to the project, but in dev branch instead of master (see my comments in #48).

When I have some more free time (and that's nowhere soon, I'm afraid) I'll update the README to clarify that from now onward all pull requests must go through the dev baseline branch instead of master (I don't even remember what's in the README right now).