| Commit message (Collapse) | Author | Age |
... | |
| |
| |
| |
| | |
The upcoming decoupling of vim.h and globals.h needs this to compile.
|
| |
| |
| |
| |
| |
| | |
Reuse the profiling functions to implement the startuptime functions.
Decreases our dependency on `gettimeofday()` and thus gets us a little bit
closer to a clean port to Windows.
|
|/
|
|
|
| |
It's a better place to put it. Also slightly documented and reformatted, but
not changed.
|
| |
|
|
|
|
| |
As discussed here: https://github.com/neovim/neovim/pull/941/files#r15026398
|
|\ |
|
| |
| |
| |
| | |
This is required to run some tests of the python client
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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)
|
| |
| |
| |
| |
| | |
The `inchar` function could enter an infinite loop if there are events pending
to be processed when an interrupt is received.
|
| |
| |
| |
| |
| | |
This is for compatibility with python-vim interface: When passing an end index
with a value higher than the last index, assume the `include_end` flag
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
This uses the provider module infrastructure to implement common code for
vimscript commands/functions that need to communicate with external
interpreters, eg: pydo, rubydo, pyfile, rubyfile, etc.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/ |
|
|\ |
|
|/
|
|
|
|
| |
Problem: Bug was introduced because `os_open` returns `-errno` in case
of an error instead of just `-1` which was returned by `mch_open`.
Solution: Check return value with `< 0` instead of `== -1`.
|
|\
| |
| |
| | |
This includes the necessary fixes to sv.po to make the build work again.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes #902: localization build: `install`, `uninstall`, `prefixcheck
targets. All the language-related bits will now build under CMake.
Changes include:
* Moving all non-generated sources into the NEOVIM_SOURCES variable
to aid in generating the .pot file.
* Moving a couple generated sources from NEOVIM_SOURCES and into
NEOVIM_GENERATED_SOURCES.
* Added NEOVIM_HEADERS to the executable and the library for folks who
are using something other than Ninja or makefiles (that way the
headers will show up in the IDE files).
* Now uses gettext's `--update` switch to update the .po files, rather
than doing a fragile `mv` dance that could leave you with a broken
working tree if you press CTRL-C at the right time.
* Creates `update-po-${LANG}` targets for updating individual
languages, just like the original Makefile.
* Also adds the `update-po` target for updating all the languages.
* Ported the `check-${LANG}` style targets. They're
`check-po-${LANG}` under CMake.
* Handles all the one-off instances that were in the original
Makefile. Fixed up ko.UTF-8.po to include the "Original
translation" line like other .po files to make the generation of the
"Generate from ..." comments consistent. Updated ko.po with the new
text.
|
|/
|
|
|
|
| |
The idea being that it's better to segregate feedback, just in case
someone is working on several translations. Now the check log will
appear in `./build/src/nvim/po/check-${LANG}.log`.
|
|
|
|
|
| |
This reverts commit 53fba180c32724809d8ab35238eea68440b7ac97, reversing
changes made to a3b3db8256c259d10957d45666cf4179e328f3f4.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
The idea being that it's better to segregate feedback, just in case
someone is working on several translations. Now the check log will
appear in `./build/src/nvim/po/check-${LANG}.log`.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #902: localization build: `install`, `uninstall`, `prefixcheck
targets. All the language-related bits will now build under CMake.
Changes include:
* Moving all non-generated sources into the NEOVIM_SOURCES variable
to aid in generating the .pot file.
* Moving a couple generated sources from NEOVIM_SOURCES and into
NEOVIM_GENERATED_SOURCES.
* Added NEOVIM_HEADERS to the executable and the library for folks who
are using something other than Ninja or makefiles (that way the
headers will show up in the IDE files).
* Now uses gettext's `--update` switch to update the .po files, rather
than doing a fragile `mv` dance that could leave you with a broken
working tree if you press CTRL-C at the right time.
* Creates `update-po-${LANG}` targets for updating individual
languages, just like the original Makefile.
* Also adds the `update-po` target for updating all the languages.
* Ported the `check-${LANG}` style targets. They're
`check-po-${LANG}` under CMake.
* Handles all the one-off instances that were in the original
Makefile. Fixed up ko.UTF-8.po to include the "Original
translation" line like other .po files to make the generation of the
"Generate from ..." comments consistent. Updated ko.po with the new
text.
|
|\ |
|
|/ |
|
|\
| |
| | |
refactor includes + improve testing infrastructure
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is not an exhaustive commit, it merely ameliorates the situations a
bit. There are quite a few header files that don't include all the types
they use in their function/struct/... definitions. This throws of the
testing infrastructure (but is not such a problem for the main binary that
has the "tumbleweed of includes"-phenomenon).
|
| |
| |
| |
| |
| |
| |
| |
| | |
Move tests of path_full_dir_name to path_spec. It is only defined in path.h.
Not sure why this works most of the time (I can only trigger a failure when
running under lldb).
It's a more logical place to have the test as well.
|
| |
| |
| |
| |
| | |
- Initializes some global variables.
- Necessary for the buffer tests in PR #904.
|
| |
| |
| |
| |
| | |
Also include stdint.h in khash.h. It was transitively included by vim.h via
memory.h before. khash.h accidentally relied on that.
|
| |
| |
| |
| |
| | |
Also include "types.h" in os_unix.h because it declares functions that
return vim_acl_T.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Unit tests never need to declare globals, only access them. In the main code
base this is handled by including "vim.h". If a file wants to declare
globals (in the case of neovim that's only main.c), it #define's EXTERN and
includes "vim.h". Otherwise, a file just includes "vim.h" (that's the
majority case). Since we want to be able to run unit tests without including
"vim.h", we predefine "EXTERN" to mean extern. That way, we don't have to
include "vim.h".
|
| |
| |
| |
| | |
Make vim.h smaller, bit by bit.
|
| |
| |
| |
| | |
Try to cut down vim.h's size. It's keeping us from testing more things.
|
| |
| |
| |
| |
| | |
Seems to make no difference to the main binary, but it helps the tests a bit
further along.
|
|/
|
|
|
|
|
| |
Including vim.h in another header filer is asking for trouble. Test code
that includes separate header files (e.g.: cimport './src/nvim/buffer.h'),
has a really bad time with this. This is just one piece of the puzzle
though.
|
| |
|
|\
| |
| | |
viml: impl profiling on top of uv_hrtime()
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some functions are missing:
- profile_self
- profile_get_wait
- profile_set_wait
- profile_sub_wait
|
| |
| |
| |
| |
| | |
It wasn't used anywhere else, our coding guidelines mandate the tightest
scope possible.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Should be better than gettimeofday() since libuv uses higher resolution
clocks on most UNIX platforms. Libuv also tries to use monotonic clocks,
kernel bugs notwithstanding, which is another win over gettimeofday().
Necessary for Windows, which doesn't have gettimeofday(). In vanilla vim,
Windows uses QueryPerformanceCounter, which is the correct primitive for
this sort of things, but that was removed when slimming up the codebase.
Libuv uses QueryPerformanceCounter to implement uv_hrtime() on Windows so
the behaviour of vim profiling on Windows should now be the same.
The behaviour on Linux should be different (better) though, libuv uses more
accurate primitives than gettimeofday().
Other misc. changes:
- Added function attributes where relevant (const, pure, ...)
- Convert functions to receive scalars: Now that proftime_T is always a
(uint64_t) scalar (and not a struct), it's clearer to convert the
functions to receive it as such instead of a pointer to a scalar.
- Extract profiling funcs to profile.c: make everything clearer and reduces
the size of the "catch-all" ex_cmds2.c
- Add profile.{c,h} to clint and -Wconv:
- Don't use sprintf, use snprintf
- Don't use long, use int16_t/int32_t/...
|