Commit Graph

19394 Commits

Author SHA1 Message Date
Fredrik Fornwall
958b3c5ffb Default 'encoding'-option from latin to utf-8 #935
Normally the default encoding does not have much effect, since it's
overridden by the environment.

But when it's not (test with "LANG= LC_ALL= C_CTYPE= nvim" and perform
":set encoding?"), utf-8 should be the default encoding for a 21st
century editor :).
2014-07-10 12:04:48 -04:00
Fredrik Fornwall
e9ca4f002f Avoid linking with libform(w).so
If libtgent or libcurses is installed, the first one found of them
is linked to.

But if not, a find_package(Curses REQUIRED) is used and CURSES_LIBRARIES
is added to NVIM_LINK_LIBRARIES. This contains libform(w).so on many
systems, causing nvim to be linked to and depend on libform(w).so,
which may not be installed one some space-constrained systems, unnecessarily.
2014-07-10 08:53:04 -04:00
Fredrik Fornwall
308953ecbf Fix two android compile errors in fs.c #924
Replace usage of deprecated S_IEXEC with S_IXUSR.
Rename a variable named "errno" to avoid clashing with define.
2014-07-09 09:17:38 +02:00
Brandon Coleman
0fff487690 move errno.h include out of vim.h 2014-07-09 00:18:20 +02:00
Brandon Coleman
b94d07b046 move stdarg.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
e69cfa6c15 move assert.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
8cc8164e52 move wctype.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
bf219e1442 move <inttypes.h> include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
b18ca14ef8 move locale.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
82b71a3056 move ascii.h include out of vim.h 2014-07-09 00:18:18 +02:00
Brandon Coleman
8c9cb5f9ef move memory.h include to version.c 2014-07-09 00:18:17 +02:00
Brandon Coleman
a4f441e547 remove stdbool.h include from vim.h and globals.h 2014-07-09 00:18:17 +02:00
Brandon Coleman
e3db636546 remove proto.h include from vim.h 2014-07-09 00:18:17 +02:00
Klemen Košir
a568e8b644 Replaced most TRUE/FALSE macros in arabic, mbyte and spell. #645 2014-07-08 17:34:08 +00:00
Klemen Košir
ef34a0ab13 Replace int with bool in some files. #654 2014-07-08 17:25:48 +00:00
Rui Abreu Ferreira
67c5684e23 Add vim_feedkeys API function
- New API function to push data to the typeahead buffer - this should
  equivalent to the vimscript feedkeys() function
- In Vim there was a --remote-send command to insert input into a
  Vim server instance. Besides accepting key sequences it also
  translated special keys such as <CR> or <Leader>, backslash notation
  is ignored. This commit backports the original Vim handler for
  --remote-send as a bool option for vim_feedkeys()
- vim-patch:0
2014-07-07 12:18:36 -03:00
Felipe Oliveira Carvalho
9a2b2d4a64 MsgPack-RPC dispatch based on function array lookup #864
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).
2014-07-04 17:05:24 +00:00
Rui Abreu Ferreira
11653ce2d7 Remove include for sys/select.h in vim.h #890
- There is no need to include sys/select.h anymore
- Removed HAVE_SYS_SELECT_H from config.h.in
2014-07-01 18:21:02 -04:00
Florian Walch
c175319266 Update German translation: Improve translations.
* Translate missing and fuzzy strings.
* Fix grammatical errors.
* Rewordings for consistency.
2014-07-01 17:25:58 -04:00
Florian Walch
1bbf8c4ed2 Update German translation: Sync to 9f1b9726fb. 2014-07-01 17:25:58 -04:00
Eduardo Elias Ferreira
e5c4b520a2 Update pt_BR translation: Improve translations.
[ci skip]
2014-07-01 14:51:14 -04:00
Eduardo Elias Ferreira
8536d743ff Update pt_BR translation: Sync to a321480342 2014-07-01 14:51:14 -04:00
Felipe Oliveira Carvalho
5ed74cfb7c Introduce ga_append_via_ptr() and GA_APPEND_VIA_PTR()
Similar to GA_APPEND(). Replaces this pattern:

    ga_grow(&ga, 1);
    item_type *p = ((item_type *)ga.ga_data) + ga.ga_len;
    p->field1 = v1;
    p->field2 = v2;
    ga.ga_len++;
