-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(syntax): initial support for pyluatex
refer: #2460
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
" VimTeX - LaTeX plugin for Vim | ||
" | ||
" Maintainer: Karl Yngve Lervåg | ||
" Email: karl.yngve@gmail.com | ||
" | ||
|
||
function! vimtex#syntax#p#pyluatex#load(cfg) abort " {{{1 | ||
call vimtex#syntax#nested#include('python') | ||
|
||
for l:env in ['python', 'pythonq', 'pythonrepl'] | ||
call vimtex#syntax#core#new_region_env( | ||
\ 'texPyluatexZone', l:env, {'contains': '@vimtex_nested_python'}) | ||
endfor | ||
|
||
highlight def link texCmdPyluatex texCmd | ||
endfunction | ||
|
||
" }}}1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
\documentclass{article} | ||
\usepackage{pyluatex} | ||
|
||
\begin{document} | ||
|
||
\begin{python} | ||
print("I am python but vimtex syntax highlighting does not know me") | ||
\end{python} | ||
|
||
\begin{pythonq} | ||
print("I am python but vimtex syntax highlighting does not know me") | ||
\end{pythonq} | ||
|
||
\begin{pythonrepl} | ||
print("I am python but vimtex syntax highlighting does not know me") | ||
\end{pythonrepl} | ||
|
||
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
source common.vim | ||
|
||
silent edit test-pyluatex.tex | ||
|
||
if empty($INMAKE) | finish | endif | ||
|
||
call assert_true(vimtex#syntax#in('pythonString', 7, 13)) | ||
call assert_true(vimtex#syntax#in('pythonString', 11, 13)) | ||
call assert_true(vimtex#syntax#in('pythonString', 15, 13)) | ||
|
||
call vimtex#test#finished() |