Title. Cud knows session files are JSON format, even though the file extension is custom.
The yes/no dialog buttons need different labels. I suggest "Launch Session" and "View Raw File" button labels instead of yes/no.
Lex *.cuda-session Files as JSON if Opened as Raw Content
-
Random Void User
- Posts: 99
- Joined: 13.07.2024 21:19
-
main Alexey
- Posts: 2907
- Joined: 25.08.2021 18:15
Re: Lex *.cuda-session Files as JSON if Opened as Raw Content
To open session-files as JSON, use this Cud feature:
https://wiki.freepascal.org/CudaText#File_types
Yes/no dialog btns - will think, if it's easy.
https://wiki.freepascal.org/CudaText#File_types
Yes/no dialog btns - will think, if it's easy.
-
main Alexey
- Posts: 2907
- Joined: 25.08.2021 18:15
Re: Lex *.cuda-session Files as JSON if Opened as Raw Content
Yes/no buttons - done, update the plugin Session_Manager.
-
Random Void User
- Posts: 99
- Joined: 13.07.2024 21:19
Re: Lex *.cuda-session Files as JSON if Opened as Raw Content
Thanks, that helps. Anyway I do think the default user.json should have preset
The default settings have no such detection section at all, so adding this would help users see how to configure it.
Code: Select all
"detect": {
"*.cuda-session": "JSON"
}
-
main Alexey
- Posts: 2907
- Joined: 25.08.2021 18:15
Re: Lex *.cuda-session Files as JSON if Opened as Raw Content
ok, added default preset for *.cuda-session in memory (not in default.json).
I can add to settings_default/default.json these lines
EDIT
ops, OptionsEditor + OptionsEditorLite plugins cannot handle these lines in default.json. shows errors. so declined.
I can add to settings_default/default.json these lines
Code: Select all
//[Detect]
"detect": {
"*.cuda-session": "JSON"
},
"detect_line": {
"<\\?xml .+": "XML",
"\\#!/bin/(ba)?sh": "Bash script",
"\\#!/usr/bin/env (ba)?sh": "Bash script",
"\\#!/usr/bin/env python\\d*": "Python",
"\\#!.*\\b(node|js|bun|osascript\\s+-l\\s+JavaScript)": "JavaScript"
},
ops, OptionsEditor + OptionsEditorLite plugins cannot handle these lines in default.json. shows errors. so declined.
-
Random Void User
- Posts: 99
- Joined: 13.07.2024 21:19
Re: Lex *.cuda-session Files as JSON if Opened as Raw Content
The default preset file only needs *.cuda-session, other file types already work without a detection setting, as far as I know. I do not have a Python detection setting, but Cud always lexes Python files correctly by its own mechanism (filename?).
-
main Alexey
- Posts: 2907
- Joined: 25.08.2021 18:15
Re: Lex *.cuda-session Files as JSON if Opened as Raw Content
Python files usually have the .py extension.
'data/lexlib/Python.lcf' file:
'data/lexlib/Python.lcf' file:
Code: Select all
Extentions =
'py py3 pyw pyi rpy cpy SConstruct SConscript gyp gypi Snakefile ' +
'smk vpy wscript bazel bzl'