aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/fold.c')
-rw-r--r--src/nvim/fold.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index a1fbdf7791..267c586543 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -137,7 +137,7 @@ void copyFoldingState(win_T *wp_from, win_T *wp_to)
int hasAnyFolding(win_T *win)
{
/* very simple now, but can become more complex later */
- return win->w_p_fen
+ return !win->w_buffer->terminal && win->w_p_fen
&& (!foldmethodIsManual(win) || !GA_EMPTY(&win->w_folds));
}
@@ -768,6 +768,9 @@ void clearFolding(win_T *win)
void foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
{
fold_T *fp;
+ if (wp->w_buffer->terminal) {
+ return;
+ }
/* Mark all folds from top to bot as maybe-small. */
(void)foldFind(&curwin->w_folds, top, &fp);
@@ -1563,7 +1566,7 @@ static void setSmallMaybe(garray_T *gap)
*/
static void foldCreateMarkers(linenr_T start, linenr_T end)
{
- if (!curbuf->b_p_ma) {
+ if (!MODIFIABLE(curbuf)) {
EMSG(_(e_modifiable));
return;
}