Skip to content

Commit 4312712

Browse files
committed
REPL demo: add light.nanorctheme and rename default theme to dark
1 parent f72694f commit 4312712

File tree

5 files changed

+68
-15
lines changed

5 files changed

+68
-15
lines changed

demo/src/main/java/org/jline/demo/Repl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public static void main(String[] args) {
265265
File jnanorcFile = Paths.get(root, DEFAULT_NANORC_FILE).toFile();
266266
if (!jnanorcFile.exists()) {
267267
try (FileWriter fw = new FileWriter(jnanorcFile)) {
268-
fw.write("theme " + root + "nanorc/*.nanorctheme\n");
268+
fw.write("theme " + root + "nanorc/dark.nanorctheme\n");
269269
fw.write("include " + root + "nanorc/*.nanorc\n");
270270
}
271271
}

demo/src/main/scripts/command.nanorc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax "COMMAND"
22

3-
FUNCTION: "[a-zA-Z]+[a-zA-Z0-9]*"
3+
COMMAND: "[a-zA-Z]+[a-zA-Z0-9]*"
44
VARIABLE: ".*="
55
PLAIN: "(\"|'|\.|=|:|\[|,|\])"
66
COMMENT: "(^|\\s+)#.*$"
Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file describes a default scheme for nanorc syntax highlighting.
2+
# This file describes a default scheme for nanorc syntax highlighting for terminals with dark background
33
#
44
# Lines that start with a # character are comments.
55
# Comments are ignored. Empty lines are ignored too. Leading/trailing white
@@ -34,33 +34,31 @@ BOOLEAN brightwhite
3434
NULL cyan
3535
NUMBER blue
3636
VARIABLE brightyellow
37-
PACKAGE green,,faint
37+
PACKAGE green,faint
3838
CLASS green
3939
CONSTANT yellow
4040
OPERATOR yellow
41+
COMMAND brightgreen
4142
OPTION yellow
4243
KEYWORD brightwhite
43-
MACRO brightmagenta
44-
DELIMITER brightred
4544
JUMP brightcyan
4645
SECTION brightgreen
47-
TAG brightwhite
4846
ATTRIBUTE green
49-
CHARREF brightred
5047
PATH brightblue
51-
URL brightblue
52-
EMAIL brightblue
48+
EXECUTABLE green
49+
LINK cyan
50+
TITLE brightblue
5351
ESCAPE black,cyan
54-
REGEXP blue,cyan
52+
DEBUG brightmagenta
53+
ERROR red
5554
TODO brightwhite,cyan
5655
WARNING ,red
5756
WHITESPACE ,green
5857
HEADER bold,!blue,~grey7,underline
5958
ROW_NUMBER bold,!blue,~grey7
6059
ROW_STYLE ,~grey15
61-
DEBUG brightmagenta
6260
LIST_BACKGROUND ,~grey42
63-
LIST_GROUP ~greenyellow
61+
LIST_GROUP yellow
6462
#
6563
# mixin
6664
#

demo/src/main/scripts/init.jline

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ CONSOLE_OPTIONS['docs'].put('java.*',['https://docs.oracle.com/javase/8/docs/api
1818
'http://docs.groovy-lang.org/latest/html/groovy-jdk/'])
1919
CONSOLE_OPTIONS['docs'].put('.*/java.*','https://docs.oracle.com/javase/8/docs/api/')
2020
CONSOLE_OPTIONS['docs'].put('org/jline/.*','https://www.javadoc.io/doc/org.jline/jline/latest/')
21-
CONSOLE_OPTIONS.PRNT_COLORS = 'th=HEADER:rn=ROW_NUMBER:rs=ROW_STYLE:mk=ATTRIBUTE:em=WARNING:vs=DEBUG'
21+
CONSOLE_OPTIONS.PRNT_COLORS = 'th=HEADER:rn=ROW_NUMBER:rs=ROW_STYLE:mk=ATTRIBUTE:em=ERROR:vs=DEBUG'
22+
CONSOLE_OPTIONS.LS_COLORS = 'di=PATH:ex=EXECUTABLE:ln=LINK:fi='
23+
CONSOLE_OPTIONS.HELP_COLORS = "ti=TITLE:co=1:ar=3:op=OPTION"
2224
CONSOLE_OPTIONS.READER_COLORS = [:]
2325
CONSOLE_OPTIONS['READER_COLORS'].put('COMPLETION_STYLE_LIST_BACKGROUND', 'LIST_BACKGROUND')
2426
CONSOLE_OPTIONS['READER_COLORS'].put('COMPLETION_STYLE_LIST_GROUP', 'LIST_GROUP')
@@ -91,7 +93,9 @@ GROOVY_OPTIONS.metaMethodsCompletion = false
9193
GROOVY_OPTIONS.allClassesCompletion = false
9294
GROOVY_OPTIONS.allConstructorsCompletion = false
9395
GROOVY_OPTIONS.syntheticMethodsCompletion = false
94-
96+
GROOVY_OPTIONS.GROOVY_COLORS = 'ti=TITLE:me=ERROR'
97+
GROOVY_OPTIONS.nanorcSyntax = 'Java'
98+
GROOVY_OPTIONS.nanorcValue = 'GRON'
9599
#
96100
# custom Groovy pipes
97101
#
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#
2+
# This file describes a default scheme for nanorc syntax highlighting for terminals with light background.
3+
#
4+
5+
PLAIN black
6+
FUNCTION green
7+
STRING cyan
8+
COMMENT brightcyan
9+
DOC_COMMENT cyan
10+
TYPE brightblue
11+
BOOLEAN brightblack
12+
NULL cyan
13+
NUMBER blue
14+
VARIABLE brightyellow
15+
PACKAGE green,faint
16+
CLASS green
17+
CONSTANT yellow
18+
OPERATOR yellow
19+
COMMAND green
20+
OPTION yellow
21+
KEYWORD brightblack
22+
JUMP cyan
23+
SECTION green
24+
ATTRIBUTE green
25+
PATH brightblue
26+
EXECUTABLE green
27+
LINK cyan
28+
TITLE brightblue
29+
ESCAPE black,cyan
30+
DEBUG brightmagenta
31+
ERROR red
32+
TODO brightwhite,cyan
33+
WARNING ,lightred
34+
WHITESPACE ,lightgreen
35+
HEADER bold,!blue,~grey70,underline
36+
ROW_NUMBER bold,!blue,~grey70
37+
ROW_STYLE ,~grey82
38+
LIST_BACKGROUND ,~grey70
39+
LIST_GROUP yellow
40+
#
41+
# mixin
42+
#
43+
+FUNCTION FUNCTION: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" \n PLAIN: "[(]"
44+
+LINT WHITESPACE: "[[:space:]]+$" \n WARNING: "\t*"
45+
+LONG_LINE_WARNING WARNING: "^.{81,}$"
46+
#
47+
# parser
48+
#
49+
$LINE_COMMENT COMMENT \n TODO: "FIXME|TODO|XXX"
50+
$BLOCK_COMMENT COMMENT \n DOC_COMMENT: startWith=/** \n TODO: "FIXME|TODO|XXX"
51+
$BALANCED_DELIMITERS STRING \n VARIABLE: continueAs=\s*:

0 commit comments

Comments
 (0)