Skip to content

Commit

Permalink
set and restore cpoptions in syntax file
Browse files Browse the repository at this point in the history
This is common practice in syntax files and needed for, e.g., line
continuation to work properly (see discussion in #222).
  • Loading branch information
Christian Clason authored and carlobaldassi committed Aug 4, 2021
1 parent 6ff9e99 commit c4a1c86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions syntax/julia.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ elseif exists("b:current_syntax")
finish
endif

let s:cpo_save = &cpo
set cpo&vim

if version < 704
" this is used to disable regex syntax like `\@3<='
" on older vim versions
Expand Down Expand Up @@ -541,3 +544,6 @@ hi def link juliaError Error
syntax sync fromstart

let b:current_syntax = "julia"

let &cpo = s:cpo_save
unlet s:cpo_save

0 comments on commit c4a1c86

Please sign in to comment.