Error with io.read () in lua

When I use io.read() , I get input from the user, but when I do this, he won’t count back spaces, so if I type:

 blah blah blaht 

when my program wants input, then if I remove t :

 blah blah blah 

Is he still reading this as if t , help?

EDIT: this only does when debugging, im using SciTE, thanks

+4
source share
1 answer

I tried to figure this out for a long time, and I came across this:

Here you have two programs: SciTE and cmd. SciTE sends each visible as "r" to "cmd" as soon as it is typed. SciTe interprets the internal key to change the buffer, but does not send the key to cmd. You cannot edit the command line as you want. The easiest way is to type Enter and try again. (a source)

Unfortunately, this is not possible to eliminate.

Your best options:

  • Run the Lua script outside of SciTE and then you will not have this problem.
  • Use a different editor
+1
source

Source: https://habr.com/ru/post/1481799/


All Articles