From d45a1150580745a1905d74185b544af3ea6f709d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Mandl=C3=ADk?= Date: Fri, 2 Aug 2024 14:13:16 +0200 Subject: [PATCH] latex: improved sections --- queries/latex/textobjects.scm | 57 +++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/queries/latex/textobjects.scm b/queries/latex/textobjects.scm index ed549562..1bdcaa5f 100644 --- a/queries/latex/textobjects.scm +++ b/queries/latex/textobjects.scm @@ -51,12 +51,51 @@ "}") (#make-range! "call.inner" @_start @_end)) -[ - (chapter) - (part) - (section) - (subsection) - (subsubsection) - (paragraph) - (subparagraph) -] @class.outer +((part + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end)) + +((chapter + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end)) + +((section + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end)) + +((subsection + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end)) + +((subsubsection + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end)) + +((paragraph + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end)) + +((subparagraph + text: (_) + . + (_) @_start + (_)? @_end .) @class.outer + (#make-range! "class.inner" @_start @_end))