()
| 274 | } |
| 275 | |
| 276 | func SaveSettings() { |
| 277 | |
| 278 | path, _ := xdg.ConfigFile(SettingsPath) |
| 279 | |
| 280 | saveData, _ := sjson.Set("{}", "version", globals.Version.String()) |
| 281 | |
| 282 | saveData, _ = sjson.SetRaw(saveData, "properties", globals.Settings.Serialize(false)) |
| 283 | |
| 284 | saveData, _ = sjson.Set(saveData, "recent files", globals.RecentFiles) |
| 285 | |
| 286 | saveData, _ = sjson.SetRaw(saveData, "keybindings", globals.Keybindings.Serialize()) |
| 287 | |
| 288 | saveData = gjson.Get(saveData, "@pretty").String() |
| 289 | |
| 290 | if file, err := os.Create(path); err != nil { |
| 291 | log.Println(err) |
| 292 | } else { |
| 293 | file.Write([]byte(saveData)) |
| 294 | file.Close() |
| 295 | } |
| 296 | |
| 297 | } |
| 298 | |
| 299 | // func (ps *OldProgramSettings) CleanUpRecentPlanList() { |
| 300 |
no test coverage detected