emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/tree-sitter ce9e720413 13/14: ; Minor improvement in treesit-ins


From: Yuan Fu
Subject: feature/tree-sitter ce9e720413 13/14: ; Minor improvement in treesit-inspect-mode
Date: Fri, 4 Nov 2022 13:19:10 -0400 (EDT)

branch: feature/tree-sitter
commit ce9e7204138261f71d0e1636036727d8b05ac81e
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    ; Minor improvement in treesit-inspect-mode
    
    * lisp/treesit.el (treesit-inspect-node-at-point): Show the current
    node in bold.
    (treesit-inspect-mode): Update docstring.
---
 lisp/treesit.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index b17480e0d4..8da32ad9c5 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1552,7 +1552,10 @@ in `treesit-parser-list'."
             (format " %s: " (treesit-node-field-name node))
           " ")
         (if (treesit-node-check node 'named) "(" "\"")
-        (or (treesit-node-type node)
+        (or (propertize (treesit-node-type node)
+                        'face
+                        (if (treesit-node-eq node largest-node)
+                            'bold nil))
             "N/A")
         name
         (if (treesit-node-check node 'named) ")" "\""))))
@@ -1568,11 +1571,11 @@ in `treesit-parser-list'."
 
 The mode-line displays
 
-    PARENT FIELD-NAME: (CHILD FIELD_NAME: (GRAND-CHILD (...)))
+    PARENT FIELD-NAME: (NODE FIELD_NAME: (CHILD (...)))
 
-CHILD, GRAND-CHILD, and GRAND-GRAND-CHILD, etc, are nodes that
-have their beginning at point.  And PARENT is the parent of
-CHILD.
+NODE, CHILD, and GRAND-CHILD, etc, are nodes that have their
+beginning at point.  And PARENT is the parent of NODE.  NODE is
+displayed in bold face.
 
 If no node starts at point, i.e., point is in the middle of a
 node, then just display the smallest node that spans point and



reply via email to

[Prev in Thread] Current Thread [Next in Thread]