porcupine
porcupine copied to clipboard
Filetype isn't remembered when restarting
- Make sure "Remember open tabs when Porcupine is closed and reopened" is checked (in menubar --> Settings --> Porcupine Settings)
- Make a new file (Ctrl+N)
- Write some C code, e.g.
short int x;
. It will highlight poorly with the default Python filetype. - Set filetype to C. This will cause the code to highlight much better.
- Close Porcupine (do not save the file first)
- Reopen Porcupine
Currently filetype seems to reset back to python: the newly created file highlights badly again, and you need to select C from the "Filetypes" menu again. It should remember that the filetype was C.
Fixing this needs some time spent debugging and understanding what is happening. Relevant files are:
-
porcupine/plugins/restart.py
for the logic of how opened files are remembered -
porcupine/plugins/tabs.py
definesFileTab.get_state()
-
porcupine/plugins/filetypes.py
contains all filetypes related code.
To see all log messages from a specific file, you can use for example:
$ python3 -m porcupine --verbose-logger porcupine.plugins.filetypes