FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
librime-lua-script/lua/tools/_shadowcandidate.lua at main · shewer/librime-lua-script · GitHub
shewer
librime-lua-script
Repository navigation
Code
Issues
4
(4)
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
librime-lua-script
/
lua
/
tools
/
_shadowcandidate.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (38 loc) · 974 Bytes
Breadcrumbs
librime-lua-script
/
lua
/
tools
/
_shadowcandidate.lua
Copy path
File metadata and controls
42 lines (38 loc) · 974 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!
/usr/bin/env lua
--
--
_candidate.lua
--
Copyright (C) 2022 Shewer Lu <shewer@gmail.com>
--
--
Distributed under terms of the MIT license.
--
local
class
=
require
'
tools/class
'
if
TEST
and
not
Candidate
then
Candidate
=
require
'
test/fake/Candidate
'
end
--
warp ShadowCandidate
if
ShadowCandidate
then
return
end
--
not work not a an<Candidate> userdata
ShadowCandidate
=
class
({
_initialize
=
function
(
self
,
cand
,
type
,
text
,
comment
)
self
.
_cand
=
cand
self
.
type
=
type
self
.
text
=
text
self
.
comment
=
comment
self
.
start
=
start
self
.
_end
=
_end
return
self
end
,
})
local
hook_tab
=
{}
--
for old versino
local
function
fake_SCandidate
(
cand
,
_type
,
text
,
comment
)
_type
=
_type
or
cand
.
type
text
=
text
or
cand
.
text
comment
=
comment
or
cand
.
comment
hook_tab
[
cand
]
=
Candidate
(
_type
,
cand
.
start
,
cand
.
_end
,
text
,
comment
)
return
hook_tab
[
cand
]
end
ShadowCandidate
=
LevelDb
and
ShadowCandidate
or
fake_SCandidate
return
ShadowCandidate
Back
|
FazBrowse Home
|
New Git URL