mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-10-31 11:31:48 +00:00
Implement File->Save dropdown option
This commit is contained in:
1 parent
448ebe27cf
commit
6b3ef29515
2 files changed
+37
-5
No files matched your search
+4
-2
@@ -13,10 +13,10 @@ type TyperInputRequest struct {
|
||||
|
||||
var currentInputRequest *TyperInputRequest
|
||||
|
||||
func RequestInput(window *Window, text string) chan string {
|
||||
func RequestInput(window *Window, text string, defaultInput string) chan string {
|
||||
request := &TyperInputRequest{
|
||||
Text: text,
|
||||
input: "",
|
||||
input: defaultInput,
|
||||
cursorPos: 0,
|
||||
inputChannel: make(chan string),
|
||||
}
|
||||
@@ -25,6 +25,8 @@ func RequestInput(window *Window, text string) chan string {
|
||||
|
||||
window.CursorMode = CursorModeInputBar
|
||||
|
||||
_ = window.screen.PostEvent(tcell.NewEventInterrupt(nil))
|
||||
|
||||
return request.inputChannel
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user