mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
feat(installer): 更新安装器版本号至1.0.1
feat(editor): 为高级编辑器添加Python语法高亮支持 - 新增python.lua语法定义文件 - 实现根据文件扩展名自动选择语法高亮 feat(pkg): 添加GitHub包安装支持 - 支持从GitHub仓库直接安装包 - 新增GitHub API基础URL配置 - 实现包元数据和文件下载功能 - 自动处理包版本和依赖关系 docs: 添加chest_sorter教程文档 - 新增chest_sorter_tutorial.md帮助文件 chore: 更新代码统计信息 - 添加VSCodeCounter生成的代码统计文件
This commit is contained in:
@@ -86,8 +86,17 @@ local function redraw()
|
||||
win.setVisible(true)
|
||||
end
|
||||
|
||||
local function getSyntaxFile(fileName)
|
||||
local ext = string.match(fileName, "%.([^%.]+)$") or ""
|
||||
local syntaxFiles = {
|
||||
lua = "/leonos/modules/main/edit/syntax/lua.lua",
|
||||
py = "/leonos/modules/main/edit/syntax/python.lua"
|
||||
}
|
||||
return syntaxFiles[ext] or syntaxFiles.lua
|
||||
end
|
||||
|
||||
local syntax = require("edit.syntax")
|
||||
.new("/leonos/modules/main/edit/syntax/lua.lua")
|
||||
.new(getSyntaxFile(file))
|
||||
|
||||
local function rehighlight()
|
||||
local line = {}
|
||||
|
||||
Reference in New Issue
Block a user