Commit Graph

691 Commits

Author SHA1 Message Date
Thiago de Arruda
878e6e661d Add cmake module for finding msgpack 2014-04-11 14:07:44 -03:00
oni-link
00a27a808c vim-patch:7.4.192
Problem:    Memory leak when giving E853.
Solution:   Free the argument. (Dominique Pelle)

https://code.google.com/p/vim/source/detail?r=04c4ef8c0a1b757494500e46400552b135135e94
2014-04-11 13:35:22 -03:00
Stefan Hoffmann
c1961ee0df removed vim_mkdir macro 2014-04-11 13:31:48 -03:00
Stefan Hoffmann
96ddc0198d removed mch_rmdir macro 2014-04-11 13:31:48 -03:00
Stefan Hoffmann
a1df458524 removed mch_remove macro 2014-04-11 13:31:48 -03:00
Stefan Hoffmann
445f31f076 port vim_mkdir, mch_rmdir and mch_remove to libuv 2014-04-11 13:31:48 -03:00
Felipe Oliveira Carvalho
136e5e5b84 No error condition in push_current_state() 2014-04-11 12:58:00 -03:00
Felipe Oliveira Carvalho
949d1c407c No error condition in store_loop_line() 2014-04-11 12:58:00 -03:00
Felipe Oliveira Carvalho
a5efbd3140 No error condition in get_arg_list() 2014-04-11 12:58:00 -03:00
Felipe Oliveira Carvalho
a583bcc76e alist_add_list() doesn't return -1 anymore 2014-04-11 12:58:00 -03:00
Felipe Oliveira Carvalho
3c3200fc7a No error condition in foldInsert() 2014-04-11 12:58:00 -03:00
Felipe Oliveira Carvalho
f6b0e335e1 Remove OOM error handling code after ga_grow() calls 2014-04-11 12:57:59 -03:00
Felipe Oliveira Carvalho
457bb26151 Remove OOM error handling code after calls to mf_hash_grow() 2014-04-11 12:57:59 -03:00
Felipe Oliveira Carvalho
b4545740fd Remove OOM error handling code after calls to transstr()
transstr() doesn't return NULL anymore.
2014-04-11 12:57:59 -03:00
Felipe Oliveira Carvalho
b8bda77e39 Remove OOM error handling code after calls to diff_alloc_new() 2014-04-11 12:57:59 -03:00
Felipe Oliveira Carvalho
86279cefae Remove more OOM error handling code
From the functions:

 - ExpandBufnames
 - buf_modname()
 - do_autocmd_event()
 - ff_create_stack_element()
 - ff_get_visited_list()
 - ins_complete()
 - msg_show_console_dialog()
 - prt_find_resource()
 - vim_findfile_init()

TODO: refactor msg_show_console_dialog() to make sure it doesn't ever return
NULL.
2014-04-11 12:57:59 -03:00
John Schmidt
3fcdb2ab29 Replace alloc_check by xmalloc
`alloc_check` is just a wrapper around xmalloc, so we can remove it and use
xmalloc directly. ref #487 / #488

The call was replaced in the following files:

- ex_cmds.c
- misc1.c
- ops.c
2014-04-10 17:03:50 -03:00
Hinidu
321c67d610 vim-patch:7.4.187
Problem:    Delete that crosses line break splits multi-byte character.
Solution:   Advance a character instead of a byte. (Cade Foster)

https://code.google.com/p/vim/source/detail?r=a1c07956171a133583df42627d3498f935e59988
2014-04-10 16:56:42 -03:00
John Schmidt
2a0c6ff3ef Fix broken build due to unit test include order
Commit 4348d1e6f7
 introduced a bug that breaks the unit tests unless
 they run in a certain order. Both path.moon
 and os/fs.moon tries to include the same Enum, which
 fails since ffi.cdef can only include definitions once.

 This solves the bug by using Lua variables instead of
 ffi.cdef Enums.
2014-04-09 17:17:26 -03:00
oni-link
d11f805150 vim-patch:7.4.186
Problem:    Insert in Visual mode sometimes gives incorrect results.
            (Dominique Pelle)
Solution:   Remember the original insert start position. (Christian Brabandt,
            Dominique Pelle)

https://code.google.com/p/vim/source/detail?r=4d12112c5efae071aecbeed1a7196f18950457b3
2014-04-08 21:58:13 -03:00
John Schmidt
ac62041138 Move exe functions back to os/fs.c 2014-04-08 21:56:05 -03:00
John Schmidt
6fb58d1c5c Change prefix from os_* to path_* 2014-04-08 21:56:05 -03:00
John
aa7218b646 Move and adapt os_get_absolute_path unit tests to vim_FullName
* Add two new unit tests to `vim_FullName`
* Make `os_get_absolute_path` static
2014-04-08 21:56:05 -03:00
John Schmidt
4348d1e6f7 Move functions from os/fs.c into path.c
Move unit tests from os/fs.moon to path.moon
2014-04-08 21:56:05 -03:00
Thiago de Arruda
49f5e5d0b1 Add some missing backers and remove duplicates 2014-04-08 15:54:13 -03:00
Thiago de Arruda
63c2dad0ea Sort backers.md 2014-04-08 15:51:05 -03:00
Thiago de Arruda
5f0e134a42 Remove donation value from backers.md 2014-04-08 15:50:08 -03:00
Thiago de Arruda
e7d83cb81a Remove old comment from job.c 2014-04-08 14:17:18 -03:00
Thiago de Arruda
fe38baed38 Define special key for asynchronous events
K_EVENT/KE_EVENT are used to signal any loop that reads user input(scattered
across normal.c edit.c , ex_getln.c and message.c) of asynchronous events that
were not initiated by the user.

