Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F131807
lines.lua
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
764 B
Referenced Files
None
Subscribers
None
lines.lua
View Options
local
utils
=
require
"ivy.utils"
local
libivy
=
require
"ivy.libivy"
local
function
items
(
input
)
local
list
=
{}
local
lines
=
vim
.
api
.
nvim_buf_get_lines
(
vim
.
ivy
.
origin
(),
0
,
-
1
,
false
)
for
index
=
1
,
#
lines
do
local
line
=
lines
[
index
]
local
score
=
libivy
.
ivy_match
(
input
,
line
)
if
score
>
-
200
then
local
prefix
=
string.rep
(
" "
,
4
-
#
tostring
(
index
))
..
index
..
": "
table.insert
(
list
,
{
score
=
score
,
content
=
prefix
..
line
})
end
end
table.sort
(
list
,
function
(
a
,
b
)
return
a
.
score
<
b
.
score
end
)
return
list
end
local
lines
=
{
name
=
"Lines"
,
command
=
"IvyLines"
,
description
=
"Search though the lines in the current buffer"
,
items
=
items
,
callback
=
utils
.
line_action
(),
}
return
lines
File Metadata
Details
Attached
Mime Type
text/x-Algol68
Expires
Apr 6 2026, 6:30 PM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10579
Default Alt Text
lines.lua (764 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment