Commit 83d4375d authored by jiahua.liu's avatar jiahua.liu

to merge

parent 3844ef33
...@@ -482,7 +482,9 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI { ...@@ -482,7 +482,9 @@ object MiraiConsoleTerminalUI : MiraiConsoleUI {
val width = terminal.terminalSize.columns - 6 val width = terminal.terminalSize.columns - 6
var x = string var x = string
while (true) { while (true) {
if (x == "") break if (x == "") {
break
}
val toWrite = if (x.actualLength() > width) { val toWrite = if (x.actualLength() > width) {
val index = x.getSubStringIndexByActualLength(width) val index = x.getSubStringIndexByActualLength(width)
x.substring(0, index).also { x.substring(0, index).also {
......
...@@ -300,7 +300,7 @@ object MiraiConsole { ...@@ -300,7 +300,7 @@ object MiraiConsole {
if (allDown) { if (allDown) {
return return
} }
var fullCommand = commandChannel.poll() var fullCommand = commandChannel.take(1)[0]
if (fullCommand != null) { if (fullCommand != null) {
if (!fullCommand.startsWith("/")) { if (!fullCommand.startsWith("/")) {
fullCommand = "/$fullCommand" fullCommand = "/$fullCommand"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment