aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
Commit message (Collapse)AuthorAge
...
| * *: Provide list length when allocating listsZyX2018-01-14
| |
* | vim-patch:8.0.0421: diff mode wrong when adding line at end of bufferckelsel2018-01-15
|/ | | | | | | | Problem: Diff mode is displayed wrong when adding a line at the end of a buffer. Solution: Adjust marks in diff mode. (James McCoy, closes vim/vim#1329) https://github.com/vim/vim/commit/f58a8475e17bd566760fc7e2a17d35ddf4edacf2
* *: Fix linter errorsZyX2017-12-11
|
* *: Hide list implementation in other files as wellZyX2017-12-10
|
* *: Start hiding list implementationZyX2017-12-10
| | | | Most of files, except for eval.c and eval/* were only processed by perl.
* docJustin M. Keyes2017-11-06
|
* doc: replace ":CheckHealth" with ":checkhealth"Justin M. Keyes2017-10-17
|
* ops: save and restore clipboard batch status when entering cmdline windowBjörn Linse2017-10-15
|
* vim-patch:8.0.0282 vim-patch:8.0.0291 (#7255)KunMing Xie2017-09-10
| | | | | | | | | | | | | | | | | | | | vim-patch:8.0.0291 Problem: Visual block insertion does not insert in all lines. Solution: Don't bail out of insert too early. Add a test. (Christian Brabandt, closes vim/vim#1290) https://github.com/vim/vim/commit/23fa81d2223cd9bb7c51829c48047b2976bc2d11 vim-patch:8.0.0282 Problem: When doing a Visual selection and using "I" to go to insert mode, CTRL-O needs to be used twice to go to Normal mode. (Coacher) Solution: Check for the return value of edit(). (Christian Brabandt, closes #1290) https://github.com/vim/vim/commit/0b5c93a7f266cd8c90ea27bdaf9f7214a95d64d7
* clipboard: disallow recursion; show hint only once (#7203)Justin M. Keyes2017-08-22
| | | | | | | | - Show hint only once per session. - provider#clipboard#Call(): prevent recursion - provider#clear_stderr(): use has_key(), because :silent! is still captured by :redir. closes #7184
* clipboard: remove start_batch_changes() in redir_write()Justin M. Keyes2017-08-20
| | | | | | | | | | | | | | | | | | | | | | | | start_batch_changes() doesn't avoid invoking the clipboard once-per-line, because the loop is actually in ex_echo(), which calls redir_write() for each message. But we've already entered start_batch_changes() by then, so that was never the problem. redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523 msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600 msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221 ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433 do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242 Trying to defer _explicit_ clipboard updates is difficult. :redir @+ | silent echo system('cat foo') | redir END is essentially equivalent to: for l in readfile('foo') let @+ .= l endfor We cannot make judgements about when to ignore a script's bad decisions. start_batch_changes() only works around the case of clipboard=unnamed, i.e. _implicit_ clipboard updates (`:g/foo/d`). Not explicit assignment.
* clipboard: avoid error flood during :redirJustin M. Keyes2017-08-20
| | | | | | | | | | | | | | | | | | redir_write(): - This is a "batch" operation which was not yet covered by start_batch_changes() adjust_clipboard_name(): - msg() and friends during :redir will, of course, cause redir_write() to try to capture that message, which causes recursion. - EMSG() here is trouble: if it interrupts :redir it is a mess. Rather than deal with the mess, show a non-error message. closes #7182 closes #7184 closes #7183 ref #6048 ref #7032
* bufhl: fix moveBjörn Linse2017-06-24
|
* Merge #6863Justin M. Keyes2017-06-19
|\
| * coverity/112076: fixing "Explicit null dereferenced"Chris Hall2017-06-20
|/ | | | | | | | | | if (oap->regname == 0 && oap->motion_type != kMTLineWise && oap->line_count == 0 && !oap->use_reg_one ){ then reg is not initialised and our call to set_clipboard will dereference NULL }
* lintJames McCoy2017-06-04
|
* vim-patch:7.4.1976James McCoy2017-06-04
| | | | | | | Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
* style/lintAdnoC2017-05-31
|
* eval: Add ability to set the unnamed register with setregAdnoC2017-05-31
|
* shada: Set the unnamed register to the previous unnamed register on startupAdnoC2017-05-31
|
* *: Add comment to all C filesZyX2017-04-19
|
* ops: Silence “counter not used in loop” false positiveZyX2017-04-16
|
* ops: Remove FUNC_ATTR_MALLOC from copy_registerZyX2017-04-15
| | | Returned storage has a pointer to a newly allocated array.
* lint: fix clint errors around mb_tolower callsBjörn Linse2017-04-10
|
* mbyte: replace vim_tolower with mb_tolower handling locale correctlyBjörn Linse2017-04-10
|
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* eval: Split and move dict_add_nr_str to typval.cZyX2017-03-29
| | | | Function was split into tv_dict_add_nr() and tv_dict_add_str().
* eval: Move dict_add_list and dict_add_dict to typval.cZyX2017-03-29
|
* eval: Move dict_set_keys_readonly to typval.cZyX2017-03-29
|
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* eval: Split eval.c into smaller filesZyX2017-03-29
|
* linter: make changes pass the linterraichoo2017-03-19
|
* vim-patch:7.4.2333raichoo2017-03-19
| | | | | | | Problem: Outdated comments in test. Solution: Cleanup normal mode test. (Christian Brabandt) https://github.com/vim/vim/commit/31845093b7f1b33e0c7e9e592bef65528674a1f2
* 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
* vim-patch:8.0.0136Justin M. Keyes2017-03-02
| | | | | | | | Problem: When using indent folding and changing indent the wrong fold is opened. (Jonathan Fudger) Solution: Open the fold under the cursor a bit later. (Christian Brabandt) https://github.com/vim/vim/commit/54b2bfa399017ebae76ed62f21578261d1b55c1f
* 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
|