Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to manually select the syntax highlighting language #73

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

albert-tomanek
Copy link

@albert-tomanek albert-tomanek commented Mar 10, 2024

This is useful if you're editing an unsupported language.
(also added support for the NuShell scripting language)

By the way, I've made a backup of the only HTML-based documentation for TVision that I could find (in case it goes offline). You might want to clone it to your account since you host all the TVision-related stuff.
https://github.com/albert-tomanek/tvision-docs/
https://htmlpreview.github.io/?https://raw.githubusercontent.com/albert-tomanek/tvision-docs/master/html/index.html

@albert-tomanek
Copy link
Author

I've also attempted to add support for saving turbo's settings to a config file.
The file looks like this:

[Editor]
lineNumbers = false
autoIndent = true
wrapping = true

[State]
mostRecentDir = "/home/user/github/turbo"

and is saved in ~/.config/turbo.toml.

I chose to use the libtomlcpp (a wrapper around tomlc99) library to parse the config file, because it seemed the most lightweight. Unfortunately I found out too late that it doesn't support writing toml files so I just fprintf the config file myself when saving. In the worst case we can switch toml libraries.

#include <string.h>
#include <stdlib.h>

std::string config_path = "/.config/turbo.toml";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nicer not to hard-code "./config" here. Using $XDG_CONFIG_HOME would make it better for several OSes at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants