refactor(terminal): move :terminal defaults to _defaults.lua

This commit is contained in:
Gregory Anders
2024-06-11 11:10:34 -05:00
parent 3e09fbdf82
commit d38912b59f
9 changed files with 50 additions and 29 deletions

View File

@@ -343,14 +343,6 @@ void terminal_open(Terminal **termpp, buf_T *buf, TerminalOptions opts)
refresh_screen(term, buf);
set_option_value(kOptBuftype, STATIC_CSTR_AS_OPTVAL("terminal"), OPT_LOCAL);
// Default settings for terminal buffers
buf->b_p_ma = false; // 'nomodifiable'
buf->b_p_ul = -1; // 'undolevels'
buf->b_p_scbk = // 'scrollback' (initialize local from global)
(p_scbk < 0) ? 10000 : MAX(1, p_scbk);
buf->b_p_tw = 0; // 'textwidth'
set_option_value(kOptWrap, BOOLEAN_OPTVAL(false), OPT_LOCAL);
set_option_value(kOptList, BOOLEAN_OPTVAL(false), OPT_LOCAL);
if (buf->b_ffname != NULL) {
buf_set_term_title(buf, buf->b_ffname, strlen(buf->b_ffname));
}