ttscoff/doing

Editor switch (-e, --editor) not adding note when BBEdit is set as EDITOR

jafish opened this issue · 2 comments

Describe the bug

When using BBEdit as my editor, the -e or --editor switch exits the command before allowing bbedit to write to the temporary file, leaving any notes unrecorded.

To Reproduce

Steps to reproduce the behavior:

  1. Install BBEdit and command line tools
  2. Set "bbedit" as default editor in doing config file.
  3. Run doing note -e, and see that it opens a temporary file properly in BBEdit
  4. Add a note in BBEdit and save the file
  5. Return to the command line, run doing and see that the note hasn't been added to the doing file

Results of GLI_DEBUG=true DOING_DEBUG=true doing note -e:

 Config: Local config files found:
 Config: translated key path paginate to paginate
 Config: translated key path disabled_commands to disabled_commands
 Config: translated key path editors to editors
 Editor: Using bbedit from config 'editors.default' for default
 Config: translated key path search.case to search.case
 Config: translated key path tag_sort to tag_sort
 Editor: Using bbedit from config 'editors.config' for config
 Config: translated key path editors.config to editors.config
 Editor: Using taskpaper from config 'editors.doing_file' for doing_file
 Config: translated key path current_section to current_section
 Config: translated key path plugins.command_path to plugins.command_path
 Config: translated key path doing_file to doing_file
 Read: read file /Users/jafish/Library/Mobile Documents/com~apple~CloudDocs/NVNotes/taskx-Main.taskpaper
 Filtered: Parameters matched 20 entries
 Skipped: No note change
 Config: translated key path doing_file_sort to doing_file_sort
 Config: translated key path backup_dir to backup_dir
 Config: translated key path history_size to history_size
 Write: File written: /Users/jafish/Library/Mobile Documents/com~apple~CloudDocs/NVNotes/taskx-Main.taskpaper` 

Expected behavior

I would expect doing to wait for the temporary file to be saved in BBEdit and include the added note in the doing file for that entry.

Desktop (please complete the following information):

  • Platform: Mac
  • OS: Monterey
  • Version 12.3.1

Doing version

doing version 2.1.47

Ruby version

ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

Additional context

Adding a note works when I leave the default editor blank and the system VIM is used instead.

It does! And when I change the config thusly:

editors:
  default: "bbedit -w"

...adding a note works as expected. Thanks for the quick response, and sorry for reporting this as a doing bug when it was user misunderstanding.