aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
Commit message (Collapse)AuthorAge
...
* cmdline: CTRL-R: Omit trailing <CR>.Justin M. Keyes2017-02-18
| | | | | | | | | | | | | | The "technically correct" interpretation is to execute the first line that is seen (and this is what happens on middle-click paste in Vim). ^M is only intended to "defuse" the newline, so the user can review it. The parent commit changed the behavior to insert <Space> between lines, but that's a higher-risk change: it is arguably possible that some user *wants* the literal ^M chars when e.g. assigning to a register: :let @a='<C-R>b' To avoid that risk, keep the old behavior and only omit the last ^M. This makes `yy:<C-R>0` nicer at no cost.
* cmdline: CTRL-R: <Space> instead of CR between lines.Justin M. Keyes2017-02-18
| | | | | | | | | ^M isn't any more "correct" than space: the "technically correct" interpretation is to execute the first line that is seen (and this is what happens on middle-click paste in Vim). ^M is only intended to defuse the newline, so that the user can review the command. We can do that with a space instead, and then the command can be executed without having to fix it up first.
* vim-patch:7.4.1948James McCoy2017-02-10
| | | | | | | Problem: Using Ctrl-A with double-byte encoding may result in garbled text. Solution: Skip to the start of a character. (Hirohito Higashi) https://github.com/vim/vim/commit/ad5ca9bc1e7145474adb082775a805f1731e9e37
* Merge #5782 'Visual-mode put from @. register'Justin M. Keyes2017-01-22
|\
| * put fixup, esp. ". register close #5709 #5781Matthew Malcomson2017-01-18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note some bugs were judged to have too ugly a fix to solve, tests to demonstrate these problems, and the explanation behind not fixing them are below. describe('register . problems', function() before_each(reset) -- The difficulty here is: The basic requirement is that the text -- inserted is treated as if it were typed in insert mode. This is why -- the paste method is to enter insert mode and enter the ". register -- into readbuf1. -- We can't add a count into the readbuf here because the insert mode -- count is implemented with readbuf2 which is checked for characters -- after readbuf1. -- Hence, the ".gp command (which adds extra characters into readbuf1 -- to emulate leaving the cursor after the text by moving the cursor -- after inserting the text) would insert the motion characters into -- the buffer instead of using them to move after the insert has been -- done. -- I could probably get this working properly with a special flag put -- into start_redo_ins() and set in do_put(), but I think this adds -- much more complexity than fixing this bug justifies. pending('should not change the ". register with ".2p', function() local orig_register = funcs.getreg('.') feed('2".p') eq(orig_register, funcs.getreg('.')) end) describe("cursor positioning after undo and redo with '.'", function() before_each(reset) local function make_cursor_test(macro_string) return function() feed(macro_string) local afterpos = funcs.getcurpos() local orig_string = curbuf_contents() feed('u.') eq(afterpos, funcs.getcurpos()) expect(orig_string) end end -- The difficulty here is: setting the cursor after the end of the -- pasted text is done by adding a motion command to the -- stuffbuffer after the insert. -- Modifying 'redobuff' is done in the code that handles inserting -- text and moving around. -- I could add a special case in ins_esc() that checks for a flag -- set in do_put() to add the motion character to the redo buffer, -- but I think that is starting to get way too convoluted for the -- benefit. pending('should be the same after ".gp and ".gpu.', make_cursor_test('".gp')) -- The difficulty here is: putting forwards is implemented by using -- 'a' instead of 'i' to start insert. -- Undoing with 'u' an insert that began with 'a' leaves the cursor -- where the first character was inserted, not where the cursor was -- when the 'a' was pressed. -- We account for this the first time by saving the cursor position -- in do_put(), but this isn't stored in redobuff for a second time -- around. -- We can't change how such a fundamental action as undo after -- inserting with 'a' behaves, we could add in a special case -- whereby we set a flag in do_put() and read it when entering -- insert mode but this seems like way too much to fix such a minor -- bug. pending('should be the same after ".pu. and ".pu.u.', make_cursor_test('".pu.')) end) end)
* Rename yank_do_autocmd() to do_autocmd_textyankpost()Marco Hinz2017-01-13
|
* Clipboard: improve error messagesMarco Hinz2016-12-27
|
* vim-patch:7.4.1780 (#5828)lonerover2016-12-26
| | | | | | Problem: Warnings reported by cppcheck. Solution: Fix the warnings. (Dominique Pelle) https://github.com/vim/vim/commit/dc633cf82758f67f656cda7fa8ccc30414ee53f8
* vim-patch:7.4.1634 (#5594)James McCoy2016-11-12
| | | | | | | Problem: Vertical movement after CTRL-A ends up in the wrong column. (Urtica Dioica) Solution: Set curswant when appropriate. (Hirohito Higashi) https://github.com/vim/vim/commit/8e08125d3a9afd0b16cd84454ae9ddad0abaaab0
* 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
* 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.1896 (#5258)Jurica Bradarić2016-08-29
| | | | | | | Problem: Invoking mark_adjust() when adding a new line below the last line is pointless. Solution: Skip calling mark_adjust() when appending below the last line. https://github.com/vim/vim/commit/82faa259cc42379f2a17d598a2a39d14048685b0
* ops.c: Rename start_global_changes().Justin M. Keyes2016-08-25
|
* vim-patch:7.4.1491 #5048Patrick2016-07-18
| | | | | | | Problem: Visual-block shift breaks multi-byte characters. Solution: Compute column differently. (Yasuhiro Matsumoto) Add a test. https://github.com/vim/vim/commit/20b4f463f4ab50fa9bcc9838aa94101fa5698125
* clipboard: fix v:register when clipboard=unnamed,unnamedplusBjörn Linse2016-07-12
|
* op_replace: fix guard; avoid strlen (#4963)Charles Joachim2016-07-09
| | | Closes #4943
* remove some asserts and lintCharles Joachim2016-05-30
|
* ops.c: enable -Wconversion warningCharles Joachim2016-05-30
|
* Fixes suggested by @justinmk and @jbradaricMichael Ennen2016-05-20
|
* vim-patch:7.4.1050Michael Ennen2016-05-19
| | | | | | | Problem: Warning for unused var with tiny features. (Tony Mechelynck) Solution: Add #ifdef. Use vim_snprintf(). Reduce number of statements. https://github.com/vim/vim/commit/c71982b23978ef61d0a2f0fe5535e782e1c561ed
* vim-patch:7.4.1042Jurica Bradaric2016-05-08
| | | | | | | | Problem: g-CTRL-G shows the word count, but there is no way to get the word count in a script. Solution: Add the wordcount() function. (Christian Brabandt) https://github.com/vim/vim/commit/ed767a2073ef150971b0439a58e7ee582af6984e
* *: 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.
* normal: convert MCHAR etc operator and register types to enum MotionTypeBjörn Linse2016-05-01
|
* misc1.c: enable -WconversionCharles Joachim2016-04-17
|
* vim-patch:7.4.973watiko2016-03-06
| | | | | | | | Problem: When pasting on the command line line breaks result in literal <CR> characters. This makes pasting a long file name difficult. Solution: Skip the characters. https://github.com/vim/vim/commit/6f62fed349bf829da2adb02619dc9acba13c8ab6
* Merge #4265 'vim-patch:7.4.925'.Justin M. Keyes2016-03-02
|\
| * vim-patch:7.4.925watiko2016-02-17
| | | | | | | | | | | | | | | | Problem: User may yank or put using the register being recorded in. Solution: Add the recording register in the message. (Christian Brabandt, closes vim/vim#470) https://github.com/vim/vim/commit/a0ed84a26897c994512873a895b9fc54e90c6845
* | ops.c: breakout shared register type formatting codeBjörn Linse2016-02-29
| |
* | TextYankPost: add information to v:event and update testsBjörn Linse2016-02-29
| |
* | Add TextYankPost and TextDeletePost autocmdsShougo Matsushita2016-02-29
|/ | | | | | Reviewed by @watiko Ported from https://github.com/Silex/vim/commit/de53ab72c89affa8ba77536ed8920751c037d127
* vim-patch:7.4.743watiko2016-02-11
| | | | | | | Problem: "p" in Visual mode causes an unexpected line split. Solution: Advance the cursor first. (Yukihiro Nakadaira) https://github.com/vim/vim/commit/c004bc2726eafc7a56d1d9f8398a65a0a7dc8d6c
* vim-patch:7.4.734watiko2016-02-11
| | | | | | | | Problem: ml_get error when using "p" in a Visual selection in the last line. Solution: Change the behavior at the last line. (Yukihiro Nakadaira) https://github.com/vim/vim/commit/d009e8682686a56f7565e6e093a42cd0596e121f
* Fix lint errorwatiko2016-02-01
|
* vim-patch:7.4.1088watiko2016-02-01
| | | | | | | | Problem: Coverity warns for uninitialized variables. Only one is an actual problem. Solution: Move the conditions. Don't use endpos if handling an error. https://github.com/vim/vim/commit/7ae4fbca552c972eb3645ece02a2807e517610d7
* vim-patch:7.4.1087watiko2016-02-01
| | | | | | | | Problem: CTRL-A and CTRL-X do not work properly with blockwise visual selection if there is a mix of Tab and spaces. Solution: Add OP_NR_ADD and OP_NR_SUB. (Hirohito Higashi) https://github.com/vim/vim/commit/d79e55016cf8268cee935f1ac3b5b28712d1399e
* vim-patch:7.4.1085watiko2016-02-01
| | | | | | | Problem: The CTRL-A and CTRL-X commands do not update the '[ and '] marks. Solution: (Yukihiro Nakadaira) https://github.com/vim/vim/commit/a52dfaed104183c1fa2a3b6e4430b23d86bcbece
* vim-patch:7.4.1076watiko2016-02-01
| | | | | | | Problem: CTRL-A does not work well in right-left mode. Solution: Remove reversing the line, add a test. (Hirohito Higashi) https://github.com/vim/vim/commit/6a3c8aff0439c8406082760c54b26e00ff19a90c
* vim-patch:7.4.1027watiko2016-02-01
| | | | | | | Problem: No support for binary numbers. Solution: Add "bin" to nrformats. (Jason Schulz) https://github.com/vim/vim/commit/887c1fea4a114e7170091942d0446c8882701b5b
* vim-patch:7.4.823watiko2016-02-01
| | | | | | | Problem: Cursor moves after CTRL-A on alphabetic character. Solution: (Hirohito Higashi, test by Christian Brabandt) https://github.com/vim/vim/commit/25c2f6783a9d5f15e062bd5b085abe7deb121152
* vim-patch:7.4.806watiko2016-02-01
| | | | | | | | Problem: CTRL-A in Visual mode doesn't work properly with "alpha" in 'nrformat'. Solution: Make it work. (Christian Brabandt) https://github.com/vim/vim/commit/cc218ab3caf983a0dcd3399beb8e1ecfcf0dd25d
* vim-patch:7.4.782watiko2016-02-01
| | | | | | | Problem: Still a few problems with CTRL-A and CTRL-X in Visual mode. Solution: Fix the reported problems. (Christian Brabandt) https://github.com/vim/vim/commit/5d1bc78a2b9fbe3e3112afcde7c80eb19d5989f4
* vim-patch:7.4.780watiko2016-02-01
| | | | | | | | Problem: Compiler complains about uninitialized variable and clobbered variables. Solution: Add Initialization. Make variables static. https://github.com/vim/vim/commit/1db43b1145fe466b5d41af6744a08083983de3a9
* vim-patch:7.4.779watiko2016-02-01
| | | | | | | | Problem: Using CTRL-A in a line without a number moves the cursor. May cause a crash when at the start of the line. (Urtica Dioica) Solution: Do not move the cursor if no number was changed. https://github.com/vim/vim/commit/3ec326198029d5a59413b3b8b33dbc9c06c4f28b
* vim-patch:7.4.778watiko2016-02-01
| | | | | | | Problem: Coverity warns for uninitialized variable. Solution: Change condition of assignment. https://github.com/vim/vim/commit/ae2fe73abc954b8fd3dbd7994daa8e31e6690bd0
* vim-patch:7.4.765watiko2016-02-01
| | | | | | | Problem: CTRL-A and CTRL-X in Visual mode do not always work well. Solution: Improvements for increment and decrement. (Christian Brabandt) https://github.com/vim/vim/commit/9bb1930af908338b68588e988be9601ad144af07
* vim-patch:7.4.754watiko2016-02-01
| | | | | | | | Problem: Using CTRL-A in Visual mode does not work well. (Gary Johnson) Solution: Make it increment all numbers in the Visual area. (Christian Brabandt) https://github.com/vim/vim/commit/3a304b23823b089e499063e8211c5695d049f3ba
* Merge pull request #4049 from watiko/vim-7.4.616Justin M. Keyes2016-01-21
|\ | | | | vim-patch:7.4.616
| * vim-patch:7.4.616watiko2016-01-19
| | | | | | | | | | | | | | Problem: Cannot insert a tab in front of a block. Solution: Correctly compute aop->start. (Christian Brabandt) https://github.com/vim/vim/commit/f2c03d7301d35590a20cc43431950acc3a2f6036
* | Fix lint issuesJason Schulz2016-01-15
| |
* | Add support for binary numbersJason Schulz2016-01-15
|/