aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memline.c
Commit message (Collapse)AuthorAge
* swapfile: Always show swap dialog (E325)Justin M. Keyes2018-09-23
| | | | | | | If swapfile dialog prompts for input, it must be displayed to the user. fix #8840 fix #9027
* vim-patch:8.1.0310: file info msg with 'F' in 'shortmess'Justin M. Keyes2018-09-21
| | | | | | | | | | Problem: File info message not always suppressed with 'F' in 'shortmess'. (Asheq Imran) Solution: Save and restore msg_silent. (Christian Brabandt, closes vim/vim#3221) https://github.com/vim/vim/commit/2f0f871159b2cba862fcd41edab65b17da75c422 ref #8840 ref #9027
* vim-patch:8.0.1417: test doesn't search for a sentenceJan Edmund Lazo2018-09-16
| | | | | | | Problem: Test doesn't search for a sentence. Still fails when searching for start of sentence. (Dominique Pelle) Solution: Add paren. Check for MAXCOL in dec(). https://github.com/vim/vim/commit/1bd999f982e783219a06e6c8f219df1d53ac7e77
* vim-patch:8.0.1416: crash when searching for a sentenceJan Edmund Lazo2018-09-16
| | | | | | Problem: Crash when searching for a sentence. Solution: Return NUL when getting character at MAXCOL. (closes vim/vim#2468) https://github.com/vim/vim/commit/8ada6aa9298b4764d9ca0024dd21b17e815595ce
* vim-patch:8.0.1363: recover swap file ending with .stz #9002Jan Edmund Lazo2018-09-16
| | | | | | | Problem: Recovering does not work when swap file ends in .stz. Solution: Check for all possible swap file names. (Elfling, closes vim/vim#2395, closes vim/vim#2396) https://github.com/vim/vim/commit/af903e5d490ec9c6c49079f67de7e92e3c35a725
* Merge #8863 'refactor: Remove mb_head_off() 'Justin M. Keyes2018-08-28
|\
| * Remove has_mbyte from lines near changes in parent commitZviRackover2018-08-16
| |
| * Remove occurences of mb_head_offZviRackover2018-08-15
| |
* | vim-patch:8.1.0303: line2byte() is wrong for last line with 'noeol'Jan Edmund Lazo2018-08-21
|/ | | | | | Problem: line2byte() is wrong for last line with 'noeol' and 'nofixeol'. Solution: Fix off-by-one error. (Shane Harper, closes vim/vim#3351) https://github.com/vim/vim/commit/c26f7c60532a37a2bf0a5e69aa81081b440dfc38
* memline: fnamecmp_ino() returns boolJan Edmund Lazo2018-08-09
|
* vim-patch:8.0.1819: swap file warning for file with non-existing directoryJan Edmund Lazo2018-08-09
| | | | | | | Problem: Swap file warning for a file in a non-existing directory, if there is another with the same file name. (Juergen Weigert) Solution: When expanding the file name fails compare the file names. https://github.com/vim/vim/commit/8c3169c58eef3e04f643fe9e045a97b81429e0cb
* memline: copy in ml_replace() is boolJan Edmund Lazo2018-08-07
|
* vim-patch:8.0.1512: warning for possibly using NULL pointerJan Edmund Lazo2018-07-23
| | | | | | Problem: Warning for possibly using NULL pointer. (Coverity) Solution: Skip using the pointer if it's NULL. https://github.com/vim/vim/commit/e4db7aedab65abadcc84c78e7a10ec7bb62f11cf
* *: Replace b_changedtick with new always-inline functionsZyX2018-06-22
| | | Ref #8474
* vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* vim-patch:8.0.0466: still macros that should be all-caps (#8510)Jan Edmund Lazo2018-06-10
| | | | | Problem: There are still a few macros that should be all-caps. Solution: Make a few more macros all-caps. https://github.com/vim/vim/commit/8820b48654b62472821d9b155fe03ab7ac13a05c
* mf_open(): never fails (except for OOM)Justin M. Keyes2018-05-17
|
* Merge #4486 'refactor: Remove maxmem, maxmemtot options'Justin M. Keyes2018-05-02
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change we never release blocks from memory (in practice it never happened because the memory limits are never reached). Let the OS take care of that. --- On today's systems the 'maxmem' and 'maxmemtot' values are huge (4+ GB) so the limits are never reached in practice, but Vim wastes a lot of time checking if the limit was reached. If the limit is reached Vim starts saving pieces of the swap file that were in memory to the disk. Said in a different way: Vim implements its own memory-paging mechanism. This is unnecessary and inefficient since the operating system already has virtual memory and will swap to the disk if programs start using too much memory. This change does... 1. Reduce the number of config options and need for documentation. 2. Make the code more efficient as we don't have to keep track of memory usage nor check if the memory limits were reached to start swapping to disk every time we need memory for buffers. 3. Simplify the code. Once memfile.c is simple enough it could be replaced by actual operating system memory mapping (mmap, MemoryViewOfFile...). This change does not prevent Vim to recover changes from swap files since the swapping code is never triggered with the huge limits set by default.
| * Remove the mf_dont_release global after getting rid of maxmem[tot]Felipe Oliveira Carvalho2017-04-11
| |
* | Merge #8218 'Fix errors reported by PVS'Justin M. Keyes2018-04-27
|\ \ | | | | | | closes #4983
| * | memline: Fix PVS/V547: allocator now never returns NULLZyX2018-04-15
| | |
| * | memline: Fix PVS/V560: allocator now never returns NULLZyX2018-04-15
| | |
* | | lintJustin M. Keyes2018-04-21
| | |
* | | IO: let 'fsync' option control more casesJustin M. Keyes2018-04-21
|/ / | | | | | | | | | | | | | | | | | | | | Vim has the 'swapsync' option which we removed in 62d137ce0969. Instead let 'fsync' control swapfile-fsync. These cases ALWAYS force fsync (ignoring 'fsync' option): - Idle (CursorHold). - Exit caused by deadly signal. - SIGPWR signal. - Explicit :preserve command.
* | refactor/rename: path_is_absolute()Justin M. Keyes2018-03-24
| |
* | vim-patch:8.0.0387: compiler warnings (#8162)KunMing Xie2018-03-23
| | | | | | | | | | Problem: compiler warnings Solution: Add type casts. (Christian Brabandt) https://github.com/vim/vim/commit/b113c3a618113122e62697dd73427261f8c51b2c
* | vim-patch:8.0.0736: OptionSet not triggered when entering diff modeJustin M. Keyes2018-02-11
| | | | | | | | | | | | | | | | | | Problem: The OptionSet autocommand event is not triggered when entering diff mode. Solution: use set_option_value() instead of setting the option directly. Change the tests from old to new style. (Christian Brabandt) https://github.com/vim/vim/commit/04f62f881c5743d2fdaf7324f6a715381f0d5fcf
* | vim-patch:8.0.0337: invalid memory access in :recover commandJustin M. Keyes2018-02-11
| | | | | | | | | | | | | | | | Problem: Invalid memory access in :recover command. Solution: Avoid access before directory name. (Dominique Pelle, closes vim/vim#1488) https://github.com/vim/vim/commit/c525e3a1c20f6b5d9809c8b84f80090a8e416c92
* | lintJames McCoy2017-12-15
| |
* | vim-patch:8.0.0074Michael Schupikov2017-12-15
| | | | | | | | | | | | | | | | | | | | Problem: Cannot make Vim fail on an internal error. Solution: Add IEMSG() and IEMSG2(). (Domenique Pelle) Avoid reporting an internal error without mentioning where. https://github.com/vim/vim/commit/95f096030ed1a8afea028f2ea295d6f6a70f466f Signed-off-by: Michael Schupikov <michael@schupikov.de>
* | io: more guards against NULL filename (#7159)Justin M. Keyes2017-08-13
| | | | | | | | References ac055d677aa9 References #4370
* | lintJames McCoy2017-06-04
| |
* | vim-patch:7.4.1975James McCoy2017-06-04
| | | | | | | | | | | | | | | | | | | | | | Problem: On MS-Windows large files (> 2Gbyte) cause problems. Solution: Use "off_T" instead of "off_t". Use "stat_T" instead of "struct stat". Use 64 bit system functions if available. (Ken Takata) https://github.com/vim/vim/commit/8767f52fbfd4f053ce00a978227c95f1d7d323fe Only the off_T changes are relevant, since all the "struct stat" usage is abstracted by libuv.
* | *: Add comment to all C filesZyX2017-04-19
| |
* | memline: Fix “NULL pointer dereference” warningZyX2017-04-16
| | | | | | | | It was actually a false positive indicating always-true condition, not real dereference.
* | memline: Silence “buffer underflow” warning, looks like false positiveZyX2017-04-16
|/
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* job-control: set CLOEXEC on pty processes. #5986Matthew Malcomson2017-03-17
| | | | | Before this change, new processes started with libuv prevented SIGHUP from reaching pty processes (by keeping the ptmx file descriptor open).
* vim-patch:8.0.0453 (#6266)Matthieu Coudron2017-03-13
| | | | | | Problem: Adding fold marker creates new comment. Solution: Use an existing comment if possible. (LemonBoy, closes vim/vim#1549) https://github.com/vim/vim/commit/025a6b708a9bff54c73fb9c641b980da19e943a9
* buffer: Bind b:changedtick to b:['changedtick'], remove special casesZyX2017-02-23
|
* *: Partial string handling refactoringZyX2017-02-15
| | | | | | | | Main points: - Replace `char_u` with `char` in some cases. - Remove `str[len] = NUL` hack in some cases when `str` may be considered `const`.
* lintJustin M. Keyes2017-01-13
|
* open_buffer(): Do `BufEnter` for directories.Justin M. Keyes2017-01-12
| | | | | | | | | | | | | | | | | | | Abuse NOTDONE to give some nuance to the return value of readfile(), so that open_buffer() can distinguish between "failed, lol" and "failed because the path is a directory". Before this change, Vim *already* creates a new buffer when a directory is edited. So there is no reason it should not raise BufEnter, that was an implementation detail of ye olde readfile(). Most of the changes in this commit merely preserve the old semantics. The "implicit" change that we actually are interested in, is this line in `open_buffer()`, where `retval` being non-FAIL allows EVENT_BUFENTER to be applied: apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval); References https://github.com/vim/vim/issues/1353
* '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)
* 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
* vim-patch:7.4.1237 (#5092)Simon Weil2016-07-31
| | | | | | Problem: Can't translate message without adding a line break. Solution: Join the two parts of the message. https://github.com/vim/vim/commit/d9ea9069f5ef5b8b9f9e0d0daecdd124e2dcd818
* 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.
* vim-patch:7.4.1276Michael Ennen2016-05-17
| | | | | | | Problem: Warning for not using return value of fcntl(). Solution: Explicitly ignore the return value. https://github.com/vim/vim/commit/fbc4b4db3a9690906a96e16724350a6241cf32a5
* *: 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.
* Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
|