aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/scripts/reviews.js4
-rw-r--r--cmake.packaging/CMakeLists.txt9
-rw-r--r--cmake.packaging/WixPatch.xml31
-rw-r--r--runtime/doc/news.txt2
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--runtime/doc/vim_diff.txt1
-rw-r--r--runtime/ftplugin/c.lua1
-rw-r--r--runtime/ftplugin/calender.lua1
-rw-r--r--runtime/ftplugin/css.lua1
-rw-r--r--runtime/ftplugin/indent.lua1
-rw-r--r--runtime/ftplugin/xdefaults.lua1
-rw-r--r--src/nvim/autocmd.c4
-rw-r--r--src/nvim/options.lua2
-rw-r--r--src/nvim/window.c2
-rw-r--r--test/functional/api/buffer_updates_spec.lua2
-rw-r--r--test/functional/legacy/prompt_buffer_spec.lua45
-rw-r--r--test/functional/legacy/window_cmd_spec.lua1
-rw-r--r--test/functional/ui/fold_spec.lua7
-rw-r--r--test/old/testdir/setup.vim1
-rw-r--r--test/old/testdir/test_prompt_buffer.vim41
-rw-r--r--test/unit/helpers.lua6
21 files changed, 134 insertions, 31 deletions
diff --git a/.github/scripts/reviews.js b/.github/scripts/reviews.js
index 0ed382ac30..2aeedd0c81 100644
--- a/.github/scripts/reviews.js
+++ b/.github/scripts/reviews.js
@@ -10,12 +10,10 @@ module.exports = async ({github, context}) => {
const team_reviewers = new Array()
if (labels.includes('api')) {
reviewers.add("bfredl")
- reviewers.add("muniter")
}
if (labels.includes('build')) {
- reviewers.add("jamessan")
- reviewers.add("justinmk")
+ team_reviewers.push('ci');
}
if (labels.includes('ci')) {
diff --git a/cmake.packaging/CMakeLists.txt b/cmake.packaging/CMakeLists.txt
index df43f2806a..b5c91ac457 100644
--- a/cmake.packaging/CMakeLists.txt
+++ b/cmake.packaging/CMakeLists.txt
@@ -34,8 +34,13 @@ if(WIN32)
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
set(CPACK_WIX_PRODUCT_ICON ${PROJECT_SOURCE_DIR}/runtime/neovim.ico)
- # We use a wix patch to add further options to the installer. At present, it's just to add neovim to the path
- # on installation, however, it can be extended.
+ # Create start menu and desktop shortcuts
+ set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME}")
+ set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim" "nvim-qt" "Neovim Qt")
+ set(CPACK_CREATE_DESKTOP_LINKS "nvim-qt")
+
+ # We use a wix patch to add further options to the installer. At present, it just adds neovim to the path
+ # on installation and defines per-user installation, however, it can be extended.
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
diff --git a/cmake.packaging/WixPatch.xml b/cmake.packaging/WixPatch.xml
index 3cbbb04850..1179292636 100644
--- a/cmake.packaging/WixPatch.xml
+++ b/cmake.packaging/WixPatch.xml
@@ -1,14 +1,21 @@
<CPackWiXPatch>
- <!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
- <CPackWiXFragment Id="CM_CP_bin.nvim.exe">
- <Environment
- Id='UpdatePath'
- Name='PATH'
- Action='set'
- Permanent='no'
- System='yes'
- Part='last'
- Value='[INSTALL_ROOT]bin'
- />
- </CPackWiXFragment>
+ <!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
+ <CPackWiXFragment Id="CM_CP_bin.nvim.exe">
+ <Environment
+ Id='UpdatePath'
+ Name='PATH'
+ Action='set'
+ Permanent='no'
+ System='no'
+ Part='last'
+ Value='[INSTALL_ROOT]bin'
+ />
+ </CPackWiXFragment>
+
+ <!-- Allow installation by non-administrative users -->
+ <!-- https://learn.microsoft.com/windows/win32/msi/allusers -->
+ <CPackWiXFragment Id="#PRODUCT">
+ <Property Id="ALLUSERS" Value="2" />
+ <Property Id="MSIINSTALLPERUSER" Value="1" />
+ </CPackWiXFragment>
</CPackWiXPatch>
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 7b71b53b29..3ef6451ef9 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -66,6 +66,8 @@ The following changes may require adaptations in user config or plugins.
change is that language-specific highlight groups need to be renamed from
`@foo.help` to `@foo.vimdoc`.
+• The default value of 'commentstring' is now empty instead of "/*%s*/".
+
==============================================================================
NEW FEATURES *news-features*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 36c02fa3cb..096b334cda 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1390,7 +1390,7 @@ A jump table for the options with a short description can be found at |Q_op|.
insert a space.
*'commentstring'* *'cms'* *E537*
-'commentstring' 'cms' string (default "/*%s*/")
+'commentstring' 'cms' string (default "")
local to buffer
A template for a comment. The "%s" in the value is replaced with the
comment text. Currently only used to add markers for folding, see
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index cd93e4d17a..d6ad9107b3 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -34,6 +34,7 @@ Defaults *nvim-defaults*
- 'backspace' defaults to "indent,eol,start"
- 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created
- 'belloff' defaults to "all"
+- 'commentstring' defaults to ""
- 'compatible' is always disabled
- 'complete' excludes "i"
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
diff --git a/runtime/ftplugin/c.lua b/runtime/ftplugin/c.lua
new file mode 100644
index 0000000000..b4e68148f5
--- /dev/null
+++ b/runtime/ftplugin/c.lua
@@ -0,0 +1 @@
+vim.bo.commentstring = '/*%s*/'
diff --git a/runtime/ftplugin/calender.lua b/runtime/ftplugin/calender.lua
new file mode 100644
index 0000000000..b4e68148f5
--- /dev/null
+++ b/runtime/ftplugin/calender.lua
@@ -0,0 +1 @@
+vim.bo.commentstring = '/*%s*/'
diff --git a/runtime/ftplugin/css.lua b/runtime/ftplugin/css.lua
new file mode 100644
index 0000000000..b4e68148f5
--- /dev/null
+++ b/runtime/ftplugin/css.lua
@@ -0,0 +1 @@
+vim.bo.commentstring = '/*%s*/'
diff --git a/runtime/ftplugin/indent.lua b/runtime/ftplugin/indent.lua
new file mode 100644
index 0000000000..b4e68148f5
--- /dev/null
+++ b/runtime/ftplugin/indent.lua
@@ -0,0 +1 @@
+vim.bo.commentstring = '/*%s*/'
diff --git a/runtime/ftplugin/xdefaults.lua b/runtime/ftplugin/xdefaults.lua
new file mode 100644
index 0000000000..b4e68148f5
--- /dev/null
+++ b/runtime/ftplugin/xdefaults.lua
@@ -0,0 +1 @@
+vim.bo.commentstring = '/*%s*/'
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index 578542adfe..9b4cb336bc 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -1495,7 +1495,9 @@ void aucmd_restbuf(aco_save_T *aco)
}
}
win_found:
-
+ // May need to stop Insert mode if we were in a prompt buffer.
+ leaving_window(curwin);
+ // Remove the window.
win_remove(curwin, NULL);
pmap_del(handle_T)(&window_handles, curwin->handle);
if (curwin->w_grid_alloc.chars != NULL) {
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 7be8f568b5..dffebcf14e 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -413,7 +413,7 @@ return {
alloced=true,
redraw={'curswant'},
varname='p_cms',
- defaults={if_true="/*%s*/"}
+ defaults={if_true=""}
},
{
full_name='compatible', abbreviation='cp',
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 762ad13ba3..48663c5a20 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2417,7 +2417,7 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
}
}
-static void leaving_window(win_T *const win)
+void leaving_window(win_T *const win)
FUNC_ATTR_NONNULL_ALL
{
// Only matters for a prompt window.
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua
index 25b838a4af..80e29c1ff2 100644
--- a/test/functional/api/buffer_updates_spec.lua
+++ b/test/functional/api/buffer_updates_spec.lua
@@ -75,7 +75,7 @@ local function reopenwithfolds(b)
local tick = reopen(b, origlines)
-- use markers for folds, make all folds open by default
- command('setlocal foldmethod=marker foldlevel=20')
+ command('setlocal foldmethod=marker foldlevel=20 commentstring=/*%s*/')
-- add a fold
command('2,4fold')
diff --git a/test/functional/legacy/prompt_buffer_spec.lua b/test/functional/legacy/prompt_buffer_spec.lua
index 602593d632..6c72cde855 100644
--- a/test/functional/legacy/prompt_buffer_spec.lua
+++ b/test/functional/legacy/prompt_buffer_spec.lua
@@ -3,9 +3,11 @@ local Screen = require('test.functional.ui.screen')
local feed = helpers.feed
local source = helpers.source
local clear = helpers.clear
+local command = helpers.command
local poke_eventloop = helpers.poke_eventloop
local meths = helpers.meths
local eq = helpers.eq
+local neq = helpers.neq
describe('prompt buffer', function()
local screen
@@ -14,9 +16,11 @@ describe('prompt buffer', function()
clear()
screen = Screen.new(25, 10)
screen:attach()
- source([[
- set laststatus=0 nohidden
+ command('set laststatus=0 nohidden')
+ end)
+ local function source_script()
+ source([[
func TextEntered(text)
if a:text == "exit"
" Reset &modified to allow the buffer to be closed.
@@ -63,7 +67,7 @@ describe('prompt buffer', function()
~ |
-- INSERT -- |
]])
- end)
+ end
after_each(function()
screen:detach()
@@ -71,6 +75,7 @@ describe('prompt buffer', function()
-- oldtest: Test_prompt_basic()
it('works', function()
+ source_script()
feed("hello\n")
screen:expect([[
cmd: hello |
@@ -101,6 +106,7 @@ describe('prompt buffer', function()
-- oldtest: Test_prompt_editing()
it('editing', function()
+ source_script()
feed("hello<BS><BS>")
screen:expect([[
cmd: hel^ |
@@ -170,6 +176,7 @@ describe('prompt buffer', function()
-- oldtest: Test_prompt_switch_windows()
it('switch windows', function()
+ source_script()
feed("<C-O>:call SwitchWindows()<CR>")
screen:expect{grid=[[
cmd: |
@@ -213,11 +220,41 @@ describe('prompt buffer', function()
-- oldtest: Test_prompt_while_writing_to_hidden_buffer()
it('keeps insert mode after aucmd_restbuf in callback', function()
+ source_script()
source [[
let s:buf = nvim_create_buf(1, 1)
call timer_start(0, {-> nvim_buf_set_lines(s:buf, -1, -1, 0, ['walrus'])})
]]
poke_eventloop()
- eq({ mode = "i", blocking = false }, meths.get_mode())
+ eq({ mode = 'i', blocking = false }, meths.get_mode())
+ end)
+
+ -- oldtest: Test_prompt_appending_while_hidden()
+ it('accessing hidden prompt buffer does not start insert mode', function()
+ local prev_win = meths.get_current_win()
+ source([[
+ new prompt
+ set buftype=prompt
+ set bufhidden=hide
+
+ func s:TextEntered(text)
+ if a:text == 'exit'
+ close
+ endif
+ let g:entered = a:text
+ endfunc
+ call prompt_setcallback(bufnr(), function('s:TextEntered'))
+
+ func DoAppend()
+ call appendbufline('prompt', '$', 'Test')
+ endfunc
+ ]])
+ feed('asomething<CR>')
+ eq('something', meths.get_var('entered'))
+ neq(prev_win, meths.get_current_win())
+ feed('exit<CR>')
+ eq(prev_win, meths.get_current_win())
+ command('call DoAppend()')
+ eq({ mode = 'n', blocking = false }, meths.get_mode())
end)
end)
diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua
index 0e9775060d..c7b5878b92 100644
--- a/test/functional/legacy/window_cmd_spec.lua
+++ b/test/functional/legacy/window_cmd_spec.lua
@@ -116,6 +116,7 @@ describe('splitkeep', function()
-- oldtest: Test_splitkeep_fold()
it('does not scroll when window has closed folds', function()
exec([[
+ set commentstring=/*%s*/
set splitkeep=screen
set foldmethod=marker
set number
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index c8a3397a86..96e28c1978 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -2032,8 +2032,11 @@ describe("folded lines", function()
end)
it('multibyte fold markers work #20438', function()
- meths.win_set_option(0, 'foldmethod', 'marker')
- meths.win_set_option(0, 'foldmarker', '«,»')
+ exec([[
+ setlocal foldmethod=marker
+ setlocal foldmarker=«,»
+ setlocal commentstring=/*%s*/
+ ]])
insert([[
bbbbb
bbbbb
diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim
index 25ac2d1239..473c7c7510 100644
--- a/test/old/testdir/setup.vim
+++ b/test/old/testdir/setup.vim
@@ -1,6 +1,7 @@
if exists('s:did_load')
" Align Nvim defaults to Vim.
set backspace=
+ set commentstring=/*%s*/
set complete=.,w,b,u,t,i
set directory&
set directory^=.
diff --git a/test/old/testdir/test_prompt_buffer.vim b/test/old/testdir/test_prompt_buffer.vim
index b1288b4892..43d8bb4789 100644
--- a/test/old/testdir/test_prompt_buffer.vim
+++ b/test/old/testdir/test_prompt_buffer.vim
@@ -238,7 +238,7 @@ func Test_prompt_while_writing_to_hidden_buffer()
\ done'], #{out_io: 'buffer', out_name: ''})
startinsert
END
- eval script->writefile(scriptName)
+ eval script->writefile(scriptName, 'D')
let buf = RunVimInTerminal('-S ' .. scriptName, {})
call WaitForAssert({-> assert_equal('cmd:', term_getline(buf, 1))})
@@ -251,7 +251,44 @@ func Test_prompt_while_writing_to_hidden_buffer()
call WaitForAssert({-> assert_equal('cmd:testtesttest', term_getline(buf, 1))})
call StopVimInTerminal(buf)
- call delete(scriptName)
+endfunc
+
+func Test_prompt_appending_while_hidden()
+ call CanTestPromptBuffer()
+
+ let script =<< trim END
+ new prompt
+ set buftype=prompt
+ set bufhidden=hide
+
+ func s:TextEntered(text)
+ if a:text == 'exit'
+ close
+ endif
+ echowin 'Entered:' a:text
+ endfunc
+ call prompt_setcallback(bufnr(), function('s:TextEntered'))
+
+ func DoAppend()
+ call appendbufline('prompt', '$', 'Test')
+ endfunc
+ END
+ call writefile(script, 'XpromptBuffer', 'D')
+
+ let buf = RunVimInTerminal('-S XpromptBuffer', {'rows': 10})
+ call TermWait(buf)
+
+ call term_sendkeys(buf, "asomething\<CR>")
+ call TermWait(buf)
+
+ call term_sendkeys(buf, "exit\<CR>")
+ call TermWait(buf)
+
+ call term_sendkeys(buf, ":call DoAppend()\<CR>")
+ call TermWait(buf)
+ call assert_notmatch('-- INSERT --', term_getline(buf, 10))
+
+ call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/test/unit/helpers.lua b/test/unit/helpers.lua
index 686af3b461..708929ad9f 100644
--- a/test/unit/helpers.lua
+++ b/test/unit/helpers.lua
@@ -148,7 +148,11 @@ local cdef = ffi.cdef
local cimportstr
-local previous_defines_init = ''
+local previous_defines_init = [[
+typedef struct { char bytes[16]; } __attribute__((aligned(16))) __uint128_t;
+typedef struct { char bytes[16]; } __attribute__((aligned(16))) __float128;
+]]
+
local preprocess_cache_init = {}
local previous_defines_mod = ''
local preprocess_cache_mod = nil