Skip to content

Commit b607186

Browse files
committed
Fix line wrapped latex commands in logfile syntax
1 parent 43c54f5 commit b607186

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

LaTeXTools Log.sublime-syntax

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -248,30 +248,30 @@ contexts:
248248

249249
brackets:
250250
- match: \[
251-
scope: punctuation.section.brackets.begin.log
251+
scope: meta.brackets.log punctuation.section.brackets.begin.log
252252
push: bracket-body
253253

254254
bracket-body:
255-
- meta_scope: meta.brackets.log
255+
- meta_content_scope: meta.brackets.log
256256
- match: \]
257-
scope: punctuation.section.brackets.end.log
257+
scope: meta.brackets.log punctuation.section.brackets.end.log
258258
pop: 1
259259
- include: content
260260

261261
parens:
262262
- match: \(
263-
scope: punctuation.section.parens.begin.log
263+
scope: meta.parens.log punctuation.section.parens.begin.log
264264
push: paren-body
265265

266266
paren:
267267
- match: \(
268-
scope: punctuation.section.parens.begin.log
268+
scope: meta.parens.log punctuation.section.parens.begin.log
269269
set: paren-body
270270

271271
paren-body:
272-
- meta_scope: meta.parens.log
272+
- meta_content_scope: meta.parens.log
273273
- match: \)
274-
scope: punctuation.section.parens.end.log
274+
scope: meta.parens.log punctuation.section.parens.end.log
275275
pop: 1
276276
- include: log-entries
277277
- include: content
@@ -382,18 +382,26 @@ contexts:
382382

383383
cmd-args:
384384
- meta_scope: meta.function-call.latex
385-
- include: brackets
386-
- include: parens
387-
- match: \{
388-
scope: punctuation.section.braces.begin.log
385+
- include: comments
386+
- match: \s*(\{)
387+
captures:
388+
1: meta.braces.log punctuation.section.braces.begin.log
389389
push: cmd-args-body
390-
- match: ''
390+
- match: \s*(\[)
391+
captures:
392+
1: meta.brackets.log punctuation.section.brackets.begin.log
393+
push: bracket-body
394+
- match: \s*(\()
395+
captures:
396+
1: meta.parens.log punctuation.section.parens.begin.log
397+
push: paren-body
398+
- match: ^|(?=\s*\S)
391399
pop: 1
392400

393401
cmd-args-body:
394-
- meta_scope: meta.braces.log
402+
- meta_content_scope: meta.braces.log
395403
- match: \}
396-
scope: punctuation.section.braces.end.log
404+
scope: meta.braces.log punctuation.section.braces.end.log
397405
pop: 1
398406
- include: content
399407

tests/syntax/syntax_test_latex.log

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -770,10 +770,11 @@ l.5 \section\textit
770770
# ^ punctuation.definition.variable.latex
771771
# ^ punctuation.definition.variable.latex
772772
{\uwave{Intr\{oduction}}
773-
# ^^^^^^^^^^^^^^^^^^^^^^^^ string.quoted.other.log
774-
# ^ punctuation.definition.string.begin.log
775-
# ^^^^^^^^^^^^^^^^^^^^^^ - constant - punctuation
776-
# ^ punctuation.definition.string.end.log
773+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.exception.log meta.function-call.latex
774+
# ^^^^^^^^^^^^^^^^^^^^^^^^ meta.braces.log
775+
# ^ punctuation.section.braces.begin.log
776+
# ^ punctuation.section.braces.begin.log
777+
# ^^ punctuation.section.braces.end.log
777778

778779
# ----------
779780
# Issue 1233

0 commit comments

Comments
 (0)