Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Aug 8, 2024
1 parent d461e9a commit 2e3871d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<section class="release" id="unreleased">

## Unreleased (2024-08-01)
## Unreleased (2024-08-08)

<section class="packages">

Expand Down Expand Up @@ -41,6 +41,7 @@

##### Bug Fixes

- [`e9c6d40`](https://github.com/stdlib-js/stdlib/commit/e9c6d40b6d4d382f39d2000c1996bd7ccb38bb29) - remove syntax highlighting upon encountering invalid JS [(#2758)](https://github.com/stdlib-js/stdlib/pull/2758)
- [`9147f69`](https://github.com/stdlib-js/stdlib/commit/9147f69c07d3beda24bfa63870694fbf7500d707) - `example` command hanging in REPL when executing multi-line code
- [`3efb708`](https://github.com/stdlib-js/stdlib/commit/3efb708f62e31603de837db5621522471046b27d) - address duplicate token bug when syntax-highlighting [(#2542)](https://github.com/stdlib-js/stdlib/pull/2542)
- [`d2cd4c3`](https://github.com/stdlib-js/stdlib/commit/d2cd4c355302240f3cc5ea050d349715925be744) - pass options when parsing to suppress warnings in the REPL [(#2430)](https://github.com/stdlib-js/stdlib/pull/2430)
Expand Down Expand Up @@ -274,6 +275,7 @@ A total of 9 people contributed to this release. Thank you to the following cont

<details>

- [`e9c6d40`](https://github.com/stdlib-js/stdlib/commit/e9c6d40b6d4d382f39d2000c1996bd7ccb38bb29) - **fix:** remove syntax highlighting upon encountering invalid JS [(#2758)](https://github.com/stdlib-js/stdlib/pull/2758) _(by Snehil Shah)_
- [`19abe48`](https://github.com/stdlib-js/stdlib/commit/19abe4839bccbe8b48fbe92f5fe9737f304a5cd9) - **docs:** update REPL namespace documentation [(#2722)](https://github.com/stdlib-js/stdlib/pull/2722) _(by stdlib-bot, Athan Reines)_
- [`9147f69`](https://github.com/stdlib-js/stdlib/commit/9147f69c07d3beda24bfa63870694fbf7500d707) - **fix:** `example` command hanging in REPL when executing multi-line code _(by Snehil Shah)_
- [`70eb789`](https://github.com/stdlib-js/stdlib/commit/70eb789d85da0d8470a61b28ed0a80ee1009d179) - **docs:** update REPL namespace documentation [(#2682)](https://github.com/stdlib-js/stdlib/pull/2682) _(by stdlib-bot, Philipp Burckhardt)_
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Roman Stetsyk <[email protected]>
Rutam <[email protected]>
Ryan Seal <[email protected]>
Sai Srikar Dumpeti <[email protected]>
SarthakPaandey <[email protected]>
Seyyed Parsa Neshaei <[email protected]>
Shashank Shekhar Singh <[email protected]>
Shivam <[email protected]>
Expand Down
22 changes: 11 additions & 11 deletions lib/syntax_highlighter.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,20 @@ setNonEnumerableReadOnly( SyntaxHighlighter.prototype, 'onKeypress', function on
if ( this._line !== this._rli.line ) {
// Tokenize:
debug( 'Line change detected. Tokenizing line: %s', this._rli.line );
tokens = tokenizer( this._rli.line, this._repl._context );
this._line = this._rli.line; // update line buffer
tokens = tokenizer( this._line, this._repl._context );
if ( isEmptyArray( tokens ) ) {
debug( 'No tokens found. Skipping highlighting...' );
this._multilineHandler.updateLine( this._rli.line ); // save displayed line
return;
this._highlightedLine = this._line;
} else {
// Process tokens:
tokens.sort( tokenComparator );
tokens = removeDuplicateTokens( tokens );

// Highlight:
debug( '%d tokens found. Highlighting...', tokens.length );
this._highlightedLine = this._highlightLine( this._line, tokens );
}
// Process tokens:
tokens.sort( tokenComparator );
tokens = removeDuplicateTokens( tokens );

// Highlight:
debug( '%d tokens found. Highlighting...', tokens.length );
this._line = this._rli.line; // updated line buffer
this._highlightedLine = this._highlightLine( this._line, tokens );
}
// Replace:
debug( 'Replacing current line with the highlighted line...' );
Expand Down

0 comments on commit 2e3871d

Please sign in to comment.