Commit Graph

473 Commits

Author SHA1 Message Date
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
Thiago de Arruda
fdec1d126f Implement xstrdup and xstrndup
Utility functions for copying strings to newly-allocated chunks. They either
succeed or exit the program.
2014-04-06 11:32:47 -03:00
oni-link
461b939b01 vim-patch:7.4.178
Problem:    The J command does not update '[ and '] marks. (William Gardner)
Solution:   Set the marks. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=647e6bb15aa3f864eaf447fe77e3e3ae7e37b134
2014-04-06 11:31:12 -03:00
Thiago de Arruda
a02bcc0d2f Use early return for rejecting_deadly in signal_cb 2014-04-06 07:24:46 -03:00
oni-link
74f54d78d9 vim-patch:7.4.173
Problem:    When using scrollbind the cursor can end up below the last line.
            (mvxxc)
Solution:   Reset w_botfill when scrolling up. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=233ad7b960d0fbeb224b383918113b25c74ebe35
2014-04-06 06:56:13 -03:00
Stefan Hoffmann
e76249c813 Moved mch_get_host_name and renamed it to os_get_hostanme 2014-04-05 20:19:38 -03:00
Stefan Hoffmann
a8013f2bb1 Moved mch_get_pid and renamed it to os_get_pid 2014-04-05 20:19:38 -03:00
oni-link
f545afaed0 vim-patch:7.4.171
Problem:    Redo does not set v:count and v:count1.
Solution:   Use a separate buffer for redo, so that we can set the counts when
            performing redo.

https://code.google.com/p/vim/source/detail?r=beb037a6c2708f539d50840637f70eed0811d93c
2014-04-05 20:17:32 -03:00
Thiago de Arruda
57cd2d6614 Remove the old mch_call_shell implementation 2014-04-05 11:05:31 -03:00
Thiago de Arruda
2dcae28328 Rewrite mch_call_shell on top of libuv
- Rename to `os_call_shell`
- Use another entry point for libuv default event loop
- Fix the `call_shell` reference in misc2.c
2014-04-05 11:05:31 -03:00
Thiago de Arruda
796b79db8c Stop queueing events when signals are rejected
The only exception is SIGINT, which will set `got_int` directly. This will be
necessary for the new implementation of `mch_call_shell`
2014-04-05 11:05:31 -03:00
Thiago de Arruda
cb9afe0dc0 Add helpers for debugging with valgrind
The environment variable USE_VALGRIND can be set to run tests with valgrind. If
VALGRIND_GDB is set, valgrind will start it's own gdbserver for remote
debugging with `target remote | vgdb`. USE_GDB can still be used, but it will
be ignored if USE_VALGRIND is set.
2014-04-05 11:05:31 -03:00
oni-link
ade0c127e5 vim-patch:7.4.172
Problem:    The blowfish code mentions output feedback, but the code is
	        actually doing cipher feedback.
Solution:   Adjust names and comments.

https://code.google.com/p/vim/source/detail?r=391e10afccf6879dcfab8b28cb1587a13eb835c0
2014-04-05 10:10:08 -03:00
John Schmidt
26206d4cfd Remove mblen() check 2014-04-05 10:01:22 -03:00
John Schmidt
5ff29e00a5 Remove xterm_save 2014-04-05 10:01:22 -03:00
John Schmidt
866584542b Remove xpm 2014-04-05 10:01:22 -03:00
John Schmidt
8731d44996 Remove tcl 2014-04-05 10:01:22 -03:00
John Schmidt
f226a4c2cd Remove ole 2014-04-05 10:01:22 -03:00
John Schmidt
84b06b77bd Remove mzscheme 2014-04-05 10:01:22 -03:00