Skip to content

Commit

Permalink
Upgrade jansi from 2.4.0 to 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 25, 2023
1 parent 2e9e223 commit 0f01e4c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<automatic.module.name />

<jna.version>5.13.0</jna.version>
<jansi.version>2.4.0</jansi.version>
<jansi.version>2.4.1</jansi.version>
<juniversalchardet.version>1.0.3</juniversalchardet.version>
<sshd.version>2.9.2</sshd.version>
<easymock.version>5.1.0</easymock.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.io.IOException;

import org.fusesource.jansi.WindowsSupport;
import org.fusesource.jansi.internal.Kernel32;
import org.jline.terminal.impl.AbstractWindowsConsoleWriter;

import static org.fusesource.jansi.internal.Kernel32.WriteConsoleW;
Expand All @@ -27,7 +27,7 @@ public JansiWinConsoleWriter(long console) {
@Override
protected void writeConsole(char[] text, int len) throws IOException {
if (WriteConsoleW(console, text, len, writtenChars, 0) == 0) {
throw new IOException("Failed to write to console: " + WindowsSupport.getLastErrorMessage());
throw new IOException("Failed to write to console: " + Kernel32.getLastErrorMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import java.io.IOException;
import java.io.Writer;

import org.fusesource.jansi.WindowsSupport;
import org.fusesource.jansi.internal.Kernel32.*;
import org.fusesource.jansi.internal.Kernel32;
import org.jline.utils.AnsiWriter;
import org.jline.utils.Colors;

Expand Down Expand Up @@ -82,7 +81,7 @@ public WindowsAnsiWriter(Writer out) throws IOException {
private void getConsoleInfo() throws IOException {
out.flush();
if (GetConsoleScreenBufferInfo(console, info) == 0) {
throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
throw new IOException("Could not get the screen info: " + Kernel32.getLastErrorMessage());
}
if (negative) {
info.attributes = invertAttributeColors(info.attributes);
Expand All @@ -104,7 +103,7 @@ private void applyAttribute() throws IOException {
attributes = invertAttributeColors(attributes);
}
if (SetConsoleTextAttribute(console, attributes) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
throw new IOException(Kernel32.getLastErrorMessage());
}
}

Expand All @@ -122,7 +121,7 @@ private void applyCursorPosition() throws IOException {
info.cursorPosition.x = (short) Math.max(0, Math.min(info.size.x - 1, info.cursorPosition.x));
info.cursorPosition.y = (short) Math.max(0, Math.min(info.size.y - 1, info.cursorPosition.y));
if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
throw new IOException(Kernel32.getLastErrorMessage());
}
}

Expand Down Expand Up @@ -360,7 +359,7 @@ protected void processInsertLine(int optionInt) throws IOException {
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
throw new IOException(Kernel32.getLastErrorMessage());
}
}

Expand All @@ -376,7 +375,7 @@ protected void processDeleteLine(int optionInt) throws IOException {
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
throw new IOException(Kernel32.getLastErrorMessage());
}
}

Expand Down

0 comments on commit 0f01e4c

Please sign in to comment.