4

I was recently trying to use non-default editors (such as atom or sublime) with the /edit command in JShell. To do that, I set the editor with the following command:

/set editor -wait atom

As the documentation states, when I type the /edit command JShell creates a temporary file opened by the editor of my choice. The code that is saved in the file gets evaluated by JShell. However I cannot make it evaluate the changes immediately after i hit save. They are being evaluated in the shell after a few seconds after saving in the editor.

Is there any way to have them evaluated immediately, the same as by hitting "Accept" in the EditPad (the default editor)?

Naman
  • 27,789
  • 26
  • 218
  • 353
gajos
  • 897
  • 2
  • 10
  • 21
  • I never tried that feature so this is just a hunch, but may it be Atom in particular that is creating the delay? Maybe try a simpler text editor first? – Nicolai Parlog Apr 16 '17 at 13:52
  • 1
    Ok, I tried vim, nano, TextEdit (the default mac text editor) and Sublime. Generally, I wanted to have separate window for editing. Atom, Sublime and TextEdit are the tools that work this way. They all have the delay I want to avoid. Also editing the temporary file in vim or nano opened in separate console window has the delay. I'm guessing that it's the way that the `-wait` mode works - it looks like it's polling the changes in the file periodically (looks like there is no other way). Sadly, I wasn't able to have the changes evaluated without the `-wait` option in atom, sublime or TextEdit. – gajos Apr 16 '17 at 19:50

0 Answers0