luakit / luakit/luakit

Editor module calls callback immediately when using forking editor commands

Open
#718 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
2.3k
Forks
254
PR merge metrics
No merged PRs in 30d

Description

I was trying to check out this new feature of autoreloading styles while editing, but it didn't work.
I've managed to figure out, that the editor callback returns immediately and disables the watcher.
So i've set editor command to launch `vim` in a terminal instead of default, which opened gedit, but the thing is - Ubuntu's `x-terminal-emulator` also launches itself separately and the command exits (and there is no command switch for that), so the callback is called.
Also i've rediscovered the open_editor feature (which i was checking long ago, it didn't work and i forgot about it), and it is not working for this same reason.

Update: so i found out that `gedit` does not fork by itself, it was `xdg-open` (so this issue has a wider range, i guess).
And when you save, styles reload, but with old version of the file. For example, you change color from blue to red, and then from red to orage, each time saving the file, but when you've saved the change from red to orange, visible style changes from blue to red, so you have to save again for it to trigger.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the editor module and its open_editor callback, then trace how the watcher decides that an editor command has finished. Reproduce the behavior with a forking command and save successive style changes; done should wait for the actual editing session and reload the latest saved file.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, vim
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.