@@ -16,6 +16,7 @@ local nanoVERSION = "1.0.0"
1616
1717local function printf (...) print (string.format (... )) end
1818local function eprintf (...) io.stderr :write (string.format (... ) .. " \n " ) end
19+ local event_pull = term .pull or event .pull
1920-- Fix keys.none
2021keys [" none" ] = 0
2122keys [0 ] = " none"
@@ -187,7 +188,7 @@ local function parseRC(filename)
187188 if problem then
188189 print (" Press Enter to continue starting nano." )
189190 while true do
190- local name ,_ ,_ ,code = event . pull ()
191+ local name ,_ ,_ ,code = event_pull ()
191192 if name == " key_down" and code == keys .enter then break end
192193 end
193194 end
@@ -441,7 +442,7 @@ function binding.exit()
441442 gpu .setBackground (options .fgcolor )
442443 statusPrompt (" Save modified buffer (ANSWERING \" No\" WILL DESTROY CHANGES) ? " )
443444 while true do
444- local e ,_ ,c = event . pull ()
445+ local e ,_ ,c = event_pull ()
445446 if e == " key_down" then
446447 c = unicode .lower (unicode .char (c ))
447448 local ctrl = kbd .isControlDown ()
@@ -470,7 +471,7 @@ function binding.exit()
470471 -- TODO: Again, MYESNO mode
471472 statusPrompt (" File exists, OVERWRITE ? " )
472473 while true do
473- local e ,_ ,c = event . pull ()
474+ local e ,_ ,c = event_pull ()
474475 c = unicode .lower (unicode .char (c ))
475476 if e == " key_down" then
476477 local ctrl = kbd .isControlDown ()
694695switchBuffers (1 )
695696
696697while running do
697- local e = { event . pull () }
698+ local e = { event_pull () }
698699 if e [1 ] == " key_down" then
699700 local char , code = e [3 ], e [4 ]
700701 local ctrl = kbd .isControlDown ()
0 commit comments