Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[diff view] Cannot [hhh]unk in a meaningful speed #1104

Closed
kaste opened this issue Feb 14, 2019 · 0 comments
Closed

[diff view] Cannot [hhh]unk in a meaningful speed #1104

kaste opened this issue Feb 14, 2019 · 0 comments

Comments

@kaste
Copy link
Collaborator

kaste commented Feb 14, 2019

If you hit 'hhh' to hunk 3 hunks in a row fast, you likely get a 'cannot apply patch' error from git.

Basically, view and state are out of sync here. Typically 'hunking' must be blocking on the main thread. Or: 'hunking' must update the view optimistically. Since the latter is almost impossible to do right, we should use the 'blocking' strategy.

kaste added a commit to kaste/GitSavvy that referenced this issue Feb 14, 2019
We must ensure that hitting 'h' very fast does run completely ordered, and
always waits for 'gs_diff_refresh' to complete. ('gs_diff_refresh' updates our
model.)

Please NOTE that running a command from the worker will still run that command
on the main thread. T.i. `set_timeout_async(lambda: view.run_command("refresh"))`
is misleading and a footgun because the "refresh" command here will still start
on the main thread. We basically just await the worker and then put a
task/command on the main worker queue.

Fixes timbrel#1104
stoivo pushed a commit that referenced this issue Sep 11, 2019
We must ensure that hitting 'h' very fast does run completely ordered, and
always waits for 'gs_diff_refresh' to complete. ('gs_diff_refresh' updates our
model.)

Please NOTE that running a command from the worker will still run that command
on the main thread. T.i. `set_timeout_async(lambda: view.run_command("refresh"))`
is misleading and a footgun because the "refresh" command here will still start
on the main thread. We basically just await the worker and then put a
task/command on the main worker queue.

Fixes #1104
@stoivo stoivo closed this as completed in da4a47c Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant