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

Conversation

Projects
None yet
2 participants
@tarruda
Member

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

input: Fix conversion error in `convert_input()`
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 from [RFC] input/job: process ctrl+c and do conversion in the read callback to [RFC] Fixes to input/job modules Oct 30, 2014

input/job: process ctrl+c and do conversion in the read callback
- 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 tarruda:patch-427-workaround branch 3 times, most recently from 2e8e7a8 to 4d9cc0a Oct 30, 2014

tarruda added some commits Oct 30, 2014

input: Fix sizes of input/read buffers
Input buffer must be bigger than read buffer to ensure it always has space for
converted data.
api: Add vim_input function and mark vim_feedkeys as deferred
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 force-pushed the tarruda:patch-427-workaround branch from 4d9cc0a to 9e41dd0 Oct 30, 2014

@tarruda tarruda merged commit 9e41dd0 into neovim:master Oct 30, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

tarruda added a commit that referenced this pull request Oct 30, 2014

splinterofchaos added 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