aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
Commit message (Collapse)AuthorAge
...
| * Fix unused variable in wstream.c for a release build.John Szakmeister2015-03-14
| |
* | main: Simplify code that deals with early user inputThiago de Arruda2015-03-18
| | | | | | | | | | | | | | | | | | A read stream will be started before the first ex command is processed. This stream will be used to read early user input before handling control over to the UI module. Which stdio stream will be used depends on which types of file descriptors are connected, and whether the "-" argument was passed.
* | ui: Refactor so that busy state won't be the defaultThiago de Arruda2015-03-18
| | | | | | | | | | | | | | | | | | | | | | Even though assuming nvim is busy most times is simpler, it has a problem: A lot of unnecessary busy_start/busy_stop notifications are sent to the UI. That's because in the majority of scenarios almost no time is spent between `event_poll` calls. This restores the normal behavior which is to call busy_start only when nvim is going to perform some task that can take a significant amount of time. Also improve the usage of buffering in the TUI when changing the cursor state.
* | ui: Replace cursor_{on,off} by busy_{stop,start}Thiago de Arruda2015-03-15
|/ | | | | | | | | | | | | | | | | | | | | | | | Switching cursor off is only necessary in two occasions: - When redrawing to avoid terminal flickering - When the editor is busy The first can now be handled by the TUI, so most calls to ui_cursor_off can be removed from the core. So, before this commit it was only necessary to switch the cursor off to notify the user that nvim was running some long operation. Now the cursor_{on,off} functions have been replaced by busy_{stop,start} which can be handled in a UI-specific way(turning the cursor off or showing a busy indicator, for example). To make things even more simpler, nvim is always busy except when waiting for user input or other asynchronous events: It automatically switches to a non-busy state when the event loop is about to be entered for more than 100 milliseconds. `ui_busy_start` can be called when its not desired to change the busy state in the event loop (As its now done by functions that perform blocking shell invocations).
* Merge pull request #2114 from oni-link/remove.assertJohn Szakmeister2015-03-12
|\ | | | | Fixes for two compiler warnings
| * Remove unnecessary assert() in os_dirname().oni-link2015-03-08
| | | | | | | | | | | | | | | | | | Compiler warns about buf always being nonnull. buf is per function attribute always nonnull, so buf can be removed from the assert(). But a buffer length of zero is also no problem, because it makes uv_cwd() return a failure without writing into buf. So the remaining length check can also be removed.
* | os_unix_defs && os/unix_defs: Consistently use '~' over '$HOME' #2009Michael Reed2015-03-11
|/ | | | | | these path names are ridiculous... Based on #889, but also remove some unused #defines
* illumos requires the use of limits.h for things like INT_MAX #2049Mike Zeller2015-02-26
|
* job: Allow spawning jobs connected to pseudo terminalsThiago de Arruda2015-02-23
|
* job: Refactor process spawning and startup argumentsThiago de Arruda2015-02-23
| | | | | | | | - process spawning was decoupled from the rest of the job control logic. The goal is reusing it for spawning processes connected to pseudo terminal file descriptors. - job_start now receives a JobOptions structure containing all the startup options.
* job: Send SIGTERM before calling job_stop in job_teardownThiago de Arruda2015-02-23
| | | | | Send sigterm immediately since it can be caught by processes. If they don't respond and are still alive after a while, SIGKILL will be sent.
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* input: Escape utf8 sequences that contain CSI/K_SPECIALThiago de Arruda2015-02-18
|
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
* input: Remove input_buffer_{save,restore}Thiago de Arruda2015-02-16
| | | | | | | The input buffer is only used for data that really came from another process and is only visible to os/input.c. Remove the input_buffer_{save,restore} functions, they are not necessary(Also can result in problems if data comes while the typeahead is saved).
* input: Fix handle_mouse_event functionThiago de Arruda2015-02-16
| | | | Ignore all keys that aren't prefixed with KS_EXTRA.
* input: Prefer keycodes in input_enqueue key translationThiago de Arruda2015-02-16
| | | | This is required to correctly handle certain keys such as <delete>
* coverity/{68484,68485}: Read from pointer after free: RI.Thiago de Arruda2015-02-11
| | | | | | | | | Problem : Read from pointer after free @ {242, 391}. Diagnostic : Real issues. Rationale : Channel gets indeed freed on error case, producing incorrect accesses to freed pointer later on. Resolution : Implement reference counting mechanism to know when to free channel.
* Remove long_u: Remove type.Eliseo Martínez2015-01-19
|
* Merge pull request #1798 from oni-link/fix.job.waitJustin M. Keyes2015-01-18
|\ | | | | job.c: Prevent early return from job_wait().
| * job.c: Prevent early return from job_wait().oni-link2015-01-11
| | | | | | | | | | | | | | | | | | | | A blocking call job_wait(job, -1) can only return after job is finished and all handles of job are closed. But hitting CTRL-C makes job_wait() return early while handles can still be open. This can lead to problems with the job/handle callbacks if the caller (of job_wait()) already freed the memory that is used in the job callbacks. To fix this, only return after all handles of the job are closed.
* | input: Fix check for mouse coordinatesThiago de Arruda2015-01-15
| | | | | | | | Must check for EOF which will result in row/col being uninitialized.
* | input: Read row/col position when processing mouse wheelThiago de Arruda2015-01-14
| |
* | shell: When executing command, use screen functions to display outputThiago de Arruda2015-01-13
| | | | | | | | | | By calling ui_write directly, the internal screen isn't updated and invalid bytes aren't handled, which breaks the abstract UI model.
* | input: Ignore invalid "<" key sequencesThiago de Arruda2015-01-13
| | | | | | | | | | Ignoring invalid key sequences simplifies input handling in UIs. The only downside is having to use "<lt>" everytime a "<" is needed on functional tests.
* | Linting: Recommend os_* instead of POSIX functions.Florian Walch2015-01-11
|/
* Remove long_u: term: Enable -Wconversion.Eliseo Martínez2015-01-10
|
* Merge pull request #1684 from justinmk/coverity74717Justin M. Keyes2014-12-26
|\ | | | | [RFC] coverity/74717: FP: NULL Pointer Dereference
| * coverity/74717: FP: NULL Pointer DereferenceJustin M. Keyes2014-12-23
| | | | | | | | | | dynamic_buffer_ensure() allocates buf->data; add an assert to make this clear to coverity.
* | Linting: Suppress warnings in os/users.c.Florian Walch2014-12-24
| |
* | Linting: Fix strcpy warning.Florian Walch2014-12-24
| |
* | Linting: Fix header guards, add whitespace.Florian Walch2014-12-24
|/
* coverity/74718: invalid FUNC_ATTR_NONNULL_ARGJustin M. Keyes2014-12-20
| | | | | | | - avoid null passed to ELOG format string - receive (char *) internally - modify identifier names for consistency - edit comments for concision and consistency
* input: Recognize mouse events for abstract_uiThiago de Arruda2014-12-10
|
* ui: Add abstract_ui termcap and split UI layerThiago de Arruda2014-12-08
| | | | | | | | | | | | | | | | | | This is how Nvim behaves when the "abstract_ui" termcap is activated: - No data is written/read to stdout/stdin by default. - Instead of sending data to stdout, ui_write will parse the termcap codes and invoke dispatch functions in the ui.c module. - The dispatch functions will forward the calls to all attached UI instances(each UI instance is an implementation of the UI layer and is registered with ui_attach). - Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by input_enqueue and the translated strings are pushed to the input buffer. With this new input model, its not possible to send mouse events yet. Thats because mouse sequence parsing happens in term.c/check_termcodes which must return early when "abstract_ui" is activated.
* shell: Fix shell command outputThiago de Arruda2014-12-06
| | | | | | | | | Shell command output was broken in @8a5a8db, which refactored nvim to no longer switch to cooked mode(linefeeds are processed differently). Fix the problem by refactoring write_output to accept to extra arguments that control the flushing behavior and where data will be written to: buffer or directly to the screen.
* shell: Remove kShellOptCooked from ShellOptsThiago de Arruda2014-12-03
|
* time: Inline microdelay into os_microdelayThiago de Arruda2014-12-03
|
* term: Remove most calls to settmodeThiago de Arruda2014-12-02
| | | | | | Nvim now relies much less on setting terminal mode to cooked mode, remove most calls to settmode, except for those that happen on startup or when suspending. Eventually even those will be handled by the UI layer.
* Merge pull request #1497 from splinterofchaos/const-attrJustin M. Keyes2014-11-29
|\ | | | | constify and func-attribute memory.c and strings.c
| * strings: Enable -Wconvert.Scott Prager2014-11-27
| |
* | ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | | | | | Also move read_error_exit to os/input.c
* | ui: Remove ui_inchar/ui_char_availThiago de Arruda2014-11-27
|/ | | | | | | | | Also: - Remove NO_CONSOLE_INPUT/NO_CONSULE preprocessor conditionals - Remove ctrl_c_interrupts variable, check for mapped_ctrl_c directly in process_interrupts() - Move ui_inchar profiling to input_poll which is where Nvim blocks for input.
* event: No longer process K_EVENT automaticallyThiago de Arruda2014-11-21
| | | | | | | Two new functions, `event_enable_deferred()`/`event_disable_deferred()` have to be called by code that is capable of handling asynchronicity. User-dialog states like "press ENTER to continue" or the swap file confirmation no longer will generate K_EVENT.
* input: Refactor to ensure user input has higher priorityThiago de Arruda2014-11-21
|
* Remove os/provider.{c,h} and all of its referencesThiago de Arruda2014-11-18
|
* shell: Use job_write_cb for closing stdinThiago de Arruda2014-11-10
| | | | | | | | | | Commit @45525853d352 removed usage of the `job_write_cb` for closing stdin due to a memory error, but that doesn't work anymore because `job_close_in` closes stdin immediately, possibly trimming input data before it is fully written. Since most memory issues with jobs have been fixed, re-add the `job_write_cb` call to ensure stdin is only closed when it should. Also add tests for scenarios where using the callback makes a difference.
* Try to fix problem found in the Travis Ci build.oni-link2014-11-09
| | | | | | | An uv_pipe_t handle for a WStream could be left open for a particular code path. Patch by tarruda.
* Mark some function arguments as [consumed] in the docs.oni-link2014-11-09
| | | | | The argument argv of job_start() and channel_from_job() will be freed. Mark them as such in the comments of this functions.
* job: Fix memory leak in job_start().oni-link2014-11-09
| | | | | If a new job cannot be started because no slots are free, we return early without freeing the argv argument.