mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
refactor(defaults)!: change default 'commentstring' value to empty (#22862)
This commit is contained in:
@@ -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
|
change is that language-specific highlight groups need to be renamed from
|
||||||
`@foo.help` to `@foo.vimdoc`.
|
`@foo.help` to `@foo.vimdoc`.
|
||||||
|
|
||||||
|
• The default value of 'commentstring' is now empty instead of "/*%s*/".
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
NEW FEATURES *news-features*
|
NEW FEATURES *news-features*
|
||||||
|
|
||||||
|
@@ -1390,7 +1390,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
insert a space.
|
insert a space.
|
||||||
|
|
||||||
*'commentstring'* *'cms'* *E537*
|
*'commentstring'* *'cms'* *E537*
|
||||||
'commentstring' 'cms' string (default "/*%s*/")
|
'commentstring' 'cms' string (default "")
|
||||||
local to buffer
|
local to buffer
|
||||||
A template for a comment. The "%s" in the value is replaced with the
|
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
|
comment text. Currently only used to add markers for folding, see
|
||||||
|
@@ -34,6 +34,7 @@ Defaults *nvim-defaults*
|
|||||||
- 'backspace' defaults to "indent,eol,start"
|
- 'backspace' defaults to "indent,eol,start"
|
||||||
- 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created
|
- 'backupdir' defaults to .,~/.local/state/nvim/backup// (|xdg|), auto-created
|
||||||
- 'belloff' defaults to "all"
|
- 'belloff' defaults to "all"
|
||||||
|
- 'commentstring' defaults to ""
|
||||||
- 'compatible' is always disabled
|
- 'compatible' is always disabled
|
||||||
- 'complete' excludes "i"
|
- 'complete' excludes "i"
|
||||||
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
|
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
|
||||||
|
1
runtime/ftplugin/c.lua
Normal file
1
runtime/ftplugin/c.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.bo.commentstring = '/*%s*/'
|
1
runtime/ftplugin/calender.lua
Normal file
1
runtime/ftplugin/calender.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.bo.commentstring = '/*%s*/'
|
1
runtime/ftplugin/css.lua
Normal file
1
runtime/ftplugin/css.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.bo.commentstring = '/*%s*/'
|
1
runtime/ftplugin/indent.lua
Normal file
1
runtime/ftplugin/indent.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.bo.commentstring = '/*%s*/'
|
1
runtime/ftplugin/xdefaults.lua
Normal file
1
runtime/ftplugin/xdefaults.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vim.bo.commentstring = '/*%s*/'
|
@@ -413,7 +413,7 @@ return {
|
|||||||
alloced=true,
|
alloced=true,
|
||||||
redraw={'curswant'},
|
redraw={'curswant'},
|
||||||
varname='p_cms',
|
varname='p_cms',
|
||||||
defaults={if_true="/*%s*/"}
|
defaults={if_true=""}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
full_name='compatible', abbreviation='cp',
|
full_name='compatible', abbreviation='cp',
|
||||||
|
@@ -75,7 +75,7 @@ local function reopenwithfolds(b)
|
|||||||
local tick = reopen(b, origlines)
|
local tick = reopen(b, origlines)
|
||||||
|
|
||||||
-- use markers for folds, make all folds open by default
|
-- 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
|
-- add a fold
|
||||||
command('2,4fold')
|
command('2,4fold')
|
||||||
|
@@ -116,6 +116,7 @@ describe('splitkeep', function()
|
|||||||
-- oldtest: Test_splitkeep_fold()
|
-- oldtest: Test_splitkeep_fold()
|
||||||
it('does not scroll when window has closed folds', function()
|
it('does not scroll when window has closed folds', function()
|
||||||
exec([[
|
exec([[
|
||||||
|
set commentstring=/*%s*/
|
||||||
set splitkeep=screen
|
set splitkeep=screen
|
||||||
set foldmethod=marker
|
set foldmethod=marker
|
||||||
set number
|
set number
|
||||||
|
@@ -2032,8 +2032,11 @@ describe("folded lines", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('multibyte fold markers work #20438', function()
|
it('multibyte fold markers work #20438', function()
|
||||||
meths.win_set_option(0, 'foldmethod', 'marker')
|
exec([[
|
||||||
meths.win_set_option(0, 'foldmarker', '«,»')
|
setlocal foldmethod=marker
|
||||||
|
setlocal foldmarker=«,»
|
||||||
|
setlocal commentstring=/*%s*/
|
||||||
|
]])
|
||||||
insert([[
|
insert([[
|
||||||
bbbbb
|
bbbbb
|
||||||
bbbbb
|
bbbbb
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
if exists('s:did_load')
|
if exists('s:did_load')
|
||||||
" Align Nvim defaults to Vim.
|
" Align Nvim defaults to Vim.
|
||||||
set backspace=
|
set backspace=
|
||||||
|
set commentstring=/*%s*/
|
||||||
set complete=.,w,b,u,t,i
|
set complete=.,w,b,u,t,i
|
||||||
set directory&
|
set directory&
|
||||||
set directory^=.
|
set directory^=.
|
||||||
|
Reference in New Issue
Block a user