cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.31k stars 71 forks source link

setting a non-standard keymap in settings causes it to incorrectly write all keymap info to device-settings.toml #914

Closed rcoreilly closed 1 week ago

rcoreilly commented 4 months ago

Describe the bug

see tittle

How to reproduce

see title.

Example code

No response

Relevant output

No response

Platform

macOS

kkoreilly commented 4 months ago

This is expected behavior; non-default saving is based on struct fields, and there is only one struct field for the whole key map, as it is just a map.

rcoreilly commented 4 months ago

It should just save the one KeyMap field, not the KeyMaps:

KeyMap = 'MacEmacs'

[KeyMaps]
[[KeyMaps.Value]]
...

KeyMaps is Set = false

image

kkoreilly commented 3 months ago

This happens when you change anything in device settings, so the issue is that it can not correctly detect whether the KeyMap and KeyMaps are non-default.

rcoreilly commented 2 months ago

this just bit me in the latest update..

kkoreilly commented 1 week ago

I fixed this in f293200860f11ace9e60a6eeb98f01a3ee0dff54.