Scott Prager
37cbafa5bb
job: Read job data line-wise.
...
Only read up to the last newline in push_job_event().
2014-11-07 13:34:56 -03:00
Eliseo Martínez
e7a863e12c
Remove long_u: eval: Replace with size_t.
...
Note: No effort is done on refactoring anything in eval module, as it
will be eventually dropped.
2014-11-06 22:19:33 +01:00
Nicolas Hillegeer
8c5efd62ac
iconv: re-enable
...
This seems to have been disabled in the transition from vim to neovim,
re-enable it.
2014-11-06 00:18:26 +01:00
Thiago de Arruda
a1dd70b1d0
event: Reintroduce the immediate event queue
...
Commit @264e0d872c("Remove automatic event deferral") removed the immediate
event queue because event deferral now had to be explicit. The problem is that
while some events don't need to be deferred, they still can result in recursive
`event_poll` calls, and recursion is not supported by libuv. Examples of those
are msgpack-rpc requests while a server->client request is pending, or signals
which can call `mch_exit`(and that will result in `uv_run` calls).
To fix the problem, this reintroduces the immediate event queue for events that
can potentially result in event loop recursion. The non-deferred events are
still processed in `event_poll`, but only after `uv_run` returns.
2014-11-02 16:47:50 -03:00
Thiago de Arruda
c92d17b4aa
job: Let job_start callers to selectively ignore stdio
...
Passing NULL as the callback for stdout/stderr will result in job_start ignoring
stdout/stderr, respectively. A 'writable' boolean argument was also added, and
when false `job_start` will ignore stdin.
Also, refactor os_system to allow passing NULL as the `output` argument.
2014-10-31 22:52:10 -03:00
Justin M. Keyes
181e652ee1
Merge pull request #1312 from GokuITA/coverity1289
...
coverity/71507: Unchecked return value (CHECKED_RETURN)
2014-10-30 02:12:28 -04:00
Thiago de Arruda
94f59fc9be
api: Implement vim_command_output function
...
This function can be used by API clients to execute a command and capture the
output.
2014-10-28 23:12:41 -04:00
Scott Prager
d10e83fec2
job/valgrind: Fix invalid reads/missing free.
...
The JobEvent structure may refer to a job after it has been freed. Apply
@tarruda's patch to extract the job data before pushing the event.
Also, fix the type, "data" -> "job", in on_job_exit() and free the job
name in the last job event.
2014-10-28 14:09:28 -03:00
Thiago de Arruda
72f028abcb
eval: Defer execution of JobActivity autocommands
...
JobActivity autocommands run vimscript and must be executed on Nvim main loop.
Since the previous commit removed automatic calls to `event_push` on RStream/Job
callbacks, this adds it back, but in eval.c where job control is implemented.
2014-10-21 11:05:49 -03:00
Thiago de Arruda
b280308ac6
msgpack-rpc: Create subdirectory for msgpack-rpc modules
...
Create the msgpack_rpc subdirectory and move all modules that deal with
msgpack-rpc to it. Also merge msgpack_rpc.c into msgpack_rpc/helpers.c
2014-10-21 11:05:49 -03:00
Victor Fonseca
1be1964f34
coverity/71507: Unchecked return value (CHECKED_RETURN)
...
Don't check for err->set since object_to_vim always return false when error is set
2014-10-20 11:01:25 -02:00
Thiago de Arruda
68de5d79a2
rstream: Extract some RStream functionality to RBuffer
...
RBuffer instances represent the internal buffer used by RStreams.
This changes RStream constructor to receive RBuffer pointers and adds a set of
RBuffer methods that expose the lower level buffer manipulation to consumers of
the RStream API.
2014-10-18 08:42:49 -03:00
Justin M. Keyes
5e65e3eae0
Merge pull request #1208 from war1025/dev/remove_for_all_windows
...
Remove FOR_ALL_WINDOWS and replace with FOR_ALL_WINDOWS_IN_TAB(curtab)
2014-10-03 13:44:50 -04:00
Thiago de Arruda
ba1026c2c7
eval: Fix save_tv_as_string
to handle non-string types
2014-10-01 21:42:00 -03:00
Scott Prager
01fc01e5d6
Implement save_tv_as_string to assist in #1176 .
2014-09-30 20:53:26 -04:00
Scott Prager
3928acb032
Fix system() output truncation bug.
...
Replace NULs with SOH to restore the old behaviour of get_cmd_output().
2014-09-30 19:35:47 -04:00
Scott Prager
b0bda2ee87
vim-patch:7.4.256
...
Problem: Using systemlist() may cause a crash and does not handle NUL
characters properly.
Solution: Increase the reference count, allocate memory by length. (Yasuhiro
Matsumoto)
https://code.google.com/p/vim/source/detail?r=v7-4-256
2014-09-30 19:35:46 -04:00
Scott Prager
78979427d1
Return list from rettv_list_alloc.
2014-09-30 19:35:46 -04:00
Scott Prager
566ce93135
vim-patch:7.4.248
...
Problem: Cannot distinguish between NL and NUL in output of system().
Solution: Add systemlist(). (ZyX)
https://code.google.com/p/vim/source/detail?r=v7-4-248
2014-09-30 19:35:46 -04:00
Scott Prager
d3cd3d2b8f
vim-patch:7.4.247
...
Problem: When passing input to system() there is no way to keep NUL and
NL characters separate.
Solution: Optionally use a list for the system() input. (ZyX)
https://code.google.com/p/vim/source/detail?r=v7-4-247
Implement write_list_to_string() as well since write_list() only works
on files.
2014-09-30 19:35:46 -04:00
Wayne Rowcliffe
9b6f192693
Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab)
2014-09-24 19:00:50 -05:00
André Twupack
1a7c83d77d
vim-patch:7.4.411
...
Problem: "foo bar" sorts before "foo" with sort(). (John Little)
Solution: Avoid putting quotes around strings before comparing them.
https://code.google.com/p/vim/source/detail?r=v7-4-411
2014-09-22 21:38:48 +02:00
Wayne Rowcliffe
683bc797a0
FOR_ALL_WINDOWS_IN_TAB and local variables in FOR_ALL_TAB_WINDOWS
2014-09-22 09:31:09 -05:00
Wayne Rowcliffe
b4ec6c1a4b
FOR_ALL_TABS helper
2014-09-22 09:26:40 -05:00
Justin M. Keyes
0ed9f3ec83
Merge pull request #1197 from Shougo/vim-patch-7.4.392
...
vim-patch:7.4.392
2014-09-20 18:57:10 -04:00
Thiago de Arruda
4a8b52ea08
api/msgpack-rpc: Improve error infrastructure
...
- Add error type information to `Error`
- Rename `set_api_error` to `api_set_error` for consistency with other api_*
functions/macros.
- Refactor the api_set_error macro to accept formatted strings and error types
- Improve error messages
- Wrap error messages with gettext macro
- Refactor msgpack-rpc serialization to transform Error instances into [type,
message] arrays
- Add error type information to API metadata
- Normalize nvim->client and client->nvim error handling(change
channel_send_call to accept an Error pointer instead of the `errored` boolean
pointer)
- Use macro to initialize Error structures
2014-09-18 21:30:31 -03:00
Shougo Matsushita
b57d6ef09a
vim-patch:7.4.392
...
Problem: Not easy to detect type of command line window.
Solution: Add the getcmdwintype() function. (Jacob Niehus)
https://code.google.com/p/vim/source/detail?r=v7-4-392
2014-09-18 20:44:36 +09:00
Justin M. Keyes
a447160a6c
Merge pull request #953 from splinterofchaos/patch235-exepath
...
vim-patch:7.4.235
2014-09-17 01:28:35 -04:00
Scott Prager
9445eaa297
vim-patch:7.4.235
...
Problem: It is not easy to get the full path of a command.
Solution: Add the exepath() function.
https://code.google.com/p/vim/source/detail?r=5ab2946f7ce560985830fbc3c453bb0f7a01f385
2014-09-17 01:00:24 -04:00
Damián Silvani
e32d338c87
vim-patch:7.4.313
...
Problem: Changing the return value of getpos() causes an error. (Jie Zhu)
Solution: Revert getpos() and add getcurpos().
https://code.google.com/p/vim/source/detail?r=332a5c2b2956d9b18d85268a724d01deea27ec83
2014-09-16 23:35:12 -03:00
Damián Silvani
27f423e734
vim-patch:7.4.310
...
Problem: getpos()/setpos() don't include curswant.
Solution: Add a fifth number when getting/setting the cursor.
https://code.google.com/p/vim/source/detail?r=ccac0aa34eeaf46dad4b831461a532fc3fe71096
2014-09-16 22:43:40 -03:00
Justin M. Keyes
3b7b79e37d
Merge pull request #1140 from atwupack/vp-7.4.341
...
vim-patch:7.4.341, 7.4.347, 7.4.351, 7.4.358
2014-09-15 14:08:55 -04:00
Thiago de Arruda
037ca796a0
eval.c: Rename has('neovim') feature to has('nvim')
...
To follow the convention of 'nvim' for technical references
2014-09-15 08:21:31 -03:00
Justin M. Keyes
5d35484203
Merge pull request #1169 from splinterofchaos/arglistid
...
vim-patch:7.4.312
2014-09-15 04:35:49 -04:00
Thiago de Arruda
f928c0a3a0
eval.c: Rename msgpack-rpc functions for consistency
2014-09-13 21:35:47 -03:00
Thiago de Arruda
f0b88466a3
eval.c: Rename jobwrite to jobsend
2014-09-13 21:35:47 -03:00
Scott Prager
def28adfdd
vim-patch:7.4.312
...
Problem: Cannot figure out what argument list is being used for a window.
Solution: Add the arglistid() function. (Marcin Szamotulski)
https://code.google.com/p/vim/source/detail?r=v7-4-312
2014-09-13 18:28:32 -04:00
André Twupack
eeef120c86
vim-patch:7.4.358
...
Problem: Sort is not always stable.
Solution: Add an index instead of relying on the pointer to remain the same.
Idea by Jun Takimoto.
https://code.google.com/p/vim/source/detail?r=v7-4-358
2014-09-13 19:11:46 +02:00
André Twupack
75413496ae
vim-patch:7.4.351
...
Problem: sort() is not stable.
Solution: When the items are identical, compare the pointers.
https://code.google.com/p/vim/source/detail?r=v7-4-351
2014-09-13 19:11:07 +02:00
André Twupack
9f252554e3
vim-patch:7.4.341
...
Problem: sort() doesn't handle numbers well.
Solution: Add an argument to specify sorting on numbers. (Christian Brabandt)
https://code.google.com/p/vim/source/detail?r=adc4a84f72eb44dae657af713922a6e2c1f64ae3
2014-09-13 19:10:18 +02:00
Thiago de Arruda
15ca58d79f
api: Implement vim_report_error
function
...
This function is used to report errors caused by remote functions called by
channel_send_call
2014-09-12 13:50:07 -03:00
Thiago de Arruda
5060902930
api/msgpack-rpc: Implement channel_close
and expose to vimscript
...
Simple function for closing a channel by id
2014-09-12 13:25:29 -03:00
Thiago de Arruda
551b76c516
api/msgpack-rpc: Expose channel_from_job to vimscript as api_spawn
2014-09-12 13:25:28 -03:00
Thiago de Arruda
cac24cb06d
api/msgpack-rpc: Refactor msgpack_rpc_helpers.{c,h}
...
- Move helpers that are specific to API types to api/private/helpers.{c,h}
- Include headers with generated declarations
- Delete unused macros
2014-09-12 13:25:28 -03:00
Justin M. Keyes
7738e723e9
Merge pull request #1149 from splinterofchaos/vim-patch-7.4.278
...
vim-patch:7.4.278
2014-09-09 15:00:06 -04:00
Scott Prager
f85053ccf7
vim-patch:7.4.278
...
Problem: list_remove() conflicts with function defined in Sun header file.
Solution: Rename the function. (Richard Palo)
https://code.google.com/p/vim/source/detail?r=v7-4-278
2014-09-09 12:30:34 -04:00
Wayne Rowcliffe
ac0b9714ed
Additional FOR_ALL_WINDOWS usage
2014-09-08 17:27:41 -05:00
Justin M. Keyes
3f5482d325
Merge pull request #1107 from fmoralesc/matchaddpos
...
Add matchaddpos()-related vim patches. [vim-patch: 7.4.330, 7.4.334, 7.4.343, 7.4.344, 7.4.362]
2014-09-05 20:57:41 -04:00
Felipe Morales
bf3d945798
vim-patch: 7.4.330
...
Problem: Using a regexp pattern to highlight a specific position can
be slow.
Solution: Add matchaddpos() to highlight specific positions
efficiently.
(Alexey Radkov.)
https://code.google.com/p/vim/source/detail?r=f9fa2e506b9f07549cd91074835c5c553db7b3a7
2014-09-04 00:18:24 -04:00
Stefan Hoffmann
7ac191ab10
fileinfo: change returntype of os_fileinfo_size
...
off_t -> uint64_t
2014-08-31 15:47:44 +02:00