Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/java/dev/jbang/cli/Edit.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.nio.charset.Charset;
import java.nio.file.*;
import java.util.*;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -379,7 +380,15 @@ private static void setupEditor(Path editorBinPath, Path dataPath) throws IOExce
}

private static List<String> findEditorsOnPath() {
return Arrays.stream(knownEditors).filter(e -> Util.searchPath(e) != null).collect(Collectors.toList());
return Arrays.stream(knownEditors)
.map(e -> {
Path found = Util.searchPath(e);
if (found == null)
return null;
return Util.isWindows() ? found.toString() : e;
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
}

private static void showStartingMsg(String ed, boolean showConfig) {
Expand Down
Loading