aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memory.c
Commit message (Collapse)AuthorAge
* vim-patch:8.1.1693: syntax coloring and highlighting is in one big file (#17721)Lewis Russell2022-03-18
| | | | | | | | | | | Problem: Syntax coloring and highlighting is in one big file. Solution: Move the highlighting to a separate file. (Yegappan Lakshmanan, closes vim/vim#4674) https://github.com/vim/vim/commit/f9cc9f209ede9f15959e4c2351e970477c139614 Name the new file highlight_group.c instead. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor(decorations): move provider codeLewis Russell2022-03-10
| | | | Move decoration provider code to a separate file.
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* Merge pull request #15840 from vimpostor/vim-8.2.3430Jan Edmund Lazo2021-11-30
|\ | | | | vim-patch:8.2.{3430,3434,3462,3463,3555,3609,3610}: ModeChanged autocmd
| * vim-patch:8.2.3430: no generic way to trigger an autocommand on mode changeMagnus Groß2021-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No generic way to trigger an autocommand on mode change. Solution: Add the ModeChanged autocommand event. (Magnus Gross, closes vim/vim#8856) https://github.com/vim/vim/commit/f1e8876fa2359b572d262772747405d3616db670 N/A patches for version.c: vim-patch:8.2.3434: function prototype for trigger_modechanged() is incomplete Problem: Function prototype for trigger_modechanged() is incomplete. Solution: Add "void". https://github.com/vim/vim/commit/28e591dd5080bbcd0f468f9d9597cedb716e28c9 Fixes #4399. Fixes #7416.
* | vim-patch:8.2.2922: computing array length is done in various waysVVKot2021-11-21
| | | | | | | | | | | | Problem: Computing array length is done in various ways. Solution: Use ARRAY_LENGTH everywhere. (Ken Takata, closes vim/vim#8305) https://github.com/vim/vim/commit/eeec2548785b2dd245a31ab25d7bde0f88ea1a6d
* | refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
|/ | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* refactor(api): move extmark API to its own fileBjörn Linse2021-10-25
|
* Refactor/uncrustify (#15790)dundargoc2021-09-29
| | | | | | | | | | | | | * refactor: format with uncrustify * fixup(dundar): fix functions comments * fixup(dundar): remove space between variable and ++/-- * fixup(dundar): better workaround for macro attributes This is done to be able to better use uncrustify rules for macros * fixup(justin): make preprocessors follow neovim style guide
* fix(PVS V507): false positiveJustin M. Keyes2021-09-24
| | | | | | | | | | https://pvs-studio.com/en/docs/warnings/v507/ "Pointer to local array 'sourcing_name_buf' is stored outside the scope of this array. Such a pointer will become invalid." False positive: `sourcing_name = save_sourcing_name` before returning from this scope.
* refactor: format with uncrustify #15741dundargoc2021-09-22
|
* luaref: free decoration providersBjörn Linse2021-04-03
|
* lua: track reference ownership with ASAN when presentBjörn Linse2021-04-03
|
* vim-patch:8.1.0488: using freed memory in quickfix codeShane Smith2019-10-27
| | | | | | | Problem: Using freed memory in quickfix code. (Dominique Pelle) Solution: Add the quickfix_busy() flag to postpone deleting quickfix lists until it is safe. (Yegappan Lakshmanan, closes #3538) https://github.com/vim/vim/commit/9f84ded38b62c82a4ee57b54f403b1b185ed8170
* API: Context: save/restoreAbdelhakeem2019-07-27
|
* vim-patch:8.1.1632: build with EXITFREE but without +arabic failsJan Edmund Lazo2019-07-05
| | | | | | Problem: Build with EXITFREE but without +arabic fails. Solution: Rename the function and adjust #ifdefs. (closes vim/vim#4613) https://github.com/vim/vim/commit/48ac671fe5cb5a7c2d5263d2f122e5e903022e30
* Resolved compile warnings & fixed lot of style related to sign apiAndrej Zieger2019-05-26
|
* refactor: introduce XFREE_CLEAR()Justin M. Keyes2019-05-25
| | | | | | | | | | | | | | | Unfortunately we cannot indiscriminately replace xfree() with XFREE_CLEAR(), because comparing pointers after freeing them is a common pattern. Example in `tv_list_remove_items()`: xfree(li); if (li == item2) { break; } Instead we can do it selectively/explicitly. ref #1375
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* utf16_to_utf8: minor fixesJustin M. Keyes2019-02-25
|
* Remove support for using jemalloc instead of the system allocatorJames McCoy2019-01-19
| | | | | | There was never any investigation done to determine whether using jemalloc was actually a net benefit for nvim. It has been a portability limitation and adds another factor to consider when triaging issues.
* multigrid: avoid allocation when not ext_multigrid.Björn Linse2018-12-31
| | | | Move grid specific functions from mbyte.c to screen.c
* multigrid: introduce grid abstractionBjörn Linse2018-12-31
|
* api: implement object namespacesBjörn Linse2018-11-24
| | | | | | | | | Namespaces is a lightweight concept that should be used to group objects for purposes of bulk operations and introspection. This is initially used for highlights and virtual text in buffers, and is planned to also be used for extended marks. There is no plan use them for privileges or isolation, neither to introduce nanespace-level options.
* vim-patch:8.0.1214: accessing freed memory when EXITFREE is setJan Edmund Lazo2018-08-25
| | | | | | | Problem: Accessing freed memory when EXITFREE is set and there is more than one tab and window. (Dominique Pelle) Solution: Free options later. Skip redraw when exiting. https://github.com/vim/vim/commit/4f1982800f0aff28df6875e718a786f6c4b11ad9
* highlight: refactor to use stateful representationBjörn Linse2018-07-21
| | | | | This allows us to keep track of the source higlight groups, and not only the final combined highlights.
* highlight: extract low-level highlight logic from syntax, uiBjörn Linse2018-07-21
|
* vim-patch:8.0.0468: g< after aborting an Ex command (#7941)KunMing Xie2018-06-21
| | | | | | | | Problem: After aborting an Ex command g< does not work. (Marcin Szamotulski) Solution: Postpone clearing scrollback messages to until the command line has been entered. Also fix that the screen isn't redrawn if after g< the command line is cancelled. https://github.com/vim/vim/commit/f2405ed2321da4a879fe0b0703af780fc0432c63
* memory: Fix documentation of some string copying functionsZyX2018-04-09
|
* 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.
* vim-patch:8.0.0073ckelsel2017-07-23
| | | | | | | Problem: More comparisons between firstwin and lastwin. Solution: Use ONE_WINDOW for consistency. (Hirohito Higashi) https://github.com/vim/vim/commit/459ca563128f2edb7e3bb190090bbb755a56dd55
* api: nvim_get_mode()Justin M. Keyes2017-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | Asynchronous API functions are served immediately, which means pending input could change the state of Nvim shortly after an async API function result is returned. nvim_get_mode() is different: - If RPCs are known to be blocked, it responds immediately (without flushing the input/event queue) - else it is handled just-in-time before waiting for input, after pending input was processed. This makes the result more reliable (but not perfect). Internally this is handled as a special case, but _semantically_ nothing has changed: API users never know when input flushes, so this internal special-case doesn't violate that. As far as API users are concerned, nvim_get_mode() is just another asynchronous API function. In all cases nvim_get_mode() never blocks for more than the time it takes to flush the input/event queue (~µs). Note: This doesn't address #6166; nvim_get_mode() will provoke #6166 if e.g. `d` is operator-pending. Closes #6159
* *: Add comment to all C filesZyX2017-04-19
|
* win: os_shell_is_cmdexe() + testsJustin M. Keyes2017-04-12
|
* eval: Split eval.c into smaller filesZyX2017-03-29
|
* DirChanged: trigger when switching scopesJustin M. Keyes2017-03-12
| | | | Closes #6054
* *: Fix linter errorsZyX2017-02-25
|
* memory: Free buffers after freeing variablesZyX2017-02-24
| | | Avoids use-after-free crashes when compiling with -DEXITFREE.
* vim-patch:7.4.2024Marco Hinz2017-02-04
| | | | | | | | | | Problem: More buf_valid() calls can be optimized. Solution: Use bufref_valid() instead. NOTE: Some changes related to channels and the Python and Netbeans interfaces were obviously left out. https://github.com/vim/vim/commit/7c0a2f367f2507669560b1a66423155c70d2e75b
* xstrlcat: Allow overlapped pointers. (#6017)Justin M. Keyes2017-01-31
| | | | | | | | | | memcpy is not equivalent to memmove (which is used by vim_strcat), this could cause subtle bugs if xstrlcat is used as a replacement for vim_strcat. But vim_strcat is inconsistent: in the `else` branch it uses strcpy, which doesn't allow overlap. Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com> Helped-by: Nikolai Aleksandrovich Pavlov <kp-pav@yandex.ru>
* refactor: Remove strncpy/STRNCPY. (#6008)Justin M. Keyes2017-01-26
| | | | | | | | | | | | | | | Closes #731 References #851 Note: This does not remove some intentional legacy usages of strncpy. - memcpy isn't equivalent because it doesn't check the string length of `src`, and doesn't zero-out the remainder of `dst`. - xstrlcpy isn't equivalent because it doesn't zero-out the remainder of `dst`. Some Vim logic depends on that (e.g. ex_append which calls vim_strnsave). Helped-by: Douglas Schneider <ds3@ualberta.ca> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com>
* refactor: strlcat instead of str{n}cat.cztchoice2017-01-23
| | | | | | | | | | Add xstrlcat function. Closes #3042 References #988 References #1069 coverity: 71530, 71531, 71532
* memory: Document new additions to memory.hZyX2017-01-07
|
* memory: Restore entered_free_all_mem functionalityZyX2017-01-07
|
* unittest: Allow mocking allocator callsZyX2017-01-07
|
* lintJames McCoy2017-01-02
|
* vim-patch:7.4.1868James McCoy2017-01-01
| | | | | | | Problem: Setting really_exiting causes memory leaks to be reported. Solution: Add the in_free_all_mem flag. https://github.com/vim/vim/commit/b89a25f17e274dc308c584ea69a129ffbb26bc3d
* vim-patch:7.4.1866James McCoy2017-01-01
| | | | | | | | | | | | Problem: Invalid memory access when exiting with EXITFREE defined. (Dominique Pelle) Solution: Set "really_exiting" and skip error messages. https://github.com/vim/vim/commit/a96732150cda2f242133228579b05437a39b8daa This fails to build, due to a00c2e0ecbaec366364cecb5efbdb456c8c543ef removing really_exiting from globals.h, but the next commit fixes the build failure.
* os/shell: do_os_system(): Always show last chunk.Justin M. Keyes2016-12-10
| | | | | | | | | | | | | | | | | | | | | This ameliorates use-cases like: :!cat foo.txt :make where the user is interested in the last few lines of output. Try these shell-based ex-commands before/after this commit: :grep -r '' * :make :!yes :!grep -r '' * :!git grep '' :!cat foo :!echo foo :!while true; do date; done :!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done In all cases the last few lines of the command should always be shown, regardless of where throttling was triggered.