aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
Commit message (Collapse)AuthorAge
...
* refactor!: delete insertmode (#18547)Gregory Anders2022-05-22
| | | | | | | Neovim already removed `evim` (or any similar flags). The 'insertmode' option is a weird remnant, so get rid of it. The 'insertmode' option is replaced with a script that closely emulates the option. This script is documented at :help 'insertmode'
* vim-patch:8.1.0535: increment/decrement might get interrupted by updating foldszeertzjq2022-05-22
| | | | | | | Problem: Increment/decrement might get interrupted by updating folds. Solution: Disable fold updating for a moment. (Christian Brabandt, closes vim/vim#3599) https://github.com/vim/vim/commit/6b731886ca94d66b9bdedfb7e603af44a6400399
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.4951: smart indenting done when not enabledzeertzjq2022-05-14
| | | | | | Problem: Smart indenting done when not enabled. Solution: Check option values before setting can_si. (closes vim/vim#10420) https://github.com/vim/vim/commit/de5cf287812510d2c8ffe66b99cf33c4e1a6e6f1
* refactor: replace char_u variables and functions with charDundar Goc2022-05-11
| | | | Work on https://github.com/neovim/neovim/issues/459
* vim-patch:8.2.4911: the mode #defines are not clearly named (#18499)zeertzjq2022-05-10
| | | | | | | | Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first. https://github.com/vim/vim/commit/249591057b4840785c50e41dd850efb8a8faf435 A hunk from the patch depends on patch 8.2.4861, which hasn't been ported yet, but that should be easy to notice.
* refactor: replace char_u variables and functions with charDundar Goc2022-05-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* Merge pull request #18425 from dundargoc/refactor/char_u/1bfredl2022-05-07
|\ | | | | refactor: replace char_u variables and functions with char
| * refactor: replace char_u variables and functions with charDundar Goc2022-05-07
| | | | | | | | Work on https://github.com/neovim/neovim/issues/459
* | build(clint): remove "function size is too large" warningDundar Goc2022-05-06
|/ | | | | | | | This warning is essentially only triggered for ported vim functions. It's unlikely that we'll refactor vim functions solely based on their size since it'd mean we'd greatly deviate from vim, which is a high cost when it comes to importing the vim patches. Thus, this warning only serves as an annoyance and should be removed.
* refactor: replace char_u variables and functions with charDundar Goc2022-05-05
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-04
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-03
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor(uncrustify): change rules to better align with the style guideDundar Goc2022-04-29
| | | | | | | | | | | | | Add space around arithmetic operators '+' and '-'. Remove space between back-to-back parentheses, i.e. ')(' vs. ') ('. Remove space between '((' or '))' of control statements. Add space between ')' and '{' of control statements. Remove space between function name and '(' on function declaration. Collapse empty blocks between '{' and '}'. Remove newline at the end of the file. Remove newline between 'enum' and '{'. Remove newline between '}' and ')' in a function invocation. Remove newline between '}' and 'while' of 'do' statement.
* refactor: convert macros to all-caps (#17895)dundargoc2022-04-24
| | | Closes https://github.com/neovim/neovim/issues/6297
* vim-patch:8.2.4794: compiler warning for not initialized variablezeertzjq2022-04-21
| | | | | | Problem: Compiler warning for not initialized variable. Solution: Initialize the variable. (John Marriott) https://github.com/vim/vim/commit/4c84dd33ad739237bb38bb4e51702af972b5e507
* vim-patch:8.2.4792: indent operator creates an undo entry for every linezeertzjq2022-04-21
| | | | | | Problem: Indent operator creates an undo entry for every line. Solution: Create one undo entry for all lines. (closes vim/vim#10227) https://github.com/vim/vim/commit/e4686989944bffdbcf59890aa21091b135528618
* fix(events): make v:event readonly in more events (#18070)zeertzjq2022-04-11
| | | | | | | This makes v:event readonly in these four events: - ChanInfo - ChanOpen - RecordingLeave - TermClose
* vim-patch:8.2.4649: various formatting problemszeertzjq2022-03-30
| | | | | | Problem: Various formatting problems. Solution: Improve the code formatting. https://github.com/vim/vim/commit/b4ad3b0deac12674a7773311890b48fd39c6807c
* fix(PVS/V1019): compound assignment expression is used inside conditionDundar Göc2022-03-24
|
* vim-patch:8.2.4593: unnecessary call to redraw_later() (#17775)zeertzjq2022-03-19
| | | | | Problem: Unnecessary call to redraw_later(). Solution: Remove the call to redraw_later() in op_yank(). (closes vim/vim#9971) https://github.com/vim/vim/commit/95d2e7634ccd8e0da78086002509a856999e180c
* Merge pull request #17653 from dundargoc/chore/lgtmzeertzjq2022-03-10
|\ | | | | fix lgtm warnings
| * chore(lgtm): fix "empty block without comment" warningsDundar Göc2022-03-09
| |
* | vim-patch:8.1.0999: use register one too often and not properly testedzeertzjq2022-03-09
| | | | | | | | | | | | | | Problem: Use register one too often and not properly tested. Solution: Do not always use register one when specifying a register. (closes vim/vim#4085) Add more tests. https://github.com/vim/vim/commit/9d7fdd403a3a9ee0d008b6dcbcd2ecc9ec0f57b7
* | refactor(ops): use op_yank_reg() instead of op_yank() when deletingzeertzjq2022-03-09
|/ | | | Needed for Vim patch 8.1.0999.
* vim-patch:8.2.0997: cannot execute a register containing line continuationzeertzjq2022-03-09
| | | | | | | | | | Problem: Cannot execute a register containing line continuation. Solution: Concatenate lines where needed. (Yegappan Lakshmanan, closes vim/vim#6272) https://github.com/vim/vim/commit/856c1110c1cf0d6e44e387b70732ca4b4c8ef0f2 According to #2542 the "Future:" part was removed intentionally. Use size_t in more places to reduce type casts.
* vim-patch:8.2.3601: check for overflow in put count does not work wellSean Dewar2022-02-17
| | | | | | | | | | | | | | | Problem: Check for overflow in put count does not work well. Solution: Improve the overflow check. (Ozaki Kiichi, closes vim/vim#9102) https://github.com/vim/vim/commit/fa53722367c3793fda95dac665af74b8651065e9 Add some casts as Nvim uses size_t variables in some places. We could technically adjust the logic to check for overflow outside of size_t's range, but it's much easier to just port the patch exactly (also means we can use the same tests). v:sizeoflong is N/A, so convert the 64-bit tests to Lua and use the FFI to check long's size.
* fix(ops): str_to_reg passing NULL to memcpySean Dewar2022-02-17
| | | | | | | Required for the tests introduced in v8.2.3601 to pass ASAN when running test_alot.vim. Co-authored-by: erw7 <erw7.github@gmail.com>
* vim-patch:8.2.3575: overflow check still fails when sizeof(int) == sizeof(long)Sean Dewar2022-02-17
| | | | | | | | | | Problem: Overflow check still fails when sizeof(int) == sizeof(long). Solution: Use a float to check the result. https://github.com/vim/vim/commit/e551ccfb9311eea5252d1c3106ff7a53c762d994 This approach is... interesting... Tests fail.
* vim-patch:8.2.3574: divide by zeroSean Dewar2022-02-17
| | | | | | Problem: Divide by zero. Solution: Don't check for overflow if multiplicand is zero. https://github.com/vim/vim/commit/8a1962d1355096af55e84b1ea2f0baf5f1c5a5bc
* vim-patch:8.2.3573: cannot decide whether to skip test that fails with 64 bitSean Dewar2022-02-17
| | | | | | | | | | Problem: Cannot decide whether to skip test that fails with 64 bit ints. (closes vim/vim#9072) Solution: Add v:sizeofint, v:sizeoflong and v:sizeofpointer. Improve the check for multiply overflow. https://github.com/vim/vim/commit/69b3072d984480935ec412b32b97fea974d2b689 Omit v:sizeof{int,long,pointer} as they're only really used for tests.
* vim-patch:8.2.3492: crash when pasting too many timesSean Dewar2022-02-17
| | | | | | | | | | | | | | | | | | | Problem: Crash when pasting too many times. Solution: Limit the size to what fits in an int. (closes vim/vim#8962) https://github.com/vim/vim/commit/eeed1c7ae090c17f4df51cf97b2a9e4d8b4f4dc7 Note that this overflow check pretty bad. It also doesn't work well on Windows (where sizeof(int) == sizeof(long)). This is all temporary; everything here is rewritten in future patches anyway. e_resulting_text_too_long was already cherry-picked. totlen is size_t in Nvim, but is int in Vim. This means we'll need some casts. We could technically adjust the logic in do_put to use the entire range of size_t in stuff like totlen, but there's not much gain, and it's much easier to just port the patch like Vim as was done before (also allows us to use the same tests).
* vim-patch:8.2.4388: dead code in op_insert()zeertzjq2022-02-15
| | | | | | Problem: Dead code in op_insert(). Solution: Remove condition and else block. (closes vim/vim#9782) https://github.com/vim/vim/commit/7745f14ef324a7134b2f26a47451cf5032f44b89
* vim-patch:8.2.3820: "vrc" does not replace composing characterszeertzjq2022-02-15
| | | | | | | | | | | | | Problem: "vrc" does not replace composing characters, while "rc" does. Solution: Check the byte length including composing characters. (closes vim/vim#9351) https://github.com/vim/vim/commit/8ee6028de3daa9af9e5f90fa9e583ff407bee04f vim-patch:8.2.3823: test for visual replace is in wrong function Problem: Test for visual replace is in wrong function. Solution: Move it to another function. https://github.com/vim/vim/commit/6ecf58b0d7d9b8fbba780d19d2e6c0f227df715b
* vim-patch:8.2.4151: reading beyond the end of a lineSean Dewar2022-02-14
| | | | | | Problem: Reading beyond the end of a line. Solution: For block insert only use the offset for correcting the length. https://github.com/vim/vim/commit/57df9e8a9f9ae1aafdde9b86b10ad907627a87dc
* vim-patch:8.2.4120: block insert goes over the end of the lineSean Dewar2022-02-14
| | | | | | Problem: Block insert goes over the end of the line. Solution: Handle invalid byte better. Fix inserting the wrong text. https://github.com/vim/vim/commit/9f8c304c8a390ade133bac29963dc8e56ab14cbc
* vim-patch:8.2.3073: when cursor is move for block append wrong text is insertedSean Dewar2022-02-14
| | | | | | | Problem: When cursor is move for block append wrong text is inserted. Solution: Calculate an offset. (Christian Brabandt, closes vim/vim#8433, closes vim/vim#8288) https://github.com/vim/vim/commit/4067bd3604215b48e4b4201e28f9e401b08418e4
* vim-patch:8.1.2221: cannot filter :disp outputzeertzjq2022-02-10
| | | | | | Problem: Cannot filter :disp output. Solution: Support filtereing :disp output. (Andi Massimino, closes vim/vim#5117) https://github.com/vim/vim/commit/8fc42964363087025a27e8c80276c706536fc4e3
* Merge pull request #17342 from zeertzjq/mbyte-constzeertzjq2022-02-10
|\ | | | | refactor(mbyte.c): add const qualifiers
| * refactor(mbyte.c): add const qualifierszeertzjq2022-02-09
| | | | | | | | | | This only touches functions that do not return a pointer. Also add a note about the differences between mb_head_off() and utf_head_off().
* | vim-patch:8.2.4242: put in Visual mode cannot be repeatedzeertzjq2022-02-09
|/ | | | | | | | | | Problem: Put in Visual mode cannot be repeated. Solution: Use "P" to put without yanking the deleted text into the unnamed register. (Shougo Matsushita, closes vim/vim#9591) https://github.com/vim/vim/commit/fb55207ed17918c8a2a6cadf5ad9d5fcf686a7ab Cherry-pick get_y_previous() and set_y_previous() from patch 8.1.1736. Nvim has removed y_current, so code related to it is N/A.
* Merge pull request #16818 from zeertzjq/vim-8.2.3454zeertzjq2022-02-03
|\ | | | | vim-patch:8.2.{3454,3455,3497,3540,3581,3678}: some "p" and "gp" patches
| * vim-patch:8.2.3678: illegal memory accesszeertzjq2022-01-29
| | | | | | | | | | | | Problem: Illegal memory access. Solution: Ignore changed indent when computing byte offset. https://github.com/vim/vim/commit/85be8563fe5aff686e9e30d6afff401ccd976f2a
| * vim-patch:8.2.3540: the mark '] is wrong after put with a countzeertzjq2022-01-29
| | | | | | | | | | | | Problem: The mark '] is wrong after put with a count. (Naohiro Ono) Solution: Use the right line number. (closes vim/vim#8956) https://github.com/vim/vim/commit/f47ebf1e1a0a6473b10fb4c92c9c6427aab4dc91
| * vim-patch:8.2.3455: using a count with "gp" leaves '] in wrong positionzeertzjq2022-01-29
| | | | | | | | | | | | Problem: Using a count with "gp" leaves '] in wrong position. (Naohiro Ono) Solution: Correct the mark position. (closes vim/vim#8899) https://github.com/vim/vim/commit/56858e4ed4e338e15821767b8303b06099e40384
| * vim-patch:8.2.3454: using a count with "gp" leave cursor in wrong positionzeertzjq2022-01-29
| | | | | | | | | | | | | | Problem: Using a count with "gp" leave cursor in wrong position. (Naohiro Ono) Solution: Count the inserted lines. (closes vim/vim#8899) https://github.com/vim/vim/commit/23003e51e18371afda4420d9e171a3dcba5a31cc
* | Merge pull request #17226 from dundargoc/refactor/remove-redundant-codezeertzjq2022-02-03
|\ \ | | | | | | vim-patch:8.2.4241: some type casts are redundant
| * | vim-patch:8.2.4241: some type casts are redundantDundar Göc2022-01-30
| |/ | | | | | | | | | | | | | | Problem: Some type casts are redundant. Solution: Remove the type casts. (closes vim/vim#9643) https://github.com/vim/vim/commit/420fabcd4ffeaf79082a6e43db91e1d363f88f27 This is not a literal port but an equivalent one.
* / vim-patch:8.2.3932: C line comment not formatted properlyzeertzjq2022-01-31
|/ | | | | | | Problem: C line comment not formatted properly. Solution: If a line comment follows after "#if" the next line is not the end of a paragraph. https://github.com/vim/vim/commit/264d3ddac0f9474816c20a0e92014d6f7f4b08ac
* vim-patch:8.1.2302: :lockmarks does not work for '[ and ']Sean Dewar2022-01-27
| | | | | | | | | Problem: :lockmarks does not work for '[ and ']. Solution: save and restore '[ and '] marks. (James McCoy, closes vim/vim#5222) https://github.com/vim/vim/commit/f4a1d1c0542df151bc59ac3b798ed198b5c71ccc Test_diff_maintains_change_mark doesn't actually fail without these changes. This is fixed in v8.2.3936.