aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
Commit message (Collapse)AuthorAge
...
| * eval: Fix PVS/V560: unneded check for name_lenZyX2018-04-10
| | | | | | | | It is unsigned, zero length would already cause early return and length 1 is checked earlier in the same condition.
| * eval: Fix PVS/V547: ufunc_T is actually an incomplete typeZyX2018-04-10
| |
| * charset,*: Refactor transstr()ZyX2018-04-09
| |
* | Merge #6272 'stdpath()'Justin M. Keyes2018-04-15
|\ \
| * | eval: Add stdpath() method (#5297)Christian Höltje2018-03-29
| | | | | | | | | | | | | | | | | | Adds the :stdpath method for fetching XDG standard directories. Fixes #5297
* | | serverstop(): return FALSE for invalid addressJustin M. Keyes2018-04-11
| |/ |/|
* | timer_pause: stop the timer resource (#8199)Utkarsh Maheshwari2018-03-30
|/ | | | | If the timer isn't stopped, it still emits events which consume some CPU. Fix #8188
* refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
|
* refactor: eliminate `autocmd_fname_full` globalJustin M. Keyes2018-03-24
| | | | | | | | It's a micro-optimization; check path_is_absolute_path(autocmd_fname) instead. The main optimization (which is still in place) afforded by Vim 7.2.021 was to avoid resolving <afile> when it is not needed.
* provider/RPC: apply_autocmds_group(): fix double-freeJustin M. Keyes2018-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During provider dispatch, eval_call_provider() saves global state--including pointers, such as `autocmd_fname`--into `provider_caller_scope` which is later restored by f_rpcrequest(). But `autocmd_fname` is special-cased in eval_vars(), for performance (see Vim patch 7.2.021; this is also the singular purpose of the `autocmd_fname_full` global. Yay!) If eval_vars() frees `autocmd_fname` then its provider-RPC-scoped alias becomes a problem. Solution: Don't free autocmd_fname in eval_vars(), just copy into it. closes #5245 closes #5617 Reference ------------------------------------------------------------------------ Vim patch 7.2.021 https://github.com/vim/vim/commit/f6dad43c98f47da1ff9d8c99b320fc3674f83c63 Problem: When executing autocommands getting the full file name may be slow. (David Kotchan) Solution: Postpone calling FullName_save() until autocmd_fname is used. vim_dev discussion (2008): "Problem with CursorMoved AutoCommand when Editing Files on a Remote WIndows Share" https://groups.google.com/d/msg/vim_dev/kj95weZa_eE/GTgj4aq5sIgJ
* log/channels: Formatting. Also log loopback channel. #8146Justin M. Keyes2018-03-18
|
* Merge #8084 'build/win: support MSVC'Justin M. Keyes2018-03-08
|\
| * build/msvc: Fix errors caused by compiler intrinsicsb-r-o-c-k2018-03-04
| |
* | vim-patch:8.0.0513: fix getting name of cleared highlight group (#8103)KunMing Xie2018-03-08
|/ | | | | | | Problem: Getting name of cleared highlight group is wrong. (Matt Wozniski) Solution: Only skip over cleared names for completion. (closes vim/vim#1592) Also fix that a cleared group causes duplicate completions. https://github.com/vim/vim/commit/c96272e30e2b81e5e0c8418f09d9db4e2fcd5d73
* shell: use msg_outtrans_len_attr for :!cmdBjörn Linse2018-02-05
| | | | fixes #7830 and #7788
* provider: make has('ruby') only return 1 if gem is installed (#7944)Marco Hinz2018-02-01
|
* win: has("wsl") on Windows Subsystem for Linux #7330Mahmoud Al-Qudsi2018-01-30
| | | | | | | | | | | | | Per CMAKE docs, CMAKE_HOST_SYSTEM_VERSION is the result of `uname -r`: https://cmake.org/cmake/help/v3.4/variable/CMAKE_HOST_SYSTEM_VERSION.html?highlight=uname A numeric version string for the system. On systems that support uname, this variable is set to the output of uname -r. On other systems this is set to major-minor version numbers. On Windows it is something like "6.1", so it won't match ".*-Microsoft". Closes #7329
* eval: save_tv_as_string: Correctly handle an empty stringJames McCoy2018-01-23
| | | | | | | | When tv_get_string_chk returns a non-NULL value, we have a valid string. Propagating an error state (*len = -1, NULL return) for an empty string is invalid. Closes #6554
* vim-patch:8.0.0659: no test for conceal modeJustin M. Keyes2018-01-21
| | | | | | | Problem: No test for conceal mode. Solution: Add a conceal mode test. (Dominique Pelle, closes vim/vim#1783) https://github.com/vim/vim/commit/4d785895d1f8b54cdd3fabd87446ca692f49e94e
* vim-patch:8.0.0655: not easy to make sure a function does not existJustin M. Keyes2018-01-21
| | | | | | | Problem: Not easy to make sure a function does not exist. Solution: Add ! as an optional argument to :delfunc. https://github.com/vim/vim/commit/d6abcd154cdc6a8dd4b7c6ccad37617ea8a1b4aa
* get_buffer_lines: Return a string, when requested, on invalid inputJames McCoy2018-01-15
| | | | Closes #7859
* Merge #7858 'vim-patch: spell-related patches'Justin M. Keyes2018-01-16
|\
| * vim-patch:8.0.1419: cursor column is not updated after ]sJustin M. Keyes2018-01-16
| | | | | | | | | | | | | | Problem: Cursor column is not updated after ]s. (Gary Johnson) Solution: Set the curswant flag. https://github.com/vim/vim/commit/b73fa629d6d3d705c1f8e8d5f8109fc9abd7bb6f
* | vim-patch:8.0.0151,3,4 #7389Justin M. Keyes2018-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:8.0.0151 Problem: To pass buffer content to system() and systemlist() one has to first create a string or list. Solution: Allow passing a buffer number. (LemonBoy, closes vim/vim#1240) https://github.com/vim/vim/commit/12c4492dd35e0cd83c8816be2ec849b836109882 vim-patch:8.0.0153 Problem: system() test fails on MS-Windows. Solution: Deal when extra space and CR. https://github.com/vim/vim/commit/9d9c35651712b88c81f1ae11091de1fd0bbbd35c vim-patch:8.0.0154 Problem: system() test fails on OS/X. Solution: Deal with leading spaces. https://github.com/vim/vim/commit/31f19ce0a052f7c76d44a9a190e468c79cf5d56d
* | Merge #7806 from ZyX-I/list-statJustin M. Keyes2018-01-15
|\ \ | | | | | | Add a way to collect list usage statistics
| * | eval/typval: Log list actionsZyX2018-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New logging is guarded by cmake LOG_LIST_ACTIONS define. To make it more efficient it is allocated as a linked list with chunks of length 2^(7+chunk_num); that uses basically the same idea as behind increasing kvec length (make appending O(1) (amortized)), but reduces constant by not bothering to move memory around what realloc() would surely do: it is not like we need random access to log entries here to justify usage of a single continuous memory block.
| * | *: Provide list length when allocating listsZyX2018-01-14
| |/
* / coverity/161216: get_user_input: RETURN_LOCALJustin M. Keyes2018-01-11
|/ | | | | | | | | | | | | | | | | | | *** CID 161216: Memory - illegal accesses (RETURN_LOCAL) /src/nvim/eval.c: 11143 in get_user_input() 11137 rettv->vval.v_string = 11138 (char_u *)getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, 11139 xp_type, xp_arg, input_callback); 11140 ex_normal_busy = save_ex_normal_busy; 11141 callback_free(&input_callback); 11142 >>> CID 161216: Memory - illegal accesses (RETURN_LOCAL) >>> Using "cancelreturn", which points to an out-of-scope variable "def". 11143 if (rettv->vval.v_string == NULL && cancelreturn != NULL) { 11144 rettv->vval.v_string = (char_u *)xstrdup(cancelreturn); 11145 } 11146 11147 xfree(xp_arg); 11148
* api: nvim_command_output: direct implJustin M. Keyes2018-01-10
|
* api: change nvim_command_output behaviorJustin M. Keyes2018-01-10
| | | | | | | | | | | | | | | | | | | Implement nvim_command_output with `execute({cmd},"silent")`. Behavior changes: - does not provoke any hit-enter prompt - no longer prepends a newline char - does not capture some noise (like the "[New File]" message, see the change to tabnewentered_spec.lua) Technically ("bug-for-bug") this a breaking change. But the previous behavior of nvim_command_output meant that it probably wasn't used for anything outside of tests. Also remove the undocumented `v:command_output` variable which was a hack introduced only for the purposes of nvim_command_output. closes #7726
* vim-patch:8.0.0352: not easy to see when a typval needs to be clearedckelsel2018-01-08
| | | | | | | | Problem: The condition for when a typval needs to be cleared is too complicated. Solution: Init the type to VAR_UNKNOWN and clear it always. https://github.com/vim/vim/commit/f06e5a549f42396be3478ccc1b5f03be64e1173e
* Merge #7805 'eval.c: fix some scan-build warnings'Justin M. Keyes2018-01-03
|\
| * Add null check when adding variable to dict.Paul Rigge2018-01-02
| |
| * Add null pointer assertions for do_unlet_var.Paul Rigge2018-01-02
| |
| * Refactor profiling check in call_user_func.Paul Rigge2018-01-02
| | | | | | | | | | | | | | | | | | do_profiling is a global variable, and as such the clang static analyzer has trouble making arguments about it. This commit does one comparison against do_profiling and puts the result in a local variable. This prevents errors from the value of do_profiling changing between comparisons.
| * Add assertions for watchersPaul Rigge2018-01-02
| | | | | | | | | | | | The clang static analyzer convinced itself lp->ll_newkey could be NULL. This adds an assertion that checks this doesn't actually happen, as well as a parallel assertion for di->di_key.
| * Add assertion in set_var_lval for null pointer.Paul Rigge2018-01-02
|/ | | | If the lval is a index into a list, li should not be null.
* eval: Fix linter errorsZyX2017-12-31
|
* eval,lua/converter: Fix problems spotted in reviewZyX2017-12-31
|
* eval: Refactor some potentially dangerous list appendsZyX2017-12-25
|
* eval: Remove magic numbers from find_some_match() type argumentZyX2017-12-25
|
* eval: Replace some tv_list_item_remove() callsZyX2017-12-24
| | | | | There is nothing wrong with them, just it is generally better to remove a range then to remove items individually.
* eval: Rename tv_list_remove_items() to tv_list_drop_items()ZyX2017-12-24
| | | tv_list_remove_items() may cause confusion with tv_list_item_remove()
* eval/typval: Make tv_list_item_remove return pointer to the next itemZyX2017-12-24
|
* *: Remove most calls to tv_list_item_allocZyX2017-12-24
| | | | Still left calls in eval/typval.c and test/unit/eval/helpers.lua. Latter is the only reason why function did not receive `static` modifier.
* Merge branch 'master' into hide-container-implZyX2017-12-23
|\
| * vim-patch:8.0.0590: cannot add a context to locationsJames McCoy2017-12-19
| | | | | | | | | | | | | | | | Problem: Cannot add a context to locations. Solution: Add the "context" entry in location entries. (Yegappan Lakshmanan, closes vim/vim#1012) https://github.com/vim/vim/commit/8f77c5a4ec756f3f866bd6b18feb6fca6f2a2e91
| * vim-patch:8.0.0517: there is no way to remove quickfix listsJames McCoy2017-12-18
| | | | | | | | | | | | | | | | Problem: There is no way to remove quickfix lists (for testing). Solution: Add the 'f' action to setqflist(). Add tests. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/b6fa30ccc39cdb7f1d07b99fe2f4c6b61671dac2
* | eval: Fix some issues found in reviewZyX2017-12-17
| |
* | Merge branch 'master' into hide-container-implZyX2017-12-16
|\|