aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
Commit message (Collapse)AuthorAge
...
* | vim-patch:7.4.707 #2541Bastian Winkler2015-05-07
|/ | | | | | | Problem: Undo files can have their executable bit set. Solution: Strip of the executable bit. (Mikael Berthe) https://github.com/vim/vim/commit/v7-4-707
* Merge pull request #2353 from jszakmeister/fix-unused-var-warnings-in-releaseJohn Szakmeister2015-04-16
|\ | | | | Fix several unused variable warnings in the release build.
| * Fix several unused variable warnings in the release build.John Szakmeister2015-04-16
| | | | | | | | | | Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
* | memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | | | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* | vim-patch: Port parts of Vim 7.4.399.Florian Walch2015-04-08
|/ | | | | | | | | | | | | Resolves #1753. https://code.google.com/p/vim/source/detail?r=v7-4-399 Reviewed-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Helped-by: David Bürgin <676c7473@gmail.com> Helped-by: Scott Prager <splinterofchaos@gmail.com> Helped-by: Michael Reed <m.reed@mykolab.com> Helped-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
* terminal: New module that implements a terminal emulatorThiago de Arruda2015-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates libvterm with Neovim and implements a terminal emulator with nvim buffers as the display mechanism. Terminal buffers can be created using any of the following methods: - Opening a file with name following the "term://[${cwd}//[${pid}:]]${cmd}" URI pattern where: - cwd is the working directory of the process - pid is the process id. This is just for use in session files where a pid would have been assigned to the saved buffer title. - cmd is the command to run - Invoking the `:terminal` ex command - Invoking the `termopen` function which returns a job id for automating the terminal window. Some extra changes were also implemented to adapt with terminal buffers. Here's an overview: - The `main` function now sets a BufReadCmd autocmd to intercept the term:// URI and spawn the terminal buffer instead of reading the file. - terminal buffers behave as if the following local buffer options were set: - `nomodifiable` - `swapfile` - `undolevels=-1` - `bufhidden=hide` - All commands that delete buffers(`:bun`, `:bd` and `:bw`) behave the same for terminal buffers, but only work when bang is passed(eg: `:bwipeout!`) - A new "terminal" mode was added. A consequence is that a new set of mapping commands were implemented with the "t" prefix(tmap, tunmap, tnoremap...) - The `edit` function(which enters insert mode) will actually enter terminal mode if the current buffer is a terminal - The `put` operator was adapted to send data to the terminal instead of modifying the buffer directly. - A window being resized will also trigger a terminal resize if the window displays the terminal.
* buffer: Move b_p_ma(modifiable) checks into the MODIFIABLE macroThiago de Arruda2015-03-25
|
* misc2.c: Move emsg* functions to message.c #2152Michael Reed2015-03-19
| | | | Clean up said functions and some outdated comments while we're at it.
* Macro cleanup: HAVE_SANDBOXMichael Reed2015-03-05
|
* Macro cleanup: PROTOMichael Reed2015-01-14
| | | | | | Regarding dict_lookup() in eval.c: both definitions are the same, the only difference being the spacing between the indirection operator and the indentation level.
* Remove long_u: Passing-by: undo.c: Add to -Wconversion.Eliseo Martínez2014-12-24
| | | | | | | Previous commit dropped many -Wconversion warnings in both spell.c and undo.c. spell.c still has a lot of them (200+). But in undo.c, only a handful of them remain. Take the chance to eliminate those, too, and add undo.c to -Wconversion checked files.
* Remove long_u: put_bytes(): Refactor.Eliseo Martínez2014-12-24
| | | | | | | | | | | | | | | | | | | | | | | Remove all long_u instances due to put_bytes() function. First, function signature is changed this way: - nr : long_u --> uintmax_t uintmax_t is chosen so that invocations can use any unsigned integer type (including size_t) without needing to cast. - len : int --> unsigned int This is to pass the size in bytes of the previous param, thus an unsigned int is enough. All invocations use positive integer literals, so change is safe without the need for casts. Then, function implementation is adapted accordingly. Last, all invocation points are refactored this way: - Refactor types to minimize casts. - Inline declarations (C99 style) in containing function. All this changes were done with -Wconversion temporarily activated for spell.c and undo.c, so that we can assert changes are type-safe and do not introduce any warnings to that respect.
* Passing-by: Fix FALSE/FAIL confusion.Eliseo Martínez2014-12-16
| | | | | | FALSE was being used instead of FAIL. They happen to have the same value, so it works the same. But from function comment it's clear it uses the OK/FAIL convention.
* Fix warnings: undo.c: u_blockfree(): Use after free: FP.Eliseo Martínez2014-11-15
| | | | | | | | | Problem : Use-after-free @ 2686. Diagnostic : False positive. Rationale : Suggested error path is taking false branch `uhp->uh_next.ptr != NULL` @ 2506, which cannot happen when `uhp == buf->b_u_oldhead`. Resolution : Assert `buf->b_u_oldhead` is changed after freeing old one.
* Convert some values from buffer_defs.h to boolsWayne Rowcliffe2014-11-12
|
* fix #1027: :wundo segfault in new, non-empty bufferJustin M. Keyes2014-10-26
|
* Replace FOR_ALL_WINDOWS with FOR_ALL_WINDOWS_IN_TAB(curtab)Wayne Rowcliffe2014-09-24
|
* Convert FOR_ALL_WINDOWS to use a locally declared pointerWayne Rowcliffe2014-09-08
|
* fileinfo: rename os_get_file_info{,_link,_fd}Stefan Hoffmann2014-08-31
|
* os_fchown: remove cast of parameter -1 to uid_tPavel Platto2014-08-16
|
* os_fchown: impl and remove HAVE_FCHOWNPavel Platto2014-08-13
|
* vim: move vim_acl_T to types.hNicolas Hillegeer2014-07-16
| | | | | Also include "types.h" in os_unix.h because it declares functions that return vim_acl_T.
* os_open: impl mch_open with libuv. ref #133Justin M. Keyes2014-07-14
| | | | | | | | | - 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
* Include stdbool.h in some files which use itPavel Platto2014-07-11
| | | | | | | Done by manual inspection of the output of this script: grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include grep -F -x -v -f has_include has_bool
* Enable and fix misc2.c -Wconversion warnings #907Shane Iler2014-07-11
|
* move errno.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* Replaced most TRUE/FALSE macros in arabic, mbyte and spell. #645Klemen Košir2014-07-08
|
* Introduce GA_APPEND()Felipe Oliveira Carvalho2014-06-30
| | | | | | | | | This macro is used to append an element to a growable array. It replaces this common idiom: ga_grow(&ga, 1); ((item_type *)ga.ga_data)[ga.ga_len] = item; ++ga.ga_len;
* No OOM for list_alloc()Felipe Oliveira Carvalho2014-06-16
|
* No OOM in dict_alloc() and rettv_dict_alloc()Felipe Oliveira Carvalho2014-06-16
|
* Declare garray iterators in the for() scope where possible #819Felipe Oliveira Carvalho2014-06-10
|
* Add automatic generation of headersZyX2014-06-02
| | | | | | | | | | | | | | | | | - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception.
* Extract cursor.h from misc{1,2}.h and memline.hHinidu2014-05-28
|
* Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'Justin M. Keyes2014-05-22
|\ | | | | | | - replace alloc with xmalloc
| * Remove OOM checks: u_save_line()Felipe Oliveira Carvalho2014-05-19
| |
| * Remove NULL/non-NULL tests after calls to vim_str(n)save()Felipe Oliveira Carvalho2014-05-19
| |
* | Remove cryptographyJohn Schmidt2014-05-20
|/ | | | | | | | | | | | | As discussed in #694, vim encryption uses old, obsolete algorithms that are poorly implemented. Since insecure cryptography is worse than no cryptgraphy, the community voted in favor of removing all crypto. Various alternatives to the old crypto is being discussed in #701. Closes #694.
* Replace ga->ga_len == 0 checks with GA_EMPTY(ga)Felipe Oliveira Carvalho2014-05-17
| | | | | | | | | | | | | | | | | | | Used Coccinelle to perform the changes @@ expression E; @@ <... ( // E.ga_len == 0 is isomorphic to !E.ga_len - E.ga_len == 0 + GA_EMPTY(&E) | - E->ga_len == 0 + GA_EMPTY(E) ) ...>
* Introduce nvim namespace: Fix unmasked strings.h issue.Eliseo Martínez2014-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Now that nvim/strings.h is correctly namespaced, an issue that had been masked until now arises: When compiling, we get a lot of errors because of everywhere the functions in nvim/strings.h are used, there's no include to import them. But, how could this compile and work previously, then? It turns out that: - In every such case, we are also including vim.h, which in turn includes os_unix_defs.h. - os_unix_defs.h includes <string.h> and also <strings.h> in some systems (e.g. OSX). - Build had been modified previously to (even when importing system headers), prefer equally-named local ones. That was in fact done as a previous attempt to solve the same issue we are trying to solve another way now. So, we were including our "strings.h" as a side-effect of including <strings.h> through "vim.h" --> "os_unix_defs.h". Solution: Correctly include "nvim/strings.h" in every file needing it.
* Introduce nvim namespace: Fix project-local includes.Eliseo Martínez2014-05-15
| | | | Prepend 'nvim/' in all project-local (non-system) includes.
* Introduce nvim namespace: Move files.Eliseo Martínez2014-05-15
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.