-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.lua
More file actions
25 lines (24 loc) · 894 Bytes
/
plugin.lua
File metadata and controls
25 lines (24 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env lua5.4
---@version 5.4
-- /qompassai/lua/lua_ls/addons/hyprlua/plugin.lua
-- Qompass AI HyprLua lua_ls Addon - Text Transform Plugin
-- Copyright (C) 2026 Qompass AI, All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
---@class diff
---@field start integer
---@field finish integer
---@field text string
---@param uri string
---@param text string
---@return nil|diff[]
function OnSetText(uri, text)
if not uri:match('hypr.*%.lua$') then
return nil
end
if text:sub(1, 8) == '--#!hypr' then
return {
{ start = 1, finish = text:find('\n') or 8, text = '' },
}
end
return nil
end