aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/main.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-14 15:14:38 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-14 16:23:04 -0500
commitcc2dce45d09fab2ec2269924942fdca7d5643e63 (patch)
tree8ee4ddef759fd8b995ca5672eaf9bd537faa4dd5 /src/nvim/main.c
parent6c9c08c3703b2044bce2cdd5b20e66222cf46483 (diff)
downloadrneovim-cc2dce45d09fab2ec2269924942fdca7d5643e63.tar.gz
rneovim-cc2dce45d09fab2ec2269924942fdca7d5643e63.tar.bz2
rneovim-cc2dce45d09fab2ec2269924942fdca7d5643e63.zip
startup: Avoid VimL global. Introduce TriState enum.
- `syntax_on` is documented. Rather than introduce a new undocumented VimL global `g:syntax_off`, use a module-local flag. - Rename "maybe" functions to follow style guidelines (use standard module prefix)
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r--src/nvim/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 2070125b2e..d3cdfe3edf 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -334,11 +334,10 @@ int main(int argc, char **argv)
// If using the runtime (-u is not NONE), enable syntax & filetype plugins.
if (params.use_vimrc != NULL && strcmp(params.use_vimrc, "NONE") != 0) {
- // Do ":filetype plugin indent on".
- maybe_enable_filetype();
- // Enable syntax (sources syntax/syntax.vim, which calls `:filetype on`).
- do_cmdline_cmd("if !exists('syntax_off') | syntax on |"
- "else | unlet syntax_off | endif");
+ // Does ":filetype plugin indent on".
+ filetype_maybe_enable();
+ // Sources syntax/syntax.vim, which calls `:filetype on`.
+ syn_maybe_on();
}
/*