mirror of
https://github.com/neovim/neovim.git
synced 2026-04-25 08:44:06 +00:00
Merge pull request #38738 from zeertzjq/vim-9.2.0267
vim-patch:9.2.0267,af58a9f
This commit is contained in:
@@ -822,10 +822,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'autowrite' 'aw' boolean (default off)
|
||||
global
|
||||
Write the contents of the file, if it has been modified, on each
|
||||
`:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`,
|
||||
`:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when
|
||||
a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one
|
||||
to another file.
|
||||
`:next`, `:rewind`, `:last`, `:first`, `:previous`, `:tag`, `:stop`,
|
||||
`:suspend`, `:!`, `:make`, `:terminal`, CTRL-] or CTRL-^ command; and
|
||||
when a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command
|
||||
switches to another file.
|
||||
A buffer is not written if it becomes hidden, e.g. when 'bufhidden' is
|
||||
set to "hide" and `:next` is used.
|
||||
Note that for some commands the 'autowrite' option is not used, see
|
||||
@@ -839,8 +839,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
*'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'*
|
||||
'autowriteall' 'awa' boolean (default off)
|
||||
global
|
||||
Like 'autowrite', but also used for commands ":edit", ":enew",
|
||||
":quit", ":qall", ":exit", ":xit", ":recover" and closing the Vim
|
||||
Like 'autowrite', but also used for commands `:edit`, `:enew`,
|
||||
`:quit`, `:qall`, `:exit`, `:xit`, `:recover` and closing the Vim
|
||||
window.
|
||||
Setting this option also implies that Vim behaves like 'autowrite' has
|
||||
been set.
|
||||
|
||||
12
runtime/lua/vim/_meta/options.lua
generated
12
runtime/lua/vim/_meta/options.lua
generated
@@ -189,10 +189,10 @@ vim.go.autoread = vim.o.autoread
|
||||
vim.go.ar = vim.go.autoread
|
||||
|
||||
--- Write the contents of the file, if it has been modified, on each
|
||||
--- `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`,
|
||||
--- `:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when
|
||||
--- a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one
|
||||
--- to another file.
|
||||
--- `:next`, `:rewind`, `:last`, `:first`, `:previous`, `:tag`, `:stop`,
|
||||
--- `:suspend`, `:!`, `:make`, `:terminal`, CTRL-] or CTRL-^ command; and
|
||||
--- when a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command
|
||||
--- switches to another file.
|
||||
--- A buffer is not written if it becomes hidden, e.g. when 'bufhidden' is
|
||||
--- set to "hide" and `:next` is used.
|
||||
--- Note that for some commands the 'autowrite' option is not used, see
|
||||
@@ -209,8 +209,8 @@ vim.o.aw = vim.o.autowrite
|
||||
vim.go.autowrite = vim.o.autowrite
|
||||
vim.go.aw = vim.go.autowrite
|
||||
|
||||
--- Like 'autowrite', but also used for commands ":edit", ":enew",
|
||||
--- ":quit", ":qall", ":exit", ":xit", ":recover" and closing the Vim
|
||||
--- Like 'autowrite', but also used for commands `:edit`, `:enew`,
|
||||
--- `:quit`, `:qall`, `:exit`, `:xit`, `:recover` and closing the Vim
|
||||
--- window.
|
||||
--- Setting this option also implies that Vim behaves like 'autowrite' has
|
||||
--- been set.
|
||||
|
||||
@@ -8197,6 +8197,11 @@ static void ex_terminal(exarg_T *eap)
|
||||
{
|
||||
char ex_cmd[1024];
|
||||
size_t len = 0;
|
||||
const int scroll_save = msg_scroll;
|
||||
|
||||
msg_scroll = false; // don't scroll here
|
||||
autowrite_all();
|
||||
msg_scroll = scroll_save;
|
||||
|
||||
if (cmdmod.cmod_tab > 0 || cmdmod.cmod_split != 0) {
|
||||
bool multi_mods = false;
|
||||
|
||||
@@ -323,10 +323,10 @@ local options = {
|
||||
defaults = false,
|
||||
desc = [=[
|
||||
Write the contents of the file, if it has been modified, on each
|
||||
`:next`, `:rewind`, `:last`, `:first`, `:previous`, `:stop`,
|
||||
`:suspend`, `:tag`, `:!`, `:make`, CTRL-] and CTRL-^ command; and when
|
||||
a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command takes one
|
||||
to another file.
|
||||
`:next`, `:rewind`, `:last`, `:first`, `:previous`, `:tag`, `:stop`,
|
||||
`:suspend`, `:!`, `:make`, `:terminal`, CTRL-] or CTRL-^ command; and
|
||||
when a `:buffer`, CTRL-O, CTRL-I, '{A-Z0-9}, or `{A-Z0-9} command
|
||||
switches to another file.
|
||||
A buffer is not written if it becomes hidden, e.g. when 'bufhidden' is
|
||||
set to "hide" and `:next` is used.
|
||||
Note that for some commands the 'autowrite' option is not used, see
|
||||
@@ -347,8 +347,8 @@ local options = {
|
||||
abbreviation = 'awa',
|
||||
defaults = false,
|
||||
desc = [=[
|
||||
Like 'autowrite', but also used for commands ":edit", ":enew",
|
||||
":quit", ":qall", ":exit", ":xit", ":recover" and closing the Vim
|
||||
Like 'autowrite', but also used for commands `:edit`, `:enew`,
|
||||
`:quit`, `:qall`, `:exit`, `:xit`, `:recover` and closing the Vim
|
||||
window.
|
||||
Setting this option also implies that Vim behaves like 'autowrite' has
|
||||
been set.
|
||||
|
||||
@@ -106,6 +106,17 @@ describe(':terminal', function()
|
||||
eq(3, #jumps)
|
||||
end)
|
||||
|
||||
it("triggers 'autowrite'", function()
|
||||
api.nvim_set_option_value('autowrite', true, {})
|
||||
command('vnew Xtermautowritetestfile | setlocal fileformat=unix')
|
||||
finally(function()
|
||||
os.remove('Xtermautowritetestfile')
|
||||
end)
|
||||
fn.setline(1, 'test content')
|
||||
command('terminal')
|
||||
eq('test content\n', t.read_file('Xtermautowritetestfile'))
|
||||
end)
|
||||
|
||||
it('nvim_get_mode() in :terminal', function()
|
||||
command('terminal')
|
||||
eq({ blocking = false, mode = 'nt' }, api.nvim_get_mode())
|
||||
|
||||
Reference in New Issue
Block a user