Mercurial Hosting > editor
diff src/luan_editor/window.luan @ 52:3f4c3722b78b
.luan_editor dir
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 24 May 2025 16:25:55 -0600 |
parents | c17c5312e8de |
children | d5681da8ece8 |
line wrap: on
line diff
--- a/src/luan_editor/window.luan Sat May 24 11:31:09 2025 -0600 +++ b/src/luan_editor/window.luan Sat May 24 16:25:55 2025 -0600 @@ -1,6 +1,9 @@ local Luan = require "luan:Luan.luan" local error = Luan.error local stringify = Luan.stringify or error() +local Parsers = require "luan:Parsers.luan" +local json_string = Parsers.json_string or error() +local json_parse = Parsers.json_parse or error() local Math = require "luan:Math.luan" local min = Math.min or error() local String = require "luan:String.luan" @@ -44,11 +47,11 @@ end end -local config_file = Io.uri("file:"..Swing.home_dir.."/.luan_editor") +local config_file = Io.uri("file:"..Swing.home_dir.."/.luan_editor/config.json") local config = {} if config_file.exists() then try - config = Luan.parse(config_file.read_text()) + config = json_parse(config_file.read_text()) catch e logger.error(e) end @@ -61,7 +64,7 @@ config.list_window.size = config.list_window.size or { width=200, height=400 } local function save_config() - config_file.write_text( stringify(config).."\n" ) + config_file.write_text( json_string(config).."\n" ) end local list_view = new_list{