asottile / babi

a text editor
MIT License
396 stars 46 forks source link

Fixed babi not using babi_grammars when installed in a venv #286

Closed MohrJonas closed 1 year ago

MohrJonas commented 1 year ago

(This is a new pull-request, since I somehow screwed the last one up, sorry about that 😊)

When installing babi in a venv, located somewhere on your pc, it won't pick up babi_grammar's existence, because the path isn't being searched and therefore syntax highlighting won't work. This PR tries to fix this by importing babi_grammar and using its path to find the correct grammar_v1 folder.

babi_grammars.__spec__.origin gives us an absolute path to babi_grammars.py. From there we go to the parent directory and into share/babi/grammar_v1

asottile commented 1 year ago

this is not correct. please start an issue describing your setup

MohrJonas commented 1 year ago

https://github.com/asottile/babi/issues/287