Skip to content

Commit 2e3871d

Browse files
committed
Auto-generated commit
1 parent d461e9a commit 2e3871d

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-08-01)
7+
## Unreleased (2024-08-08)
88

99
<section class="packages">
1010

@@ -41,6 +41,7 @@
4141

4242
##### Bug Fixes
4343

44+
- [`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)
4445
- [`9147f69`](https://github.com/stdlib-js/stdlib/commit/9147f69c07d3beda24bfa63870694fbf7500d707) - `example` command hanging in REPL when executing multi-line code
4546
- [`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)
4647
- [`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)
@@ -274,6 +275,7 @@ A total of 9 people contributed to this release. Thank you to the following cont
274275

275276
<details>
276277

278+
- [`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)_
277279
- [`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)_
278280
- [`9147f69`](https://github.com/stdlib-js/stdlib/commit/9147f69c07d3beda24bfa63870694fbf7500d707) - **fix:** `example` command hanging in REPL when executing multi-line code _(by Snehil Shah)_
279281
- [`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)_

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
7070
Rutam <138517416+performant23@users.noreply.github.com>
7171
Ryan Seal <splrk@users.noreply.github.com>
7272
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
73+
SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com>
7374
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
7475
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
7576
Shivam <11shivam00@gmail.com>

lib/syntax_highlighter.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,20 @@ setNonEnumerableReadOnly( SyntaxHighlighter.prototype, 'onKeypress', function on
328328
if ( this._line !== this._rli.line ) {
329329
// Tokenize:
330330
debug( 'Line change detected. Tokenizing line: %s', this._rli.line );
331-
tokens = tokenizer( this._rli.line, this._repl._context );
331+
this._line = this._rli.line; // update line buffer
332+
tokens = tokenizer( this._line, this._repl._context );
332333
if ( isEmptyArray( tokens ) ) {
333334
debug( 'No tokens found. Skipping highlighting...' );
334-
this._multilineHandler.updateLine( this._rli.line ); // save displayed line
335-
return;
335+
this._highlightedLine = this._line;
336+
} else {
337+
// Process tokens:
338+
tokens.sort( tokenComparator );
339+
tokens = removeDuplicateTokens( tokens );
340+
341+
// Highlight:
342+
debug( '%d tokens found. Highlighting...', tokens.length );
343+
this._highlightedLine = this._highlightLine( this._line, tokens );
336344
}
337-
// Process tokens:
338-
tokens.sort( tokenComparator );
339-
tokens = removeDuplicateTokens( tokens );
340-
341-
// Highlight:
342-
debug( '%d tokens found. Highlighting...', tokens.length );
343-
this._line = this._rli.line; // updated line buffer
344-
this._highlightedLine = this._highlightLine( this._line, tokens );
345345
}
346346
// Replace:
347347
debug( 'Replacing current line with the highlighted line...' );

0 commit comments

Comments
 (0)