Skip to content

Commit

Permalink
Merge pull request #186 from djnalluri/fix/designate-charset
Browse files Browse the repository at this point in the history
Fix designate charset logic
  • Loading branch information
xtyxtyx authored Feb 27, 2024
2 parents 7a478d4 + 333c4ef commit 6085f57
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/src/core/escape/handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class EscapeHandler {

void reverseIndex();

void designateCharset(int charset);
void designateCharset(int charset, int name);

void unkownEscape(int char);

Expand Down
8 changes: 4 additions & 4 deletions lib/src/core/escape/parser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ class EscapeParser {

bool _escHandleDesignateCharset0() {
if (_queue.isEmpty) return false;
_queue.consume();
handler.designateCharset(0);
int name = _queue.consume();
handler.designateCharset(0, name);
return true;
}

bool _escHandleDesignateCharset1() {
if (_queue.isEmpty) return false;
_queue.consume();
handler.designateCharset(1);
int name = _queue.consume();
handler.designateCharset(1, name);
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/terminal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ class Terminal with Observable implements TerminalState, EscapeHandler {
}

@override
void designateCharset(int charset) {
_buffer.charset.use(charset);
void designateCharset(int charset, int name) {
_buffer.charset.designate(charset, name);
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/src/utils/debugger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ class _TerminalDebuggerHandler implements EscapeHandler {
}

@override
void designateCharset(int charset) {
onCommand('designateCharset($charset)');
void designateCharset(int charset, int name) {
onCommand('designateCharset($charset, $name)');
}

@override
Expand Down
4 changes: 2 additions & 2 deletions test/src/core/escape/parser_test.mocks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ class MockEscapeHandler extends _i1.Mock implements _i2.EscapeHandler {
returnValueForMissingStub: null,
);
@override
void designateCharset(int? charset) => super.noSuchMethod(
void designateCharset(int? charset, int? name) => super.noSuchMethod(
Invocation.method(
#designateCharset,
[charset],
[charset, name],
),
returnValueForMissingStub: null,
);
Expand Down

0 comments on commit 6085f57

Please sign in to comment.