| Commit message (Collapse) | Author | Age |
... | |
| | |
|
|/
|
|
| |
Make sure feature pointer is not null before dereferencing.
|
| |
|
|
|
|
|
|
|
|
|
| |
* With the changes in commit
"events: Refactor how event deferral is handled"
(2e4ea29d2c7b62eb8baf1c41cd43433e085dda0) the function argument
'defer' of 'job_start' and member variable 'defer' of 'struct job'
can be removed.
* Update/Fix the documentation for function 'job_start'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not necessary, as discussed in #980.
From the libuv mailing list:
https://groups.google.com/forum/#!topic/libuv/OD38PeGeVgQ
E.g. this could happen (red: on Windows):
> > alloc_cb(handle1);
> > alloc_cb(handle2);
> > read_cb(handle1);
> > read_cb(handle2);
But this couldn't:
> > alloc_cb(handle1);
> > alloc_cb(handle1);
> > read_cb(handle1);
> > read_cb(handle1);
Because each stream has a 1-to-1 correspondance with a libuv handle. The
code removed was never executed.
Closes #980.
|
|
|
|
|
|
|
|
|
| |
It used to be 1024 bytes, which is very tiny and slows down some operations
(imaging `cat`-ing a large file). Benchmarks show a large speedup for such
cases. ref #978.
For modern systems 0xFFFF bytes (65535 B = 64 KB = 0.0625 MB) per job
shouldn't be a big problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the goal to support pipe-only system() calls.
Notes on the second (vim) argument to f_system() (i.e.: redirected input)
and its implications:
- When calling system('cat -', ['some', 'list']), vanilla vim (before a
recent patch that added support for passing lists) just passes an empty
file to the process. This is the same as immediately closing the pipe,
which os_system does when no input is given. If we wouldn't close the
pipe, the process will linger forever (as is the case with `cat -`).
As of now, it's not allowed to pass a non-NULL pointer as the `output`
parameter. In other words, it's not possible to signal disinterst in the
process output. That may change in the future.
|
|
|
|
|
|
| |
- One can now manually close the in-pipe, without having to tear down the
job.
- One can be notified of write success/failure.
|
|
|
|
|
| |
Sometimes a wbuffer is not supposed to be free()'d (such as when it comes
from a constant (possibly static) string, for example.
|
|
|
|
| |
Now modules using the wstream can find out what's happening to their writes.
|
|
|
|
| |
Used to wait synchronously for a job to end.
|
|
|
|
| |
Minor fixes
|
|
|
|
|
| |
Free the data memory of process and pipe handles in the close callback
for a job.
|
|
|
|
|
| |
If no channel can be found for a method, free argument arg before
returning.
|
|
|
|
|
|
| |
- it makes no sense for these functions to take NULL pointers
- if `localtime()` on Windows returns a NULL pointer, the old code would try
to dereference it.
|
|
|
|
|
|
| |
gettimeofday() doesn't exist on Windows, as reported by @equalsraf. It seems
a call to time() would be sufficient here, as only the seconds since the
UNIX epoch are needed.
|
|
|
|
| |
Include what you use, also in the positive direction.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove all *_set_defer methods and the 'defer' flag from rstream/jobs
- Added {signal,rstream,job}_event_source functions. Each return a pointer that
represent the event source for the object in question(For signals, a static
pointer is returned)
- Added a 'source' field to the Event struct, which is set to the appropriate
value by the code that created the event.
- Added a 'sources' parameter to `event_poll`. It should point to a
NULL-terminated array of event sources that will be used to decide which
events should be processed immediately
- Added a 'source_override' parameter to `rstream_new`. This was required to use
jobs as event sources of RStream instances(When "focusing" on a job, for
example).
- Extracted `process_from` static function from `event_process`.
- Remove 'defer' parameter from `event_process`, which now operates only on
deferred events.
- Refactor `channel_send_call` to use the new lock mechanism
What changed in a single sentence: Code that calls `event_poll` have to specify
which event sources should NOT be deferred. This change was necessary for a
number of reasons:
- To fix a bug where due to race conditions, a client request
could end in the deferred queue in the middle of a `channel_send_call`
invocation, resulting in a deadlock since the client process would never
receive a response, and channel_send_call would never return because
the client would still be waiting for the response.
- To handle "event locking" correctly in recursive `channel_send_call`
invocations when the frames are waiting for responses from different
clients. Not much of an issue now since there's only a python client, but
could break things later.
- To simplify the process of implementing synchronous functions that depend on
asynchronous events.
|
|
|
|
|
|
| |
Also changed the default log level to INFO so developers won't end up with big
log files without asking explicitly(DLOG statements were placed in really "hot"
code)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reimplements the '+'/'*' clipboard registers(both are aliases to the same
register, no dedicated storage for the X11 selection) on top of the provider
infrastructure.
This adds two new 'unnamedclip' option, has the same effect of setting
'clipboard' to 'unnamed/unnamedplus' in vim
The 'clipboard' option was not reused because all values(except 'unnamedplus')
seem to be useless for Neovim, and the code to parse the option was relatively
big. The option remains for vim compatibility but it's silently ignored.
|
|
|
|
|
|
|
|
| |
This uses the provider/scripting infrastructure to reintroduce python support
through the msgpack-rpc API.
A new 'initpython' option was added, and it must be set to a command that will
bootstrap the python provider the first time it's needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introducing the concept of providers: co-processes that talk with the editor
through the remote API and provide implementation for one or more core
services.
The `provider_register` function and it's API wrapper can be used by channels
that want to self-register as a service provider.
Some old builtin vim features will be re-implemented as providers. The
`provider_has_feature` function is used to check if a provider
implementing a certain feature is available(It will be called by the `has`
vimscript function to check for features in a vim-compatible way)
This implements the provider module without exposing any extension points, which
will be done in future commits.
|
|
|
|
|
|
|
|
|
|
| |
- All functions that require a channel id will fail when the channel was
disabled
- Rewrite `call_stack_unwind` as `call_set_error`. It will now disable the
channel and set error on all frames. The stack will be unwinded automatically
while the involved functions exit.
- Remove `disable_channel` function. If channels are disabled, they will be
closed as soon as possible
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This is required to handle broadcasting when the first write fails.
Ref: https://github.com/tarruda/neovim/commit/11916b6b595421ce2ece10f7aa40757cc4937c0c#commitcomment-6792287
|
| |
|
|
|
|
| |
Just an alias to uv_hrtime. Provides a high-resolution timer.
|
| |
|
|
|
|
|
|
|
| |
Though this module is relatively small it has very clear boundaries.
The last argument for extracting `tempfile` was the errors which I got
when I was writing unittests for it: `cimport './src/nvim/fileio.h'`
does not work for some reason.
|
|
|
|
|
|
|
|
|
| |
- temp_count is uint32_t now instead of long because it supposed to be
at most 999999999 (comment on line 5227) temporary files. The most
probably it was a long for compatibility with systems where int is
16-bit.
- Use "nvim" as prefix for temp folder name instead of "v"
- Remove unused parameter from vim_tempname
|
|
|
|
|
|
|
|
| |
Vim does not define TEMPDIRNAMES for all systems, but it is defined for
all systems supported by Neovim.
Temporary directory names for Windows was obtained from GetTempPath()
function documentation at MSDN.
Additionally small renamings were performed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`-Wstrict-prototypes` warn if a function is declared or defined without
specifying the argument types.
This warning disallow function prototypes with empty parameter list.
In C, a function declared with an empty parameter list accepts an
arbitrary number of arguments when being called. This is for historic
reasons; originally, C functions didn't have prototypes, as C evolved
from B, a typeless language. When prototypes were added, the original
typeless declarations were left in the language for backwards
compatibility.
Instead we should provide `void` in argument list to state
that function doesn't have arguments.
Also this warning disallow declaring type of the parameters after the
parentheses because Neovim header generator produce no declarations for
old-stlyle prototypes: it expects to find `{` after prototype.
|
| |
|
|
|
|
|
|
|
|
|
| |
- use return value instead of open_req.result
- libuv uv_fs_open() returns `-errno` instead of always -1
- libuv always sets open_req.result to the return value, _except_ for OOM
where it only sets the return value. So always use the return value.
- replace calls to mch_open macro.
- update call sites expecting -1 error
|
|
|
|
|
| |
- add documentation about port being optional
- parse port into long and check for valid value
|
|
|
|
|
|
|
| |
- remove unused errno
- remove unused port_end
- correct calculation of addr_len
- use correct string length during IP copy
|
| |
|
|
|
|
|
|
|
| |
Done by manual inspecting of the output of this script:
grep -r -l -w "bool" * | grep 'c$' | sed 's/.c$//' > has_bool
grep -r -l -w "stdbool.h" * | grep 'h$' | sed 's/.h$//' > has_include
grep -F -x -v -f has_include has_bool
|
|
|
|
|
|
|
| |
Done by manual inspection of the output of this script:
grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool
grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include
grep -F -x -v -f has_bool has_include
|
|
|
|
|
|
|
| |
Done by manual inspection of the output of this script:
grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool
grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include
grep -F -x -v -f has_include has_bool
|
|
|
|
|
| |
Replace usage of deprecated S_IEXEC with S_IXUSR.
Rename a variable named "errno" to avoid clashing with define.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This simplifies the generated msgpack_rpc_dispatch() function, separates the
code for each RPC method more clearly and allows easy implementation of
alternative dispatching methods (e.g. string method id dispatch).
|
|
|
|
|
|
|
|
|
| |
This macro is used to append an element to a growable array. It replaces this
common idiom:
ga_grow(&ga, 1);
((item_type *)ga.ga_data)[ga.ga_len] = item;
++ga.ga_len;
|