Commit Graph

3110 Commits

Author SHA1 Message Date
ZyX
98e8c1f37c shada: Refactor file reading/writing to use os_open 2015-10-08 21:59:56 +03:00
ZyX
d1ae27ceec shada,functests: Refactor shada items skipping 2015-10-08 21:59:56 +03:00
ZyX
941ec54aa1 shada: Reassign some entry types to WantInfo and WantMarks
kShaDaWantMarks now loads only local file change list and file-local marks.
kShaDaWantInfo now loads global marks and jump list.
2015-10-08 21:59:55 +03:00
ZyX
8c93877e1c shada: Add support for dumping and restoring buffer list 2015-10-08 21:59:55 +03:00
ZyX
4eeafe7f72 shada: Use pre-populated set of buffers on removable media
Should be faster then constantly running shada_removable for each buffer many
times.
2015-10-08 21:59:54 +03:00
ZyX
75c9a7e65b shada: Do not record removable buffers and marks 2015-10-08 21:59:54 +03:00
ZyX
200e62efeb shada: Add support for dumping/restoring bufs changes and win jumps 2015-10-08 21:59:53 +03:00
ZyX
0fe9679101 shada: Initial support for merging history
Currently only merges history when reading ShaDa file. No tests yet.
2015-10-08 21:59:53 +03:00
ZyX
94ed7ba03b shada: Skip reading some items if needed
Avoids unneeded malloc()s/free()s and lots of code for parsing.
2015-10-08 21:59:53 +03:00
ZyX
5e34d4873b main: Read marks at startup
I do not know why marks were not read originally, but without this change marks
are not going to be read at startup when Vim starts without arguments.
2015-10-08 21:59:52 +03:00
ZyX
38c688d7be shada: Use glibc functions to convert from big endian, add a fallback 2015-10-08 21:59:51 +03:00
ZyX
244dbe3a77 viminfo: First version of ShaDa file dumping
What works:

1. ShaDa file dumping: header, registers, jump list, history, search patterns,
   substitute strings, variables.
2. ShaDa file reading: registers, global marks, variables.

Most was not tested.

TODO:

1. Merging.
2. Reading history, local marks, jump and buffer lists.
3. Documentation update.
4. Converting some data from &encoding.
5. Safer variant of dumping viminfo (dump to temporary file then rename).
6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for
   reference).
