[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master e0e93f7eecc: Add bitstring indentation and navigation for elixir-
From: |
Eli Zaretskii |
Subject: |
master e0e93f7eecc: Add bitstring indentation and navigation for elixir-ts-mode |
Date: |
Sat, 29 Apr 2023 05:13:56 -0400 (EDT) |
branch: master
commit e0e93f7eecca4fc12ba898a9bc923566ff45c646
Author: Wilhelm H Kirschbaum <wkirschbaum@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>
Add bitstring indentation and navigation for elixir-ts-mode
* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--sexp-regexp): Add bistring.
(elixir-ts--indent-rules): Handle bitstring indentation.
(Bug#63109)
* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts:
Add test case.
---
lisp/progmodes/elixir-ts-mode.el | 4 +++-
test/lisp/progmodes/elixir-ts-mode-resources/indent.erts | 12 ++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el
index c58854c41c3..47f53043af3 100644
--- a/lisp/progmodes/elixir-ts-mode.el
+++ b/lisp/progmodes/elixir-ts-mode.el
@@ -89,7 +89,7 @@
(rx bol
(or "call" "stab_clause" "binary_operator" "list" "tuple" "map" "pair"
"sigil" "string" "atom" "alias" "arguments" "identifier"
- "boolean" "quoted_content")
+ "boolean" "quoted_content" "bitstring")
eol))
(defconst elixir-ts--test-definition-keywords
@@ -231,6 +231,7 @@
((node-is "^]$") ,'elixir-ts--parent-expression-start 0)
((node-is "^}$") ,'elixir-ts--parent-expression-start 0)
((node-is "^)$") ,'elixir-ts--parent-expression-start 0)
+ ((node-is "^>>$") ,'elixir-ts--parent-expression-start 0)
((node-is "^else_block$") grand-parent 0)
((node-is "^catch_block$") grand-parent 0)
((node-is "^rescue_block$") grand-parent 0)
@@ -250,6 +251,7 @@
,'elixir-ts--argument-indent-anchor
,'elixir-ts--argument-indent-offset)
((parent-is "^pair$") parent ,offset)
+ ((parent-is "^bitstring$") parent ,offset)
((parent-is "^map_content$") parent-bol 0)
((parent-is "^map$") ,'elixir-ts--parent-expression-start ,offset)
((node-is "^stab_clause$") parent-bol ,offset)
diff --git a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
index 9ad604e5198..4eb6e768b96 100644
--- a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
@@ -79,6 +79,18 @@ def foo() do
end
=-=-=
+Name: Bitstring mulitline
+
+=-=
+<<12, 22,
+22, 32
+ >>
+=-=
+<<12, 22,
+ 22, 32
+>>
+=-=-=
+
Name: Block assignments
=-=
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master e0e93f7eecc: Add bitstring indentation and navigation for elixir-ts-mode,
Eli Zaretskii <=