Thiago de Arruda
ba11128077
API: Implement vim_eval
...
The vimscript object conversion function was adapted from the version found in
'if_py_both.h' in the upstream source. It was also required to re-add the
`dict_lookup` function that was lost during the initial import.
2014-05-12 21:26:56 -03:00
Thiago de Arruda
def747da7f
Fix jumps depending on unitialized values
...
Reported by valgrind
2014-05-12 21:26:56 -03:00
Stefan Hoffmann
8e8dae71da
replaced some mch_lstat()
2014-05-09 15:49:33 +02:00
Stefan Hoffmann
902ad8d94d
replaced some mch_stat() with os_get_file_info()
2014-05-09 15:49:33 +02:00
Stefan Hoffmann
9784dabb50
implemented os_file_get_size()
2014-05-09 15:49:33 +02:00
Stefan Hoffmann
d936bb82ad
use os_getperm() in f_getfperm()
2014-05-09 15:49:33 +02:00
Justin M. Keyes
df4f88fe31
Merge pull request #644 from philix/log
...
Macro-based log utility for Neovim
2014-05-06 21:50:25 -07:00
Felipe Oliveira Carvalho
151382d533
Introduce os_localtime_r() and os_get_local_time()
...
Replace localtime() with os_localtime_r() in `eval.c` and `undo.c`.
2014-05-06 09:22:39 -03:00
Matthias Beyer
f9d4c78ddc
replaced vim_free()
calls with free()
calls
2014-05-05 18:38:52 -04:00
Justin M. Keyes
1b5217687a
revert #652
...
reverting broad cosmetic/style change because:
- increases merge-conflicts
- increases overhead of merging upstream Vim patches
- reasons for change are ambiguous, so default to no change
2014-05-01 14:00:31 -04:00
Marco Hinz
5d65e7f279
vim-patch:7.4.272
...
Problem: Using just "$" does not cause an error message.
Solution: Check for empty environment variable name.
(Christian Brabandt)
https://code.google.com/p/vim/source/detail?r=00228400629e28384f7f52556c3c119ba0d0a44d
2014-04-30 11:21:46 -04:00
Marco Hinz
2e4613aecc
Remove NUL macro
2014-04-29 17:51:09 -03:00
Marco Hinz
046debb935
vim-patch:7.4.268
...
Problem: Using exists() on a funcref for a script-local function
does not work.
Solution: Translate <SNR> to the special byte sequence.
Add a test.
https://code.google.com/p/vim/source/detail?r=1a5ed2626b26a982e307a206572121a557adf709
2014-04-29 15:14:25 -03:00
oni-link
05d29fb0b8
Cleanup
...
* Remove unnecessary else
* Move variable declaration nearer to point of use
* Add missing curly brackets
* Comment style
2014-04-29 15:04:21 -03:00
oni-link
bee4f4f724
Call to rettv_list_alloc cannot fail.
...
Clean up the use of rettv_list_alloc and remove error checks.
2014-04-29 15:04:21 -03:00
oni-link
dc9b680deb
Call to list_append_tv cannot fail.
...
Clean up the use of list_append_tv and remove error checks.
2014-04-29 15:04:21 -03:00
oni-link
6797a3e788
Call to list_append_number cannot fail.
...
Clean up the use of list_append_number and remove error checks.
2014-04-29 15:04:21 -03:00
John
42efbfd2fd
Test and refactor shorten_fname
and shorten_fname1
...
Rename `shorten_fname` -> `path_shorten_fname`
Rename `shorten_fname1` -> `path_shorten_fname_if_possible`
2014-04-29 09:24:34 -03:00
oni-link
e772cfcc55
vim-patch:7.4.241
...
Problem: The string returned by submatch() does not distinguish between a
NL from a line break and a NL that stands for a NUL character.
Solution: Add a second argument to return a list. (ZyX)
https://code.google.com/p/vim/source/detail?r=a63d0cd691dc925283815d17d62f4e948d723a59
2014-04-28 16:16:40 -03:00
Klemen Košir
d4f8a86700
vim-patch:7.4.265
...
Problem: Can't call a global function with "g:" in an expression.
Solution: Skip the "g:" when looking up the function.
https://code.google.com/p/vim/source/detail?r=8ec9d2196bee0c5108f2d2c196a660a7f4e5f29f
2014-04-28 13:26:04 -03:00
Marco Hinz
9b9c1dee13
vim-patch:7.4.264
...
Problem: Can't define a function starting with "g:". Can't assign a
funcref to a buffer-local variable.
Solution: Skip "g:" at the start of a function name.
Don't check for colons when assigning to a variable.
https://code.google.com/p/vim/source/detail?r=00acac0af680c2d8c82db5258474b121a5908926
2014-04-28 08:00:28 -03:00
Eliseo Martínez
e194324885
Use portable format specifiers: Clarify some casted expressions.
...
Though correct (to my understanding), some of the casts introduced in
previous commits could lead to confusion, by casting only the first
expression component instead of the whole expression.
This fixes that, parenthesizing casted expressions, except where
operator precedence rules make it unneccesary.
2014-04-28 07:59:25 -03:00
oni-link
38ac85da87
Call to list_append_string cannot fail.
...
Clean up the use of list_append_string and remove error checks.
2014-04-28 07:46:24 -03:00
oni-link
8d5a546d3f
Call to list_append_dict cannot fail.
...
Clean up the use of list_append_dict and remove error checks.
2014-04-28 07:46:24 -03:00
Chris Watkins
9da32a1f78
Remove code and checks for unsupported systems.
...
Remove remnants of support for systems including
__EMX__, MSDOS, OS2, AMIGA and MORPHOS.
2014-04-28 07:43:57 -03:00
John Schmidt
4e1b364a3e
Remove alloc_clear
...
Use `xcalloc` instead.
Inline `alloc_tv` and `alloc_string_tv` in eval.c
2014-04-28 07:41:45 -03:00
Marco Hinz
342764d70e
vim-patch:7.4.260
...
Problem: It is possible to define a function with a colon in the name. It
is possible to define a function with a lower case character if a
"#" appears after the name.
Solution: Disallow using a colon other than with "s:". Ignore "#" after the
name.
https://code.google.com/p/vim/source/detail?r=6bc874e4789a0f912b4fd6b23afecf19d80b1605
2014-04-25 14:09:04 -03:00
Felipe Oliveira Carvalho
3f38c384ef
Add cast to unsigned to improve div by 2 in find_internal_func()
2014-04-24 10:32:47 -03:00
Felipe Oliveira Carvalho
db23cb05d1
Use /2 and 2* instead of >>1 and <<1 which are tricky with signed types
...
Today's compilers generate shift instructions to perform division and
multiplications by powers of 2 [1]. `(x >> 1)` looks straightforward enough, but
if x is signed the code will fail when x < 0. The compiler knows better: use
`x / 2`.
That's why we have code like this:
(long)((long_u)Rows >> 1))
instead of the cleaner version that generates the same or better machine code:
Rows / 2
[1] http://goo.gl/J4WpG7
2014-04-24 10:32:47 -03:00
Felipe Oliveira Carvalho
28b03dd190
No OOM error conditions in some functions of window.c
...
- alloc_tabpage()
- win_alloc_lines()
- win_alloc_aucmd_win()
- new_frame()
- win_alloc()
TODO: don't handle OOM after calls to dict_alloc()
2014-04-24 10:31:31 -03:00
oni-link
471da2de81
vim-patch:7.4.237
...
Problem: When some patches was not included has("patch-7.4.123") may return
true falsely.
Solution: Check for the specific patch number.
https://code.google.com/p/vim/source/detail?r=71b165a378ad580818f6d497ecf0f8ad054a9683
2014-04-24 10:30:36 -03:00
Eliseo Martínez
28bac30c19
Use portable format specifiers: Case %ld - localized - N_.
...
Fix uses of plain "%ld" within N_():
- Replace "%ld" with "%" PRId64.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
bf3b9d0ecb
Use portable format specifiers: Case %ld - plain - EMSGN.
...
Fix uses of plain "%ld" within EMSGN():
- Replace "%ld" with "%" PRId64.
- No argument cast needed. EMSGN() will take care of that.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
c049cb2b51
Use portable format specifiers: Case %ld - localized - smsg.
...
Fix uses of localized "%ld" within smsg():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
fb94edf373
Use portable format specifiers: Case %ld - plain - sprintf.
...
Fix uses of plain "%ld" within sprintf():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
oni-link
971fd3e18e
vim-patch:7.4.236
...
Problem: It's not that easy to check the Vim patch version.
Solution: Make has("patch-7.4.123") work. (partly by Marc Weber)
https://code.google.com/p/vim/source/detail?r=a44087db72386d080e9da870d751daf498004be8
2014-04-19 09:40:18 -03:00
Thiago de Arruda
7fb36ebb1d
Remove unnecessary cleanup label from job_start
...
The argument vector is now freed in the `close_cb` function in job.c
2014-04-18 16:12:00 -03:00
Thiago de Arruda
9acb960713
Refactor job control to use RStream events
...
Instead of a single 'job read' callback, job control consumers need to provide
callbacks for "stdout read", "stderr read" and "exit". For vimscript, the
JobActivity autocommand is still used to handle every job event, for example:
```vim
:let srv1_id = jobstart('netcat-server-1', 'nc', ['-l', '9991'])
:let srv2_id = jobstart('netcat-server-2', 'nc', ['-l', '9991'])
function JobEvent()
" v:job_data[0] = the job id
" v:job_data[1] = the event type, one of "stdout", "stderr" or "exit"
" v:job_data[2] = data read from stdout or stderr
if v:job_data[1] == 'stdout'
let str = 'Message from job '.v:job_data[0].': '.v:job_data[2]
elseif v:job_data[1] == 'stderr'
let str = 'Error message from job '.v:job_data[0].': '.v:job_data[2]
else
" Exit
let str = 'Job '.v:job_data[0].' exited'
endif
call append(line('$'), str)
endfunction
au JobActivity netcat-server-* call JobEvent()
```
And to see messages from 'job 1', run in another terminal:
```sh
bash -c "while true; do echo 123; sleep 1; done" | nc localhost 9991
```
2014-04-18 16:11:59 -03:00
Marco Hinz
43c6ec6803
Remove modelines
...
Removed modelines are better than modelines that differ from file to
file.
2014-04-16 14:03:19 -03:00
Thiago de Arruda
6e4e40a0f7
Refactor job control module to use RStream class
2014-04-16 09:56:45 -03:00
Marco Hinz
62d6564b09
vim-patch:7.4.234
...
Problem: Can't get the command that was used to start Vim.
Solution: Add v:progpath. (Viktor Kojouharov)
https://code.google.com/p/vim/source/detail?r=d2286df8719d6e99c743e3bf6ac14d1f9debc84d
2014-04-16 09:41:47 -03:00
Marco Hinz
d322be894e
vim-patch:7.4.229
...
Problem: Using ":let" for listing variables and the second one is a
curly braces expression may fail.
Solution: Check for an "=" in a better way. (ZyX)
https://code.google.com/p/vim/source/detail?r=839cca5ec18d560e3714065e54ed38b6e812aaf7
2014-04-16 09:32:50 -03:00
Marco Hinz
f54c050cf3
vim-patch:7.4.218
...
Problem: It's not easy to remove duplicates from a list.
Solution: Add the uniq() function. (LCD)
https://code.google.com/p/vim/source/detail?r=ddc3f32a4b2191f829206322d46f0e9c7e365e22
2014-04-16 09:29:33 -03:00
oni-link
a881273dad
vim-patch:7.4.191
...
Problem: Escaping a file name for shell commands can't be done without a
function.
Solution: Add the :S file name modifier.
https://code.google.com/p/vim/source/detail?r=40f18a1c1592c8b4047f6f2a413557f48a99c55f
2014-04-14 09:54:40 -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
a1df458524
removed mch_remove macro
2014-04-11 13:31:48 -03:00
Felipe Oliveira Carvalho
f6b0e335e1
Remove OOM error handling code after ga_grow() calls
2014-04-11 12:57:59 -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