aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r--src/nvim/undo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 06dc325fea..67195235fe 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -289,7 +289,7 @@ int u_savedel(linenr_T lnum, long nlines)
int undo_allowed(void)
{
/* Don't allow changes when 'modifiable' is off. */
- if (!curbuf->b_p_ma) {
+ if (!MODIFIABLE(curbuf)) {
EMSG(_(e_modifiable));
return FALSE;
}
@@ -315,6 +315,9 @@ int undo_allowed(void)
*/
static long get_undolevel(void)
{
+ if (curbuf->terminal) {
+ return -1;
+ }
if (curbuf->b_p_ul == NO_LOCAL_UNDOLEVEL)
return p_ul;
return curbuf->b_p_ul;