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

[RFC] Fixes to input/job modules #1357

Merged
merged 4 commits into from
Oct 30, 2014
Merged

Conversation

tarruda
Copy link
Member

@tarruda tarruda commented Oct 29, 2014

  • Extract process_interrupts out of convert_input
  • Instead of waiting for os_breakcheck/os_inchar calls, call convert_input
    and process_interrupts directly from the read callback in input.c.
  • Remove the settmode calls from job_wait. Now that interrupts are
    processed in the event loop, there's no need to set the terminal to cooked
    which introduces other problems(ref 7.4.427)

This is also good because it will simplify handling ctrl+c in the middle of server->client msgpack-rpc calls

tarruda referenced this pull request in tarruda/neovim Oct 30, 2014
The `rbuffer_consumed` was being passed a consumed count from another buffer,
causing integer overflow in `rbuffer_relocate`.

Fixes neovim#1343
@tarruda tarruda changed the title [RFC] input/job: process ctrl+c and do conversion in the read callback [RFC] Fixes to input/job modules Oct 30, 2014
- Extract `process_interrupts` out of `convert_input`
- Instead of waiting for os_breakcheck/os_inchar calls, call `convert_input`
  and `process_interrupts` directly from the read callback in input.c.
- Remove the `settmode` calls from `job_wait`. Now that interrupts are
  processed in the event loop, there's no need to set the terminal to cooked
  which introduces other problems(ref 7.4.427)
@tarruda tarruda force-pushed the patch-427-workaround branch 3 times, most recently from 2e8e7a8 to 4d9cc0a Compare October 30, 2014 02:28
Input buffer must be bigger than read buffer to ensure it always has space for
converted data.
The `vim_feedkeys` must be deferred because it can potentially free the buffer
passed to `os_inchar`(which in turns calls `vim_feedkeys` indirectly).

The new `vim_input` function can be used to emulate user input(Since it does not
mess with the typeahead, it is safe to execute without deferring).
@tarruda tarruda merged commit 9e41dd0 into neovim:master Oct 30, 2014
tarruda added a commit that referenced this pull request Oct 30, 2014
splinterofchaos pushed a commit to splinterofchaos/neovim that referenced this pull request Oct 30, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants