Skip to content

read conf.toml as documented in the readme - #206

Open
nepinhum wants to merge 2 commits into
vlang:masterfrom
scheforks:feat/toml-config
Open

nepinhum wants to merge 2 commits into
vlang:masterfrom
scheforks:feat/toml-config

Conversation

@nepinhum

@nepinhum nepinhum commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

README.md documents ~/.ved/conf.toml but loading it was commented out and only config.json worked.

This reads conf.toml as described: [editor] settings and [colors] (base16) overrides. It's applied on top of config.json and reloaded after every save. Only keys present in the file are used and Ved still doesn't create the file itself.

A text size saved with C = / C - stays over the text sizes in conf.toml. Zooming isn't reset on save.
disable_fmt and atomic_save can also be set in [editor].

@medvednikov medvednikov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the TOML parsing, JSON/zoom precedence, and save-time reload paths at 992a3ae. Two functional issues are noted inline. CI was excluded from this review.

Comment thread config.v
ved.error_line = 'conf.toml: ${err.msg()}'
map[string]gg.Color{}
}
ved.cfg.set_default_values()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Update GG's background color when reloading the palette

Changing [colors].base00 while Ved is running does not update the editor background after a save. set_default_values() changes cfg.bgcolor, but ved.v passes that value to gg.new_context() only at startup; subsequent frames use GG's cached clear color, and this reload path never updates it. For example, changing a light palette to base00 = "1e1e1e" and base05 = "d4d4d4" changes the text to light gray while leaving the light background until restart. Please update the existing GG context with set_bg_color() when applying the new configuration, accounting for the initial load before ved.gg exists.

Comment thread config.v
}
toml.parse_text('') or { panic(err) }
}
ved.cfg.apply_toml_editor(doc, zoom_saved)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Rebuild the base configuration before applying each TOML overlay

When config.json does not exist (as before the zoom shortcuts have saved it), this applies TOML to the already configured ved.cfg. Removing an editor setting therefore leaves its old value active: start with [editor] disable_fmt = true, delete that entry from conf.toml, and save again; formatting remains disabled on subsequent saves until restart. set_default_values() only rebuilds colors and text styles, so it does not clear the stale flag. Please reconstruct the defaults/JSON configuration before each TOML overlay so removed keys fall back consistently on reload and startup.

@nepinhum
nepinhum requested a review from medvednikov October 10, 2026 14:27
@nepinhum

Copy link
Copy Markdown
Contributor Author

Addressed both at de96782 . load_config2 now starts from the defaults each time, so removed keys fall back, and it updates the gg background color when reloading.

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