1075 String n; |
1075 String n; |
1076 while ((n = at.next()) != null) { |
1076 while ((n = at.next()) != null) { |
1077 ed.add(n); |
1077 ed.add(n); |
1078 } |
1078 } |
1079 editor = ed.toArray(new String[ed.size()]); |
1079 editor = ed.toArray(new String[ed.size()]); |
1080 fluffmsg("jshell.msg.set.editor.set", arg); |
1080 fluffmsg("jshell.msg.set.editor.set", prog); |
1081 return true; |
1081 return true; |
1082 } |
1082 } |
1083 } |
1083 } |
1084 case "start": { |
1084 case "start": { |
1085 String init = readFile(at.next(), "'/set start'"); |
1085 String init = readFile(at.next(), "/set start"); |
1086 if (init == null) { |
1086 if (init == null) { |
1087 return false; |
1087 return false; |
1088 } else { |
1088 } else { |
1089 prefs.put(STARTUP_KEY, init); |
1089 prefs.put(STARTUP_KEY, init); |
1090 return true; |
1090 return true; |
1349 } |
1349 } |
1350 List<Snippet> snippets = stream |
1350 List<Snippet> snippets = stream |
1351 .filter(sn -> state.status(sn).isActive && sn instanceof PersistentSnippet) |
1351 .filter(sn -> state.status(sn).isActive && sn instanceof PersistentSnippet) |
1352 .collect(toList()); |
1352 .collect(toList()); |
1353 if (snippets.isEmpty()) { |
1353 if (snippets.isEmpty()) { |
1354 errormsg("jshell.err.drop.active"); |
1354 errormsg("jshell.err.drop.not.active"); |
1355 return false; |
1355 return false; |
1356 } |
1356 } |
1357 if (snippets.size() > 1) { |
1357 if (snippets.size() > 1) { |
1358 errormsg("jshell.err.drop.ambiguous"); |
1358 errormsg("jshell.err.drop.ambiguous"); |
1359 fluffmsg("jshell.msg.use.one.of", snippets.stream() |
1359 fluffmsg("jshell.msg.use.one.of", snippets.stream() |
1531 byte[] encoded = Files.readAllBytes(Paths.get(filename)); |
1531 byte[] encoded = Files.readAllBytes(Paths.get(filename)); |
1532 return new String(encoded); |
1532 return new String(encoded); |
1533 } catch (AccessDeniedException e) { |
1533 } catch (AccessDeniedException e) { |
1534 errormsg("jshell.err.file.not.accessible", context, filename, e.getMessage()); |
1534 errormsg("jshell.err.file.not.accessible", context, filename, e.getMessage()); |
1535 } catch (NoSuchFileException e) { |
1535 } catch (NoSuchFileException e) { |
1536 errormsg("jshell.err.file.not.found", context, filename, e.getMessage()); |
1536 errormsg("jshell.err.file.not.found", context, filename); |
1537 } catch (Exception e) { |
1537 } catch (Exception e) { |
1538 errormsg("jshell.err.file.exception", context, filename, e); |
1538 errormsg("jshell.err.file.exception", context, filename, e); |
1539 } |
1539 } |
1540 } else { |
1540 } else { |
1541 errormsg("jshell.err.file.filename", context); |
1541 errormsg("jshell.err.file.filename", context); |