Representing non-user asynchronous events as special keys has the following
advantages:

- We reuse the normal vim redrawing code. As far as the rest of the code in
  edit.c/normal.c is concerned, it's just the user pressing another key.
- Assume less about vim tolerance for "out-of-band" modifications to its
  internal state.
- We still have a very complex codebase and it's hard to predict what bugs may
  be introduced by these changes. With this we implement asynchronicity in a way
  that will be more "natural" to the editor and has less chance of causing
  unpredictable behavior.

As the code is refactored, we will be able to treat user input as an 'event
type' and not the other way around(With this we are treating arbitrary events as
a special case of user input).
2014-04-08 14:17:18 -03:00
Thiago de Arruda
1fc7d6a0c5 Fix/add more files with to clint-files.txt 2014-04-08 13:49:45 -03:00
Thiago de Arruda
0805911434 Run clint.py in some files 2014-04-08 13:49:45 -03:00
Hinidu
f826b4c616 vim-patch:7.4.184
Problem:    match() does not work properly with a {count} argument.
Solution:   Compute the length once and update it.  Quit the loop when at the
            end. (Hirohito Higashi)

https://code.google.com/p/vim/source/detail?r=9ac2fc63501d3eff92446c03b2822b30b169db5a
2014-04-08 13:36:16 -03:00
Hinidu
10f899e8e7 Remove #ifdef FEAT_WINDOWS from vim-patch:7.4.181 2014-04-08 13:34:26 -03:00
Hinidu
e3ba6d97ff vim-patch:7.4.181
Problem:    When using 'pastetoggle' the status lines are not updated. (Samuel
            Ferencik, Jan Christoph Ebersbach)
Solution:   Update the status lines. (Nobuhiro Takasaki)

https://code.google.com/p/vim/source/detail?r=cb5683bcde03796baa7e845fd9a2fcaec3383538
2014-04-07 20:45:38 -03:00
Thiago de Arruda
9e6f8954cd Format backers list 2014-04-07 19:14:14 -03:00
Thiago de Arruda
5e98c3a63b Add BACKERS.md
List of Neovim backers provided by Bountysource
2014-04-07 19:10:06 -03:00
Thiago de Arruda
4b063ea3ad Implement job control
- Add a job control module for spawning and controlling co-processes
- Add three vimscript functions for interfacing with the module
- Use dedicated header files for typedefs/structs in event/job modules
2014-04-07 15:03:05 -03:00
Hinidu
39932212d8 Added clint check for TRUE/FALSE 2014-04-07 12:15:28 -03:00
Hinidu
8a2ffb2b01 Use stdbool in os module 2014-04-07 12:15:28 -03:00
Felipe Oliveira Carvalho
c3cea30cb7 Turn Event into a tagged union
If we ever need arbitrary data or more than very few bytes on `Events` we just
have to add a `void *` field in the `data` union.
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
967fb1aca6 Reimplement the event queue in event.c using klist.h
- Add a new macro to klist.h: kl_empty()

   The whole point of abstract data structures is to avoid reimplementing
   common actions. The emptiness test seems to be such an action.

 - Add a new function attribute to func_attr.h: FUNC_ATTR_UNUSED

   Some of the many functions created by the macros in klist.h may end up not
   being used. Unused functions cause compilation errors as we compile with
   -Werror. To mark those functions as possibly unused we can use the
   FUNC_ATTR_UNUSED now.

 - Pass `Event` by value

   `Event` is such a small struct that I don't think we should allocate heap space
   and pass it by reference. Let's use the stack and memory cache in our favor
   passing it by value.
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
fac85c1724 Implement xcalloc and use it in klist.h (use xrealloc as well)
Bonus: implement lalloc_clear and alloc_clear using xcalloc
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
fa02ada732 Add klib.h to src/lib
As decided on #434 [1].

[1] https://github.com/neovim/neovim/issues/434#issuecomment-39111868
[2] https://github.com/attractivechaos/klib
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
13848aadbf Remove simpler cases of OOM error handling (after *alloc calls)
By simpler cases I mean cases where the OOM error is not expected to be handled
by the caller of the function that calls `alloc`, `lalloc`, `xrealloc`,
`xmalloc`, `alloc_clear`, and `lalloc_clear`.

These are the functions that:

 - Do not return an allocated buffer
 - Have OOM as the only error condition

I took note of the functions that expect the caller to handle the OOM error and
will go through them to check all the callers that may be handling OOM error in
future commits.

I'm ignoring eval.c and ex_.c in this series of commits. eval.c will soon be
obsolete and I will deal with ex_.c in later PRs.
2014-04-06 22:54:59 -03:00
Felipe Oliveira Carvalho
6bbffee0a5 Simplify tricky preprocessor tests in ff_check_visited() 2014-04-06 22:54:59 -03:00
Thiago de Arruda
3843fd3469 Remove unneeded variable in_os_delay
This variable only existed for the old SIGQUIT handler. Now it's no longer
necessary, especially when Neovim stops being a terminal program.
2014-04-06 11:43:23 -03:00
Thiago de Arruda
0b826ef43e Add comments and fix os_microdelay call 2014-04-06 11:43:23 -03:00
Thiago de Arruda
dfb7d826ac Remove RealWaitForChar and mch_new_shellsize
The last occurrence of `RealWaitForChar` was replaced by the `os_microdelay`
function. `mch_new_shellsize` had an empty body, so there seems to be no reason
for keeping it around
2014-04-06 11:43:23 -03:00
Thiago de Arruda
f8970e1c7c Implement os_microdelay and os_delay on top of it 2014-04-06 11:43:23 -03:00
Thiago de Arruda
b6d458e137 Replace strdup calls by xstrdup 2014-04-06 11:32:47 -03:00