Commit Graph

411 Commits

Author SHA1 Message Date
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
Stefan Hoffmann
5d074a0aa6 fileinfo: rename os_get_file_info{,_link,_fd} 2014-08-31 15:37:55 +02:00
Stefan Hoffmann
aa378acdf5 fileinfo: implement os_fileinfo_size
this replaces os_get_file_size and file_info.stat.st_size
2014-08-31 15:15:02 +02:00
Thiago de Arruda
a66d2d1538 msgpack-rpc: Always use arrays when sending events or calls
This is required by the msgpack-RPC specification. Also, the
send_call/send_event functions were refactored to accept a variable number of
arguments
2014-08-29 22:08:58 -03:00
Justin M. Keyes
e1c330a486 Merge pull request #1024 from war1025/dev/for_all_buffers
Add FOR_ALL_BUFFERS helper
2014-08-19 23:49:25 -04:00
Justin M. Keyes
a0e593e261 Merge pull request #1019 from splinterofchaos/globpath
vim-patch:7.4.279
2014-08-18 00:27:07 -04:00
Wayne Rowcliffe
888a31ba45 FOR_ALL_BUFFERS use locally declared buffer pointer 2014-08-17 11:13:42 -05:00
André Twupack
fde390133e vim-patch:7.4.327 #1010
Problem:    When 'verbose' is set to display the return value of a function, may get E724 repeatedly.
Solution:   Do not give an error for verbose messages. Abort conversion to string after an error.

https://code.google.com/p/vim/source/detail?r=99d8f2d72dcd4b850de81998cc9b1120c8165762
2014-08-13 13:49:06 -04:00
André Twupack
cb809069a8 vim-patch:7.4.323 #967
Problem:    Substitute() with zero width pattern breaks multi-byte character.
Solution:   Take multi-byte character size into account. (Yukihiro Nakadaira)

https://code.google.com/p/vim/source/detail?r=238f5027830cad22e17a970483af9b160869cdf3
2014-08-07 18:12:10 -04:00
Rui Abreu Ferreira
1dea4044e7 Refactor vim_feedkeys and f_feedkeys
- To clean up the mix between feedkeys and replace_termcodes
  the vim_feedkeys API function now does the same thing as the
  vimscript feedkeys() function
- The original f_feedkeys() function now calls the vim_feedkeys()
  function from the API
2014-08-07 12:03:27 -03:00
Scott Prager
5617ee8f35 vim-patch:7.4.279
Problem:    globpath() returns a string, making it difficult to get a
            list of matches.  (Greg Novack)
Solution:   Add an optional argument like with glob().  (Adnan Zafar)

https://code.google.com/p/vim/source/detail?r=8e9db1f27a0063df023cc05a760fce73255dad24
2014-08-04 12:01:58 -04:00
Wayne Rowcliffe
8cf45786b1 Add FOR_ALL_BUFFERS helper 2014-08-02 20:19:33 -05:00
Pavel Platto
5881842007 Remove FEAT_TAG_ANYWHITE
This feature allow to use any white space characters instead of one
<TAB> in tag files. It is disabled in vanilla Vim's default build
configuration. Exuberant ctags use format with exactly one TAB.
2014-08-02 09:17:00 +03:00
Nicolas Hillegeer
e4be7bc27c eval: re-add has('mac') and has('macunix') #976
They were removed but they can be handy to separate some things to do at
startup in a .vimrc for example.
2014-07-30 18:26:32 -04:00
Nicolas Hillegeer
5f9fb6ed64 eval: re-remove USE_CR #1002
It was already removed in 01ca460 and I erroneously introduced it again in
PR #978.
2014-07-30 18:10:18 -04:00
Fredrik Fornwall
bfaab2e351 Remove FEAT_MOUSE_JSB
This is never built and references some obscure jsb terminal
2014-07-29 18:08:15 +02:00
oni-link
1ef12f0204 Remove unused arg 'defer' in 'job_start' #1000
* With the changes in commit
  "events: Refactor how event deferral is handled"
  (2e4ea29d2c) the function argument
  'defer' of 'job_start' and member variable 'defer' of 'struct job'
  can be removed.
* Update/Fix the documentation for function 'job_start'.
2014-07-29 13:29:54 +02:00
Nicolas Hillegeer
6f30b25f45 eval: reimplement f_system() on top of os_system()
This evades the tempfile problem (unless of course one manually adds
redirects to the shell commandline, which some plugins seem to do, e.g.:
vim-easytags).
2014-07-27 14:00:44 -03:00
Nicolas Hillegeer
6cbda2cbf6 viml: re-add sha256() function
Was removed in #699 but actually doesn't have anything to do with security.
2014-07-21 19:29:29 +02:00
Nicolas Hillegeer
fb15cbbaea startuptime: always enable startuptime
Removes the STARTUPTIME define.
2014-07-20 16:59:57 -04:00
Thiago de Arruda
486c8e37c1 provider: Add support for python commands/functions
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.
2014-07-17 11:37:41 -03:00
Thiago de Arruda
8a091e7f5c provider: Add support functions for calling external interpreters
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.
2014-07-17 11:37:41 -03:00
Thiago de Arruda
887d32e546 provider: New module used to expose extension points for core services
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.
2014-07-17 11:37:08 -03:00
Thiago de Arruda
bce4c365bc job: No longer free the job data. It's now done by the exit callback 2014-07-17 11:30:01 -03:00
Thiago de Arruda
0e20afe37e wstream: Pass WBuffer refcount as a constructor parameter
This is required to handle broadcasting when the first write fails.

