diff options
-rw-r--r-- | cmake/GenerateHelptags.cmake.in | 2 | ||||
-rw-r--r-- | runtime/CMakeLists.txt | 2 | ||||
-rw-r--r-- | runtime/doc/Makefile | 2 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | src/nvim/main.c | 3 | ||||
-rw-r--r-- | src/nvim/po/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test49.vim | 2 | ||||
-rw-r--r-- | test/functional/ex_cmds/oldfiles_spec.lua | 93 |
8 files changed, 71 insertions, 36 deletions
diff --git a/cmake/GenerateHelptags.cmake.in b/cmake/GenerateHelptags.cmake.in index 0df10d730e..3ced2c0b17 100644 --- a/cmake/GenerateHelptags.cmake.in +++ b/cmake/GenerateHelptags.cmake.in @@ -25,7 +25,7 @@ file(WRITE ${EMPTY_FILE} "") execute_process( COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/nvim -u NONE - -esX + -es -c "helptags ++t ." -c quit WORKING_DIRECTORY ${HELPTAGS_WORKING_DIRECTORY} diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 46c5cf8235..ef8e38b553 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -38,7 +38,7 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS} COMMAND "${PROJECT_BINARY_DIR}/bin/nvim" -u NONE -i NONE - -esX + -es --headless -c "helptags ++t ." -c quit diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index 07b4226151..7423e63673 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -20,7 +20,7 @@ all: tags html # Use Vim to generate the tags file. Can only be used when Vim has been # compiled and installed. Supports multiple languages. vimtags: $(DOCS) - $(VIMEXE) -u NONE -esX -c "helptags ++t ." -c quit + $(VIMEXE) -u NONE -es -c "helptags ++t ." -c quit # Use "doctags" to generate the tags file. Only works for English! tags: doctags $(DOCS) diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index b8de17738a..976890f7d7 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -218,6 +218,7 @@ Other commands: Other compile-time features: EBCDIC Emacs tags support + X11 integration (see |x11-selection|) Nvim does not have a built-in GUI and hence the following aliases have been removed: gvim, gex, gview, rgvim, rgview diff --git a/src/nvim/main.c b/src/nvim/main.c index 43723ff363..def0c46ae9 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -935,9 +935,6 @@ static void command_line_scan(mparm_T *parmp) want_argument = TRUE; break; - case 'X': /* "-X" don't connect to X server */ - break; - case 'Z': /* "-Z" restricted mode */ restricted = TRUE; break; diff --git a/src/nvim/po/CMakeLists.txt b/src/nvim/po/CMakeLists.txt index 243ac19b33..6687918df4 100644 --- a/src/nvim/po/CMakeLists.txt +++ b/src/nvim/po/CMakeLists.txt @@ -82,7 +82,7 @@ if(HAVE_WORKING_LIBINTL AND GETTEXT_FOUND AND XGETTEXT_PRG AND ICONV_PRG) set(poFile ${CMAKE_CURRENT_SOURCE_DIR}/${name}.po) add_custom_target(check-po-${name} - COMMAND $<TARGET_FILE:nvim> -u NONE -n -e -X + COMMAND $<TARGET_FILE:nvim> -u NONE -n -e -S ${CMAKE_CURRENT_SOURCE_DIR}/check.vim -c "if error == 0 | q | endif" -c cq ${poFile} || ${CMAKE_COMMAND} -E echo "${name}.po failed the check." diff --git a/src/nvim/testdir/test49.vim b/src/nvim/testdir/test49.vim index 4cb500292d..afee9d882c 100644 --- a/src/nvim/testdir/test49.vim +++ b/src/nvim/testdir/test49.vim @@ -456,7 +456,7 @@ function! ExtraVim(...) " messing up the user's viminfo file. let redirect = a:0 ? \ " -c 'au VimLeave * redir END' -c 'redir\\! >" . a:1 . "'" : "" - exec "!echo '" . debug_quits . "q' | ../../../build/bin/nvim -u NONE -N -Xes" . redirect . + exec "!echo '" . debug_quits . "q' | ../../../build/bin/nvim -u NONE -N -es" . redirect . \ " -c 'debuggreedy|set viminfo+=nviminfo'" . \ " -c 'let ExtraVimBegin = " . extra_begin . "'" . \ " -c 'let ExtraVimResult = \"" . resultfile . "\"'" . breakpoints . diff --git a/test/functional/ex_cmds/oldfiles_spec.lua b/test/functional/ex_cmds/oldfiles_spec.lua index fedf5babe8..d54e43f6cb 100644 --- a/test/functional/ex_cmds/oldfiles_spec.lua +++ b/test/functional/ex_cmds/oldfiles_spec.lua @@ -1,49 +1,86 @@ -local h = require('test.functional.helpers') +local Screen = require('test.functional.ui.screen') +local helpers = require('test.functional.helpers') -local buf = h.curbufmeths -local command = h.command -local eq = h.eq -local execute = h.execute -local feed = h.feed -local nvim = h.nvim +local buf, eq, execute = helpers.curbufmeths, helpers.eq, helpers.execute +local feed, nvim, nvim_prog = helpers.feed, helpers.nvim, helpers.nvim_prog +local set_session, spawn = helpers.set_session, helpers.spawn local shada_file = 'test.shada' --- h.clear() uses "-i NONE", which is not useful for this test. -local function clear() +-- +-- helpers.clear() uses "-i NONE", which is not useful for this test. +-- +local function _clear() if session then session:exit(0) end - h.set_session(h.spawn({h.nvim_prog, - '-u', 'NONE', - '--cmd', 'set noswapfile undodir=. directory=. viewdir=. backupdir=.', - '--embed'})) + set_session(spawn({nvim_prog, + '-u', 'NONE', + '--cmd', 'set noswapfile undodir=. directory=. viewdir=. backupdir=.', + '--embed'})) end describe(':oldfiles', function() - before_each(clear) + before_each(_clear) - it('shows most recently used files', function() - command('edit testfile1') - command('edit testfile2') - command('wshada ' .. shada_file) - command('rshada! ' .. shada_file) - assert(string.find(nvim('command_output', 'oldfiles'), 'testfile2')) + after_each(function() os.remove(shada_file) end) + + local function add_padding(s) + return s .. string.rep(' ', 96 - string.len(s)) + end + + it('shows most recently used files', function() + screen = Screen.new(100, 5) + screen:attach() + execute('edit testfile1') + local filename1 = buf.get_name() + execute('edit testfile2') + local filename2 = buf.get_name() + execute('wshada ' .. shada_file) + execute('rshada! ' .. shada_file) + execute('oldfiles') + screen:expect([[ + testfile2 | + 1: ]].. add_padding(filename1) ..[[ | + 2: ]].. add_padding(filename2) ..[[ | + | + Press ENTER or type command to continue^ | + ]]) + end) end) describe(':oldfiles!', function() - it('provides a file selection prompt and edits the chosen file', function() - command('edit testfile1') - command('edit testfile2') - local filename = buf.get_name() - command('wshada ' .. shada_file) - clear() - command('rshada! ' .. shada_file) + local filename + + before_each(function() + _clear() + execute('edit testfile1') + execute('edit testfile2') + filename = buf.get_name() + execute('wshada ' .. shada_file) + _clear() + execute('rshada! ' .. shada_file) execute('oldfiles!') + end) + + after_each(function() + os.remove(shada_file) + end) + + it('provides a prompt and edits the chosen file', function() feed('2<cr>') eq(filename, buf.get_name()) - os.remove(shada_file) + end) + + it('provides a prompt and does nothing on <cr>', function() + feed('<cr>') + eq('', buf.get_name()) + end) + + it('provides a prompt and does nothing if choice is out-of-bounds', function() + feed('3<cr>') + eq('', buf.get_name()) end) end) |