Skip to content

Commit

Permalink
changed identation on try with resources
Browse files Browse the repository at this point in the history
  • Loading branch information
SAFELAYER\carles.guell committed Jan 23, 2019
1 parent efa961d commit 804959e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions builtins/src/main/java/org/jline/builtins/Completers.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,22 +303,22 @@ public void complete(LineReader reader, ParsedLine commandLine, final List<Candi
curBuf = "";
current = getUserDir();
}
try (DirectoryStream<Path> directory = Files.newDirectoryStream(current, this::accept)) {
directory.forEach(p -> {
String value = curBuf + p.getFileName().toString();
if (Files.isDirectory(p)) {
candidates.add(
new Candidate(value + (reader.isSet(LineReader.Option.AUTO_PARAM_SLASH) ? sep : ""),
getDisplay(reader.getTerminal(), p), null, null,
reader.isSet(LineReader.Option.AUTO_REMOVE_SLASH) ? sep : null, null, false));
} else {
candidates.add(new Candidate(value, getDisplay(reader.getTerminal(), p), null, null, null, null,
true));
}
});
} catch (IOException e) {
// Ignore
}
try (DirectoryStream<Path> directory = Files.newDirectoryStream(current, this::accept)) {
directory.forEach(p -> {
String value = curBuf + p.getFileName().toString();
if (Files.isDirectory(p)) {
candidates.add(
new Candidate(value + (reader.isSet(LineReader.Option.AUTO_PARAM_SLASH) ? sep : ""),
getDisplay(reader.getTerminal(), p), null, null,
reader.isSet(LineReader.Option.AUTO_REMOVE_SLASH) ? sep : null, null, false));
} else {
candidates.add(new Candidate(value, getDisplay(reader.getTerminal(), p), null, null, null, null,
true));
}
});
} catch (IOException e) {
// Ignore
}
}

protected boolean accept(Path path) {
Expand Down

0 comments on commit 804959e

Please sign in to comment.