aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* | Merge #5561 'inccommand'Justin M. Keyes2016-11-09
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial work by: Robin Elrharbi-Fleury (Robinhola) Audrey Rayé (Adrey06) Philémon Hullot (DesbyP) Aymeric Collange (aym7) Clément Guyomard (Clement0) Major revisions by: KillTheMule Björn Linse <bjorn.linse@gmail.com> Justin M. Keyes <justinkz@gmail.com>
| * | 'inccommand': Preserve curbuf->b_u_newhead.Justin M. Keyes2016-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests for undotree(). Helped-by: Björn Linse <bjorn.linse@gmail.com> When "curhead" points to a valid head, the value of "newhead" is meaningless (and really should be set to null). The undo state for a buffer is _logically_ the enum: enum UndoState { CurrentHead(head), NewHead(head), EmptyTree } nvim _represents_ this as: whenever `curbuf->b_u_curhead` is nonnull it should be used as the current head, and `curbuf->b_u_newhead` is ignored. If the there is a current head, then this will be redoed on the next redo, and its parent will be undone on next undo. Only if `b_u_curhead` is NULL, `b_u_newhead` will be used as the head to undo (and it is not possible to redo). Also both can be NULL, to indicate an empty undotree. (To be fair, this only strictly true when calling undo.c from the outside, in some places _within_ a function in undo.c both values might be meaningful) Apparently `undotree()` breaks this non-abstraction, this _cosmetic_ issue can easily be fixed by `ex_substitute` also saving and restoring `b_u_newhead`, but is doesn't reflect any error really how `u_undo_and_forget` manipulates the _actual_ state of the undo tree.
| * | perf: do_sub(): avoid work, avoid screen updatesJustin M. Keyes2016-11-08
| | | | | | | | | | | | | | | - Don't fill matched_lines if not showing a preview (!eap->is_live). - Encapsulate: Move cursor placement logic to show_sub().
| * | 'inccommand': preserve 'modified'Justin M. Keyes2016-11-08
| | | | | | | | | | | | | | | During the live preview, the buffer-local 'modified' flag should not be changed.
| * | 'inccommand': Do not trigger during scripts, feedkeys().Justin M. Keyes2016-11-08
| | |
| * | 'inccommand': rename 'incsubstitute'Justin M. Keyes2016-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | 'inccommand' allows us to expand the feature to other commands, such as: :cdo :cfdo :global Also rename "IncSubstitute" highlight group to "Substitute".
| * | 'inccommand': format line numbers as "|123| "Justin M. Keyes2016-11-08
| | | | | | | | | | | | This matches what Quickfix traditionally does.
| * | 'inccommand': set buffer name to [Preview]Justin M. Keyes2016-11-08
| | | | | | | | | | | | | | | | | | [inc_sub] is less obvious for users. Also, in the future we may want to generalize the idea of a "preview buffer", or "incremental commands" besides :substitute.
| * | 'inccommand': disable 'cursorline', 'spell' in previewJustin M. Keyes2016-11-08
| | |
| * | 'inccommand': preserve b:changedtickJustin M. Keyes2016-11-08
| | |
| * | 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)
| * | LintedKillTheMule2016-10-30
| | |
| * | 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.
* | | encoding: delete non-UTF-8 implementations of multibyte functionsBjörn Linse2016-11-05
| | | | | | | | | | | | Deleted documentation was duplicated at specific utf_ implementation
* | | encoding: cleanup mbyte.c given fixed encoding=utf-8Björn Linse2016-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate mb_init(): Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like". init_chartab() and screenalloc() are already invoked elsewhere in the initialization process. The EncodingChanged autocmd cannot be triggered. At initialization, there is no spellfiles to reload
* | | encoding: only allow encoding=utf-8Björn Linse2016-11-05
| | |
* | | Merge pull request #5524 from brcolow/vim-7.4.1967James McCoy2016-11-02
|\ \ \ | | | | | | | | | | | | vim-patch:7.4.1967
| * | | vim-patch:7.4.1967Michael Ennen2016-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Falling back from NFA to old regexp engine does not work properly. (fritzophrenic) Solution: Do not restore nfa_match. (Christian Brabandt, closes vim/vim#867) https://github.com/vim/vim/commit/6747fabc7348bf5f41ccfe851e2be3e900ec8ee0 Helped-by: jamessan
* | | | lintJames McCoy2016-11-02
| | | |
* | | | nvim_win_get_number: Use int as rv to fix BE issuesJames McCoy2016-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | rv is int64_t but its address is being passed into win_get_tabwin as if it were an int. This breaks on big-endian systems, since win_get_tabwin will store the data to the "wrong" half of the int64_t, thus returning invalid data out of nvim_win_get_number.
* | | | object_to_vim: Fix buffer/window/tabpage conversion on BE systemsJames McCoy2016-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since data.integer is a different (larger) integer type than data.{buffer,window,tabpage}, we cannot abuse the union by using data.integer to access the value for all 4 types. Instead, remove the {buffer,window,tabpage} members and always use the integer member. In order to accomodate this, perform distinct validation and coercion between the Integer type and Buffer/Window/Tabpage types in object_to_vim, msgpack_rpc helpers, and gendispatch.lua.
* | | | Use int as the standard type for boolean options.James McCoy2016-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All options are accessed by passing char_u pointers around, casting the pointer to the right pointer type for the specific option, and then dereferencing that pointer. This dance works fine on little-endian systems when some bool options are int types (as in Vim) and some are bool types (as would make more sense), but on big-endian systems *(int *)varp when varp is pointing to a bool will read random memory. Therefore, all boolean options must remain a consistent type and int is currently the easiest to choose.
* | | | tui/suspend_event(): set STDIN to "blocking"Justin M. Keyes2016-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set STDIN to blocking on "suspend". This was missed in #2598. See 8a782f1699e2a59a3f3e91f6d7c35a3312b82b41. Also on "continue"/SIGCONT explicitly set STDIN back to NON-blocking. We don't explicitly do that on *startup* (libuv does it internally), but on "continue" it seems wise to restore libuv's expectations. Closes #5459
* | | | Merge pull request #5527 from brcolow/vim-7.4.1730James McCoy2016-10-31
|\ \ \ \ | |_|_|/ |/| | | vim-patch:7.4.[1730,1734,1741,1742,1779,1782]
| * | | vim-patch:7.4.1782Michael Ennen2016-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: strcharpart() does not work properly with some multi-byte characters. Solution: Use mb_cptr2len() instead of mb_char2len(). (Hirohito Higashi) https://github.com/vim/vim/commit/fca66003053f8c0da5161d1fe4b75b3a389934b5
| * | | vim-patch:7.4.1779Michael Ennen2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Using negative index in strcharpart(). (Yegappan Lakshmanan) Solution: Assume single byte when using a negative iindex. https://github.com/vim/vim/commit/73dfe917ba6357413aaf98a021c91add5ac6e9bc
| * | | vim-patch:7.4.1742Michael Ennen2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: strgetchar() does not work correctly. Solution: use mb_cptr2len(). Add a test. (Naruhiko Nishino) https://github.com/vim/vim/commit/5d18e0eca59ffbba22c7f7c91c9f99d672095728
| * | | vim-patch:7.4.1741Michael Ennen2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Not testing utf-8 characters. Solution: Move the right asserts to the test_expr_utf8 test. https://github.com/vim/vim/commit/b22bd46b9681d73d095f2eadff8163d3a6cf416b
| * | | vim-patch:7.4.1734Michael Ennen2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Test fails when not using utf-8. Solution: Split test in regularand utf-8 part. https://github.com/vim/vim/commit/0f518a8f4d4be4cac10389680f6bd5e3781f94b0
| * | | vim-patch:7.4.1730Michael Ennen2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: It is not easy to get a character out of a string. Solution: Add strgetchar() and strcharpart(). https://github.com/vim/vim/commit/58de0e2dcc1f2d251b74892a06d71a14973f3187
* | | | lintJustin M. Keyes2016-10-30
| | | |
* | | | ex_global: Catch CTRL-C even if it is mapped.Justin M. Keyes2016-10-30
| |_|/ |/| | | | | | | | | | | Problem: If CTRL-C is mapped, it does not interrupt :global output. Solution: clear `mapped_ctrl_c` during :global.
* | | api: api_info()['version']Justin M. Keyes2016-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API level is disconnected from NVIM version. The API metadata holds the current API level, and the lowest backwards-compatible level supported by this instance. Release 0.1.6 is the first release that reports the Nvim version and API level. metadata['version'] = { major: 0, minor: 1, patch: 6, api_level: 1, api_compatible: 0, api_prerelease: false, } The API level may remain unchanged across Nvim releases if the API has not changed. When changing the API, - set NVIM_API_PRERELEASE to true - increment NVIM_API_LEVEL (at most once per Nvim version) - adjust NVIM_API_LEVEL_COMPAT if backwards-compatibility was broken api_level_0.mpack was generated from Nvim 0.1.5 with: nvim --api-info
* | | api: Nvim version, API level #5386Rui Abreu Ferreira2016-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API level is disconnected from the NVIM version. The API metadata holds the current API level, and the lowest backwards-compatible level supported by this instance. Release 0.1.6 will be the first release reporting the Nvim version and API level. metadata['version'] = { major: 0, minor: 1, patch: 6, prerelease: true, api_level: 1, api_compatible: 0, } The API level may remain unchanged across Neovim releases if the API has not changed. When changing the API the CMake variable NVIM_API_PRERELEASE is set to true, and NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented accordingly. The functional tests check the API table against fixtures of past versions of Neovim. It compares all the functions in the old table with the new one, it does ignore some metadata attributes that do not alter the function signature or were removed since 0.1.5. Currently the only fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
* | | Merge #5500Justin M. Keyes2016-10-26
|\ \ \ | | | | | | | | | | | | Closes #5246
| * | | test: Add missing test from vim-patch:7.4.2312Justin M. Keyes2016-10-26
| | | |
| * | | Fix lint errors.Grzegorz Milka2016-10-23
| | | |
| * | | vim-patch:7.4.2312Grzegorz Milka2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when autocommand moves to another tab. (Dominique Pelle) Solution: When navigating to another window halfway the :edit command go back to the right window. https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5
| * | | vim-patch:7.4.2309Grzegorz Milka2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Crash when doing tabnext in a BufUnload autocmd. (Dominique Pelle) Solution: When detecting that the tab page changed, don't just abort but delete the window where w_buffer is NULL. https://github.com/vim/vim/commit/11fbc2866ccc11b4dd1726abdaf582a78ef3f743
| * | | vim-patch:7.4.2237Grzegorz Milka2016-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Can't use "." and "$" with ":tab". Solution: Support a range for ":tab". (Hirohito Higashi) https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c
| * | | vim-patch:7.4.2212Grzegorz Milka2016-10-22
| |/ / | | | | | | | | | | | | | | | | | | | | | Problem: Mark " is not set when closing a window in another tab. (Guraga) Solution: Check all tabs for the window to be valid. (based on patch by Hirohito Higashi, closes vim/vim#974) https://github.com/vim/vim/commit/e59215c7dcae17b03daf39517560cfaa03314f5a
* | | vim-patch:7.4.2128 (#5517)Michael Ennen2016-10-26
| | | | | | | | | | | | | | | | | | Problem: Memory leak when saving for undo fails. Solution: Free allocated memory. (Hirohito Higashi) https://github.com/vim/vim/commit/1e2258297bb31720bfbeb234f2dae4d1b3b04fbd
* | | modeline: Handle version number overflow. #5450Florian Larysch2016-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #5449 A file containing the string "vim" followed by a very large number in a modeline location will trigger an overflow in getdigits() which is called by chk_modeline() when trying to parse the version number. Add getdigits_safe(), which does not assert overflows, but reports them to the caller.
* | | vim-patch:7.4.2109 (#5518)Michael Ennen2016-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vim-patch:7.4.2109 Problem: Setting 'display' to "lastline" is a drastic change, while omitting it results in lots of "@" lines. Solution: Add "truncate" to show "@@@" for a truncated line. https://github.com/vim/vim/commit/ad9c2a08f0509294269a2f11a59a438b944bdd5a
* | | list_features(): Hack around infinite loop.Justin M. Keyes2016-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | msg_putchar() is not updating msg_col, this causes an infinite loop. Observed with execute('version') *nested* in another execute(), in particular this line: let buildtype = matchstr(execute('version'), '\v\cbuild type:?\s*[^\n\r\t ]+') when called by :CheckHealth (see runtime/autoload/health/nvim .. s:check_performance()). But invoking some variation of execute('...execute("version")') is not enough to provoke the bug, maybe it needs to be in a user function?
* | | CheckHealth: more checksJustin M. Keyes2016-10-25
| | |
* | | version: Allow has("nvim-x"), has("nvim-x.y")Justin M. Keyes2016-10-25
| | |
* | | version: has("nvim-1.2.3")Justin M. Keyes2016-10-25
| | | | | | | | | | | | Helped-by: Daniel Hahler <git@thequod.de>
* | | test/api: Specify handling of VimL errors, v:errmsg.Justin M. Keyes2016-10-24
| |/ |/| | | | | TODO: Also spec behavior of Press-Enter prompt for these API functions.