Skip to content

Commit

Permalink
[shell mode] Fix number highlight at end of line.
Browse files Browse the repository at this point in the history
  • Loading branch information
cben authored and marijnh committed Apr 30, 2014
1 parent 097ef7e commit b6fb1fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mode/shell/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CodeMirror.defineMode('shell', function() {
}
if (/\d/.test(ch)) {
stream.eatWhile(/\d/);
if(!/\w/.test(stream.peek())) {
if(stream.eol() || !/\w/.test(stream.peek())) {
return 'number';
}
}
Expand Down
5 changes: 3 additions & 2 deletions mode/shell/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
MT("comment",
"text [comment # Blurb]");

// TODO: numbers at EOL are not styled 'number'
MT("numbers",
"[number 0] [number 1] [number 2]");
MT("keywords",
"[keyword while] [atom true]; [keyword do]",
" [builtin sleep] 3",
" [builtin sleep] [number 3]",
"[keyword done]");
MT("options",
"[builtin ls] [attribute -l] [attribute --human-readable]");
Expand Down

0 comments on commit b6fb1fc

Please sign in to comment.