2015-10-08 21:59:51 +03:00
ZyX
0fdaab995e mark: Fix valgrind error in mark.c
Caused by using memcpy for assigning one structure to another.
2015-10-08 21:59:51 +03:00
ZyX
c71dca0cbd os/fs: Define os_strerror as an alias to uv_strerror
It is not needed to know that os/* uses libuv.
2015-10-08 21:59:50 +03:00
Björn Linse
57d3a2a52f api: represent api type String as msgpack type STR. closes #1250 2015-10-08 20:18:46 +02:00
Daniel Hahler
8cfcf01475 tui: fix_terminfo: Handle "tmux" like "screen". #3422
Closes #3399
2015-10-04 14:20:27 -04:00
bambu
2788f7fcc8 menu: support :emenu invoked by cmenu map. 2015-10-03 03:02:05 -04:00
Thiago de Arruda
2182cd6081 ex_docmd: Fix terminal mode check condition for ex_normal
Using the `curbuf->terminal` condition alone is wrong since it does not
necessarily mean nvim is in terminal mode. It needs to be used with
`State & TERM_FOCUS` because the current buffer could have changed without
`terminal_enter` exiting.

Close #3403
2015-10-01 15:22:49 -03:00
Thiago de Arruda
0ca3f03c19 tui: Fix queueing of large chunks of input
Take the return value of input_enqueue into consideration, waiting for the main
thread to consume input. Close #1714 #3377.
2015-10-01 15:22:49 -03:00
Thiago de Arruda
394c0c4402 rbuffer: Enhance rbuffer_reset to work with filled RBuffers 2015-10-01 15:22:49 -03:00
Thiago de Arruda
0e4e69e52e os/input: Don't advance past incomplete sequences in input_enqueue
This allows callers to incrementally process buffers that are filled by
incomplete chunks more easily.
2015-10-01 15:22:49 -03:00
Thiago de Arruda
1143b416ab tui: Don't use 'pastetoggle' for automatic pasting
Add a new special key that can be used by UIs to toggle the 'paste' option and
use it in the TUI instead of the user's 'pastetoggle' value.

Close #2843 #2092
2015-10-01 15:22:48 -03:00
Thiago de Arruda
c1edd07990 shell: Ensure silent bang mappings won't cut output
Setting `msg_didout` after `call_shell` is enough as it will cause
`hit_return_msg()` to print on next line.

Close #3269
2015-10-01 15:22:48 -03:00
Justin M. Keyes
afe8a32be0 Merge pull request #3410 from oni-link/fix.spell_suggest
spell.c: Fix memory leak
2015-10-01 13:22:02 -04:00
Justin M. Keyes
bb5bf96839 Merge pull request #3407 from oni-link/fix.ga_concat
garray.c: Prevent ga_concat() using memcpy(NULL,...)
2015-10-01 13:19:49 -04:00
oni-link
2fb77ba6f9 spell.c: Fix memory leak 2015-10-01 12:34:13 +02:00
oni-link
0320d86d3b garray.c: Prevent ga_concat() using memcpy(NULL,...)
Calling ga_grow(gap, 0) does not reallocate memory for garray gap.
Because of this, gap->ga_data can be NULL after such a call, if gap does
not have memory allocated.
2015-09-30 19:11:07 +02:00
ZyX
b6fdb7bd0f eval/string(): Share code between msgpackdump() and string()+:echo 2015-09-30 10:12:35 +03:00
ZyX
6da3fadd9f eval/msgpackdump(): Use copyID for protecting against recursive input
Should be faster then O(depth) iteration, but removes const qualifiers.
2015-09-30 10:09:21 +03:00
Justin M. Keyes
622ec95c3f Merge pull request #3321 from cHoco/fix-append-api-implementation-2
Fix append() with negative line numbers.
2015-09-27 20:33:19 -04:00
Felipe Morales
b927304108 defaults: revert wildmode to 'full' 2015-09-26 21:09:47 +02:00
Pavlos Vinieratos
e073074414 ex_menu: use bool. #3389 2015-09-25 21:15:10 -04:00
Rui Abreu Ferreira
e70d6283b6 Remove VLA from path_get_absolute_path
Remove the use of Variable Length Arrays in path_get_absolute_path(), and use
xmalloc/xfree instead.
2015-09-24 16:50:33 +01:00
cztchoice
ef5ee31452 Enable -Wconversion: if_cscope.c #3068
Helped-by: Gustaf Lindstedt <gustaflindstedt@gmail.com>
Helped-by: Wander Nauta <info@wandernauta.nl>
2015-09-23 21:43:29 -04:00
Justin M. Keyes
6eb78dcaaa nv_ident: sprintf => snprintf
Also fix some other clint errors.
2015-09-23 00:06:27 -04:00
Justin M. Keyes
998d0ffc09 'keywordprg': support ex commands
- new feature: if the first character of 'keywordprg' is ":", the
  command is invoked as a Vim ex-command prefixed with [count].
- change default 'keywordprg' to :Man
2015-09-23 00:05:33 -04:00
Justin M. Keyes
481049e0c9 build: remove USEMAN_S 2015-09-23 00:05:32 -04:00
Enrico Ghirardi
8ab09087da Fix append() without line argument
We want to switch include_start/end when the index is positive or
negative.
2015-09-20 12:38:41 +02:00
ZyX
924058c00f eval/msgpackparse(): Fix crash by adding return at error 2015-09-19 01:54:43 +03:00
Thiago de Arruda
e897ccad3e terminal: Don't store a buf_T reference in the terminal struct
Since vimscript can close buffers at any time, it is possible that a
refresh_timer_cb will be called with an invalid buffer, but there's no way to
detect this if only a reference is stored because the memory can be reused by
the allocator. Use buf_T->handle which is guaranteed to be unique.
2015-09-18 14:50:36 -03:00
Thiago de Arruda
47cbbc0b8c terminal: Run screen refresh timer in a deferred queue
Close #3332
2015-09-18 14:35:26 -03:00
Thiago de Arruda
1f90cbb4ae ugrid: Increase cell size to allow unicode composition
Close #3323
2015-09-18 14:35:26 -03:00
Thiago de Arruda
1b1716477c terminal: Don't enter terminal mode from :normal
Ref: https://github.com/junegunn/fzf.vim/issues/8#issuecomment-139209765
2015-09-18 14:35:26 -03:00
Thiago de Arruda
b7dab423ef eval: Fix ex_delfunction to use the uf_refcount field properly
@4b98ea1e80bf changed how refcounts are handled internally to fit into job
control semantics. Change the refcount check in `ex_delfunction` to consider
this. Close #3000
2015-09-18 14:35:26 -03:00
Thiago de Arruda
0a116c828d regexp: Fix invalid multibyte reads at end of strings
Close #3150
2015-09-18 14:35:26 -03:00
Thiago de Arruda
c708061a5a os/path: Fix path_get_absolute_path for top-level paths
Close #2833
2015-09-18 14:35:26 -03:00
Thiago de Arruda
29b998be68 ui_bridge: Fix passing NULL pointer to memcpy 2015-09-18 14:35:26 -03:00
Jakob Schnitzer
fcd314223d options: unify undolevels default
Considering Nvim's supported platforms, having a different default for
(!Unix and !Windows) doesn't seem very useful.
2015-09-17 19:38:24 +02:00
Björn Linse
8c2481806d api: vim_err_write: don't wait for return in the middle of a message 2015-09-16 21:42:57 +02:00
Thiago de Arruda
22ea2900d0 loop: Free the parent queue last when destroying the loop
This avoids a heap-use-after-free ASAN error. Close #3334
2015-09-16 02:52:55 -03:00