Comfort0
is a useful plugin for fast editing of OSM features, where you edit a text file in the Level0L format. The issue was that I didn’t have any of the default text editors installed, so I tried to use neovim
-based GUIs: Neovide
or VimR
. Both can be brew install
‘ed and have CLI launchers, but neither one worked. JOSM showed a popup saying Launching editor on file /tmp/…/josm_level0_….txt
, the editor was indeed launched, but always showed an empty file (ls
confirmed that). So in cases when I needed to have manual, controlled mass-edits, I used to copy the Level0L code (there is a menu item for that), paste it into vim
, use macros to edit the information, copy that and paste as Level0L code into JOSM. This worked fine, even if it was clunky. I decided to debug the issue.
I followed the Developing Plugins guide and was able to build JOSM core and the comfort0
plugin. The next step was to debug it; I tried doing that in IntelliJ Idea CE, but couldn’t figure it out, so I had to install Eclipse (brew install eclipse-java
) and surprisingly I was able to make it work there with the guide (eventually)! There are still 24 errors displayed in the project (such as BasicPreferences cannot be resolved to a type
), but debugging works.
What I saw in the logs was Comfort0: Editing of file … done
immediately after showing the notification above. This happens after editor.waitFor()
, then the file is read and deleted. Very strange. waitFor
should wait for a process to exit, which makes sense, but is it broken?! editor
comes from EditorLauncher.launch()
.
Then I’ve noticed that the default list of editors contains entries like gedit --standalone --wait
and kate --new --block
— note the --wait
and --block
arguments! I tested the neovide
command in the terminal and indeed, it launched the GUI… and also didn’t wait for it to exit. So that’s the issue! neovide -h
and vimr -h
helped with the correct arguments for each command, so I added /usr/local/bin/neovide --no-fork
and /usr/local/bin/vimr --wait
to the comfort0.editor
JOSM setting and the plugin works great now!