aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
Commit message (Collapse)AuthorAge
* Bump all nvim-specific error codes above E5000James McCoy2016-11-15
| | | | | | | | | | In order to not conflict with new error codes that Vim adds, all Neovim error codes should be above 5000. The three existing sub-5000 error codes (E926, E951, and E952) are now E50003, E5004, and E5005 respectively. E953 was removed in 6167ce6df2753d5474ad49aea19f5957128ab015, so just remove it from the help.
* 'inccommand': buftype=nofile, restore cursor/viewJustin M. Keyes2016-11-10
| | | | | | | - Use a standard scratch buffer instead of a new 'buftype', functions like curbufIsChanged() already have special handling for scratch bufs. - Cleanup some stuff from the previous merge. - Add support for :smagic, :snomagic. Closes #5578
* lintJustin M. Keyes2016-11-08
|
* 'inccommand': reworkJustin M. Keyes2016-11-08
| | | | | | | | | | | | | | | | | - Eliminate/isolate static/global variables - Remove special-case parameter from buflist_new() - Remove special-case ECMD_RESERVED_BUFNR - To determine when u_undo_and_forget() should be done, check b_changedtick instead of a heuristic. - use mb_string2cells() instead of strlen() to measure the :sub patterns - call ml_close() before buf_clear_file(). Avoids leaks caught by ASan. Original patch by: Robin Elrharbi-Fleury (Robinhola) Audrey Rayé (Adrey06) Philémon Hullot (DesbyP) Aymeric Collange (aym7) Clément Guyomard (Clement0)
* Incsubsitution featureKillTheMule2016-10-30
| | | | | | | | | | | | | | | | | Originally implemented by * Clement0 * DesbyP * aym7 * Adrey06 * Robinhola in #4811. Major reworkings and bug fixes by * bfredl Most tests suggested by ZyX-l, suggestions for improvements by oni-link.
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* os/fs: Rename os_file_exists to os_path_exists (#4973)Daniel Xu2016-07-06
| | | | Because the old name did not indicate that the function would return true on directories as well.
* *: Fix new linter errorsZyX2016-05-01
| | | | Originally there were 128 new errors, so I thought this is a good idea to fix all of them. Of course, this commit also fixes many suppressed errors.
* vim-patch:7.4.1574Florent FAYOLLE2016-03-18
| | | | | | | Problem: ":undo 0" does not work. (Florent Fayolle) Solution: Make it undo all the way. (closes vim/vim#688) https://github.com/vim/vim/commit/d22e9465f6228207a4fe722ee84371c7817060d6
* Fix the ASCII-art diagram in undo.cFelipe Oliveira Carvalho2016-02-24
| | | | Set \t to 8 spaces and `retab`.
* vim-patch:7.4.634watiko2016-02-01
| | | | | | | | Problem: Marks are not restored after redo + undo. Solution: Fix the way marks are restored. (Olaf Dabrunz) https://github.com/vim/vim/commit/f65aad5554f1d1f972f0bd38059da70e3cdf4c87 https://github.com/vim/vim/commit/35e7594dd429f7a8a06cefd61c3e8d48b9bd74e2
* Windows: Include <fcntl.h> for file constants.Seth Jackson2016-01-17
| | | | | | This header is required by POSIX for the constants (O_RDONLY, etc.) but we were only including it on Unix systems as a side effect of including <unistd.h>.
* undo.c: Change return type to bool on functions #3697Wayne Rowcliffe2015-12-01
| | | | | | | Update some comments, too. Reviewed-by: Björn Linse <bjorn.linse@gmail.com> Reviewed-by: Michael Reed <Pyrohh@users.noreply.github.com>
* src/*: Remove `VIM - Vi improved ...` headerMichael Reed2015-11-27
| | | | | | | | | | | | | | | | | | | Regarding the individual items in the header: `Vim - Vi improved by Bram Moolenar` Bram Moolenar is already mentioned throughout the documentation, as well as the intro screen. `:help uganda` It's already shown to all users who don't use `shortmess+=I` upon starting nvim, and is already placed prominently in help.txt, i.e., `:help` run with no arguments. `:help credits` Already mentioned near the top of help.txt. `README.md` Already mentioned in develop.txt.
* Remove unnecessary includes for errno.hRui Abreu Ferreira2015-11-25
|
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* undo: Remove incorrect NONNULL_ALL attributeZyX2015-11-05
| | | Fixes #3605
* undo: Automatically create undo directory if neededZyX2015-10-29
|
* undo: Do some refactoringZyX2015-10-29
| | | | | | Specifically refactor u_get_undo_file_name which will be modified to automatically create undo directory and replace `char_u` with `char` in some of the related functions.
* undo: When reading persistent undo file give marks current timeZyX2015-10-08
| | | | | Guess this is better then zero time which will give ShaDa marks the priority almost always.
* *: Make ShaDa code use VimL values for additional_\* dataZyX2015-10-08
|
* viminfo: First version of ShaDa file dumpingZyX2015-10-08
| | | | | | | | | | | | | | | | | | | | 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).
* Remove instances of TRUE/FALSE macroSteven Oliver2015-09-04
| | | | | | memory.c os_unix.c path.c
* fix strict-overflow cases #3236Nikolay Orlyuk2015-08-25
|
* Remove char_u: message:smsg()Michael Reed2015-05-13
|
* Merge #2470: Remove char_u (5)Eliseo Martínez2015-05-07
|\ | | | | | | | | | | Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com> Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
| * Remove char_u: concat_fnames()Mark Bainter2015-05-06
| |
* | 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