2014-06-30 03:57:50 -04:00
Felipe Oliveira Carvalho
45e7814e6a Introduce GA_APPEND()
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;
2014-06-30 03:57:50 -04:00
Felipe Oliveira Carvalho
be3a4b6ca8 ga_growsize should be >= 1
I know it could be 0 sometimes. Running the tests with
`assert(gap->ga_growsize > 0)` in ga_grow() crashes nvim while running the
tests.

 - Add a setter for ga_growsize that checks whether the value passed is >=1 (log
	 in case it's not)
 - log when ga_grow() tries to use a ga_growsize that's not >=1
 - use GA_EMPTY_INIT_VALUE is many places
2014-06-30 03:57:50 -04:00
Justin M. Keyes
d723e7fd61 keep statusline within window width. @oni-link fix #858
PR #866
ref #858
2014-06-29 15:25:06 -04:00
Nicolas Hillegeer
8c51804d52 libcall: remove libcall ifdefs
Remove all the legacy code that related to mch_libcall in some way.
os_libcall is implemented on top of libuv now.
2014-06-28 14:44:17 -04:00
Nicolas Hillegeer
bbb649ac69 os: remove legacy mch_libcall
Remove as much leftover cruft as possible. Tried to see which globals are
now not used anymore.
2014-06-28 14:44:16 -04:00
Nicolas Hillegeer
99163c9f13 os: implement VimL libcall with {mch,os}_libcall
The old mch_libcall was removed from neovim. This is a partial
reimplementation on top of libuv. It doesn't catch exceptions (windows) nor
signals (unix) though, so it's quite a bit more prone to crashing if the
loadable library throws an exception or crashes. Still, it should be fine
for well-behaved libraries. Requested by @Shougo.
2014-06-28 14:42:59 -04:00
Stefan Hoffmann
147ab48d1c FileID: remove CHECK_INODE macro 2014-06-27 13:59:29 +02:00
Stefan Hoffmann
cc02c3537d FileID: remove last use of st_ino in memline.c
* FileID can’t be used in memline.c, because the block0 is defined to
use only a 32bit ino.
* implemented `os_file_info_get_inode`
* deprecated `os_file_info_get_inode
2014-06-27 13:59:29 +02:00
Stefan Hoffmann
a0394f5e77 FileID: make os_stat() static 2014-06-27 13:59:29 +02:00
Stefan Hoffmann
de35948960 FileID: refactor os_unix.c to use FileID 2014-06-27 13:59:29 +02:00
Stefan Hoffmann
21af178b14 FileID: refactor path.c to use FileID 2014-06-27 13:59:29 +02:00
Stefan Hoffmann
7340f619d7 FileID: refactor if_cscope.c to use FileID 2014-06-27 13:59:29 +02:00
Stefan Hoffmann
d3257c4ddf FileID: refactor file_search.c to use FileID 2014-06-27 13:59:29 +02:00
Stefan Hoffmann
fc2a668c7c FileID: refactor ex_cmds2.c to use FileID 2014-06-27 13:59:28 +02:00
Stefan Hoffmann
a294a0e1c5 FileID: refactor buffer.c to use FileID 2014-06-27 13:59:28 +02:00
Stefan Hoffmann
d8ec5ef88d FileID: remove INVALID_DEVICE_ID macro 2014-06-27 13:59:28 +02:00
Stefan Hoffmann
4a22fb06b9 FileID: implement FileID struct
`FileID` should encapsulate `st_dev` and `st_ino`. It is a new abstraction
used to check if two files are the same. `FileID`s will be embeded inside
other struts like `buf_t` or `ff_visited_T`, where a full `FileInfo` would be
to big.
2014-06-27 13:59:28 +02:00
Thiago de Arruda
296da85198 channel/msgpack_rpc: Refactor API dispatching
This is how API dispatching worked before this commit:

- The generated `msgpack_rpc_dispatch` function receives a the `msgpack_packer`
  argument.
- The response is incrementally built while validating/calling the API.
- Return values/errors are also packed into the `msgpack_packer` while the
  final response is being calculated.

Now the `msgpack_packer` argument is no longer provided, and the
`msgpack_rpc_dispatch` function returns `Object`/`Error` values to
`msgpack_rpc_call`, which will use those values to build the response in a
single pass.

This was done because the new `channel_send_call` function created the
possibility of having recursive API invocations, and this wasn't possible when
sharing a single `msgpack_sbuffer` across call frames(it was shared implicitly
through the `msgpack_packer` instance).

Since we only start to build the response when the necessary information has
been computed, it's now safe to share a single `msgpack_sbuffer` instance
across all channels and API invocations.

Some other changes also had to be performed:

- Handling of the metadata discover was moved to `msgpack_rpc_call`
- Expose more types as subtypes of `Object`, this was required to forward the
  return value from `msgpack_rpc_dispatch` to `msgpack_rpc_call`
- Added more helper macros for casting API types to `Object`
  any
2014-06-24 13:02:24 -03:00
Thiago de Arruda
bc0380038e channel/msgpack_rpc: Refactor to better split functions across modules
Move validation/conversion functions and to msgpack_rpc_helpers to separate
those from the functions that are used from the channel module
2014-06-24 13:02:24 -03:00
Thiago de Arruda
ea7a389ec7 channel: Implement the 'channel_send_call' function
This function is used to send RPC calls to clients. In contrast to
`channel_send_event`, this function will block until the client sends a
response(But it will continue processing requests from that client).

The RPC call stack has a maximum depth of 20.
2014-06-24 13:02:24 -03:00
Thiago de Arruda
09605cec03 channel/msgpack_rpc: Refactor msgpack_rpc_notification/serialize_event
- Generalize some argument names(event type -> event name,
                                 event data -> event arg)
- Rename serialize_event to serialize_message
- Rename msgpack_rpc_notification to msgpack_rpc_message
- Extract the message type out of msgpack_rpc_message
- Add 'id' parameter to msgpack_rpc_message/serialize_message to create messages
  that are not notifications
2014-06-24 13:02:24 -03:00
Thiago de Arruda
c0b0bd07fd channel: Extract function for sending errors that are not responses 2014-06-24 13:02:24 -03:00
Thiago de Arruda
c8297e462a channel: Extract 'channel_write' function 2014-06-24 13:02:24 -03:00
Thiago de Arruda
0dea2682dc job: Add a maxmem parameter to job_start
The value is forwarded to it's own WStream instance
2014-06-24 13:02:24 -03:00
Thiago de Arruda
c722e22ee6 wstream: Make wstream_write consider the return value from uv_write 2014-06-24 13:02:23 -03:00
Thiago de Arruda
30fc6a4fd1 wstream: Use a default value of 10mb for maxmem when 0 is passed 2014-06-24 13:02:23 -03:00
Thiago de Arruda
11916b6b59 wstream: Refactor buffer memory management
- Extract code to release WBuffer instances into `release_wbuffer`
- Fix memory leak when wstream_write returns false
2014-06-24 13:02:23 -03:00