Vim-fork focused on extensibility and usability
Go to file
Matthew Malcomson b7ee8fbc81 put fixup, esp. ". register close #5709 #5781
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)
2017-01-18 12:28:10 +00:00
.ci win: ci/AppVeyor: Rearrange PATH setup for python. (#5946) 2017-01-15 14:45:14 +01:00
cmake build: prevent in-tree builds for the time being, as it's not supported 2016-10-11 20:20:31 -04:00
config build: Do not check for obsolete <termio.h> 2016-12-24 17:41:06 +01:00
contrib Revert "Makefile: add PREFIX variable" 2016-10-16 12:17:00 +02:00
man man: fix description of XDG_DATA_HOME (#5120) 2016-07-27 08:52:35 -04:00
runtime DirChanged: set <amatch> (#5961) 2017-01-17 10:47:20 +01:00
scripts vim-patch:8.0.0121 2017-01-13 23:40:59 +01:00
src put fixup, esp. ". register close #5709 #5781 2017-01-18 12:28:10 +00:00
test put fixup, esp. ". register close #5709 #5781 2017-01-18 12:28:10 +00:00
third-party tui: check stty/termios for kbs 2016-12-23 18:28:54 +01:00
unicode Update unicode files 2016-09-24 14:03:22 -04:00
.editorconfig add .editorconfig 2016-02-23 18:03:27 +09:00
.gitignore ignore .res files generated by the tests in testdir 2016-08-11 02:14:02 -04:00
.travis.yml Merge pull request #5827 from justinmk/travisupdate 2016-12-27 23:25:24 -05:00
appveyor.yml ci: Update appveyor artifact path. 2016-12-09 17:09:17 +01:00
BACKERS.md Update backer URL 2015-11-11 19:50:33 -08:00
CMakeLists.txt win: Define USE_FNAME_CASE (#5962) 2017-01-17 16:32:41 +01:00
CONTRIBUTING.md doc: CONTRIBUTING.md (#5239) 2016-08-23 23:49:09 -04:00
ISSUE_TEMPLATE.md doc: precision, concision, elision 2016-06-03 17:11:10 -04:00
LICENSE LICENSE: add LuaJIT notice. #899 2014-06-30 13:59:56 -04:00
Makefile build: Make clean targets more thorough 2016-12-02 20:38:55 -05:00
README.md doc: README.md: update appveyor URL 2016-12-11 01:32:28 +01:00

Neovim

Wiki | Documentation | Twitter | Community | Gitter Chat

Travis Build Status AppVeyor Build status Pull requests waiting for review Coverage Status Coverity Scan Build Clang Scan Build Debian

Neovim is a project that seeks to aggressively refactor Vim in order to:

For more details, see the wiki!

Throughput Graph

What's been done so far

See :help nvim-features for a comprehensive list.

What's being worked on now

See the Roadmap.

How do I get it?

There is a Debian package, homebrew formula, PKGBUILD for Arch Linux, RPM, and more. See the wiki!

License

Neovim is licensed under the terms of the Apache 2.0 license, except for parts that were contributed under the Vim license.

  • Contributions committed before b17d96 remain under the Vim license.

  • Contributions committed after b17d96 are licensed under Apache 2.0 unless those contributions were copied from Vim (identified in the commit logs by the vim-patch token).

See LICENSE for details.

Vim is Charityware.  You can use and copy it as much as you like, but you are
encouraged to make a donation for needy children in Uganda.  Please see the
kcc section of the vim docs or visit the ICCF web site, available at these URLs:

        http://iccf-holland.org/
        http://www.vim.org/iccf/
        http://www.iccf.nl/

You can also sponsor the development of Vim.  Vim sponsors can vote for
features.  The money goes to Uganda anyway.