Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove defunct FEAT_TERMINAL #268

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: merge bufIsChangedNotTerm into bufIsChanged
... As the latter just calls the former.
izik1 committed Sep 23, 2021

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit fd3f27b67867ae175904d226648658031a4ab7c3
7 changes: 1 addition & 6 deletions src/ex_cmds.c
Original file line number Diff line number Diff line change
@@ -1563,13 +1563,8 @@ void do_shell(
msg_putchar('\n'); // may shift screen one line up

// warning message before calling the shell
if (p_warn && !autocmd_busy && msg_silent == 0)
FOR_ALL_BUFFERS(buf)
if (bufIsChangedNotTerm(buf))
{
if (p_warn && !autocmd_busy && msg_silent == 0 && anyBufIsChanged())
msg_puts(_("[No write since last change]\n"));
break;
}

// This windgoto is required for when the '\n' resulted in a "delete line
// 1" command to the terminal.
1 change: 0 additions & 1 deletion src/proto/undo.pro
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ void u_undoline(void);
void u_blockfree(buf_T *buf);
int bufIsChanged(buf_T *buf);
int anyBufIsChanged(void);
int bufIsChangedNotTerm(buf_T *buf);
int curbufIsChanged(void);
void u_eval_tree(u_header_T *first_uhp, list_T *list);
/* vim: set ft=c : */
16 changes: 3 additions & 13 deletions src/undo.c
Original file line number Diff line number Diff line change
@@ -3148,13 +3148,13 @@ void u_blockfree(buf_T *buf)
* Check if the 'modified' flag is set, or 'ff' has changed (only need to
* check the first character, because it can only be "dos", "unix" or "mac").
* "nofile" and "scratch" type buffers are considered to always be unchanged.
* Also considers a buffer changed when a terminal window contains a running
* job.
*/
int bufIsChanged(buf_T *buf)
{

return bufIsChangedNotTerm(buf);
// In a "prompt" buffer we do respect 'modified', so that we can control
// closing the window by setting or resetting that option.
return (!bt_dontwrite(buf) || bt_prompt(buf)) && (buf->b_changed || file_ff_differs(buf, TRUE));
}

/*
@@ -3170,16 +3170,6 @@ int anyBufIsChanged(void)
return FALSE;
}

/*
* Like bufIsChanged() but ignoring a terminal window.
*/
int bufIsChangedNotTerm(buf_T *buf)
{
// In a "prompt" buffer we do respect 'modified', so that we can control
// closing the window by setting or resetting that option.
return (!bt_dontwrite(buf) || bt_prompt(buf)) && (buf->b_changed || file_ff_differs(buf, TRUE));
}

int curbufIsChanged(void)
{
return bufIsChanged(curbuf);