Ref: 11916b6b59 (commitcomment-6792287)
2014-07-17 11:30:01 -03:00
Nicolas Hillegeer
db7cd61f62 profiling: implement on top of os_hrtime()
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/...
2014-07-16 17:12:34 +02:00
Pavel Platto
286ce271e7 Extract tempfile module from fileio
Though this module is relatively small it has very clear boundaries.
The last argument for extracting `tempfile` was the errors which I got
when I was writing unittests for it: `cimport './src/nvim/fileio.h'`
does not work for some reason.
2014-07-14 21:14:40 +02:00
Pavel Platto
29e0cd1571 Refactor vim_tempname
- temp_count is uint32_t now instead of long because it supposed to be
  at most 999999999 (comment on line 5227) temporary files. The most
  probably it was a long for compatibility with systems where int is
  16-bit.
- Use "nvim" as prefix for temp folder name instead of "v"
- Remove unused parameter from vim_tempname
2014-07-14 21:14:40 +02:00
Pavel Platto
47084ea765 Use strict function prototypes #945
`-Wstrict-prototypes` warn if a function is declared or defined without
specifying the argument types.

This warning disallow function prototypes with empty parameter list.
In C, a function declared with an empty parameter list accepts an
arbitrary number of arguments when being called. This is for historic
reasons; originally, C functions didn't have prototypes, as C evolved
from B, a typeless language. When prototypes were added, the original
typeless declarations were left in the language for backwards
compatibility.
Instead we should provide `void` in argument list to state
that function doesn't have arguments.

Also this warning disallow declaring type of the parameters after the
parentheses because Neovim header generator produce no declarations for
old-stlyle prototypes: it expects to find `{` after prototype.
2014-07-14 20:28:40 +02:00
Justin M. Keyes
180c84ed37 os_open: impl mch_open with libuv. ref #133
- use return value instead of open_req.result
- libuv uv_fs_open() returns `-errno` instead of always -1
- libuv always sets open_req.result to the return value, _except_ for OOM
  where it only sets the return value. So always use the return value.
- replace calls to mch_open macro.
- update call sites expecting -1 error
2014-07-14 09:04:54 -04:00
Brandon Coleman
a32df5e734 move defines from vim.h
buffer.h:
   buflist_getfile() flags
   buflist_new() flags
   buf_freeall() flags
   do_buffer() flags

charset.h:
   chartab[] flags

edit.h:
   in_cinkeys() flags
   change_indent() flags
   beginline() flags
   insertchar() flags
   nv_mousescroll() flags

eval.c
   AUTOLOAD_CHAR

eval.h:
   enum for vimvars[]

ex_cmds.h:
   do_ecmd
   read_viminfo flags

ex_cmds2.h:
   check_changed() flags
   do_source() flags

ex_cmds_defs.h:
   BAD_* flags

ex_docmd.h:
   VALID_PATH VALID_HEAD
   EXMODE_*
   do_cmdline() flags
added include

ex_getln.c
   *_ESC_CHARS definitions

ex_getln.h:
   history table flags - used by add_to_history()

fileio.h:
   readfile() flags
   event_T definition

getchar.h:
   ins_typebuf() flags
   KEYLEN_*

globals.h:
   NO_SCREEN
   NO_BUFFERS
   SEA_* defines
   current_SID flags
   hlf_T enum
   HL_FLAGS
   do_profiling() flags
   schar_T
   sattr_T

indent.h:
   set_indent() flags

macros.h:
   BINARY_FILE_IO flags

mbyte.h:
   MB_BYTE2LEN*
   ENC_*

memfile.h:
   mf_sync() flags

misc1.h:
   open_line() flags

message.h:
   do_dialog() flags
   vim_dialogyesno() flags
   DLG_BUTTON_*

normal.h:
   find_ident_under_cursor() flags

ops.h:
   do_put() flags
   operator ID's

option.h:
   buf_copy_options() flags
   OPT_* flags

os_unix.h:
   mch_nodetype() flags

quickfix.h:
   skip_vimgrep_pat() flags

regexp.h:
   vim_regcomp() flags
   values for reg_do_extmatch

search.h:
   do_search() flags
   search_regcomp() flags
   findmatchlimit() flags

syntax.h:
   HL_* flags
      HL_FOLD is used in buffer_defs.h but nvim
      compiles just fine with the defines in
      syntax.h

tag.h:
   do_tag() flags
   find_tags() flags

term.h:
   TBUFSZ flags
   MOUSE flags

ui.h:
   jump_to_mouse() flags

window.h:
   file_name_in_line() flags
   win_split() flags
   MIN_LINES
   MIN_COLUMNS

Remove VimClipboard which should have been removed with PR #921.
2014-07-12 14:26:55 +02:00
Will Stamper
1cdd4ff7f6 vim-patch:7.4.306 #842
Problem:    getchar(0) does not return Esc.
Solution:   Do not wait for an Esc sequence to be complete.  (Yasuhiro
            Matsumoto)

https://code.google.com/p/vim/source/detail?r=05e1d8afcc5e375bf708ccc9810e2fd1a5a8a3cf
2014-07-11 16:42:45 -04:00
Nicolas Hillegeer
94f488d1ca c99: remove vim_round #909
C89 did not have round(), vim emulated it with vim_round. But since we're
using C99 this is not a problem anymore.
2014-07-11 13:10:59 -04: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
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