Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F132169
prompt.lua
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
673 B
Referenced Files
None
Subscribers
None
prompt.lua
View Options
-- The prefix that will be before the search text for the user
local
prompt_prefix
=
">> "
local
prompt
=
{}
prompt
.
value
=
""
prompt
.
text
=
function
()
return
prompt
.
value
end
prompt
.
update
=
function
()
vim
.
notify
(
prompt_prefix
..
prompt
.
text
())
end
prompt
.
input
=
function
(
char
)
if
char
==
"BACKSPACE"
then
prompt
.
value
=
string.sub
(
prompt
.
value
,
0
,
-
2
)
elseif
char
==
"
\\\\
"
then
prompt
.
value
=
prompt
.
value
..
"
\\
"
else
prompt
.
value
=
prompt
.
value
..
char
end
prompt
.
update
()
end
prompt
.
set
=
function
(
value
)
prompt
.
value
=
value
prompt
.
update
()
end
prompt
.
destroy
=
function
()
prompt
.
value
=
""
vim
.
notify
""
end
return
prompt
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Apr 10 2026, 11:34 AM (5 w, 19 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16043
Default Alt Text
prompt.lua (673 B)
Attached To
Mode
R1 ivy.nvim
Attached
Detach File
Event Timeline
Log In to Comment