emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/doc-show-inline 2757164831 04/12: Fix for displaying inden


From: ELPA Syncer
Subject: [nongnu] elpa/doc-show-inline 2757164831 04/12: Fix for displaying indented doc-strings
Date: Thu, 7 Jul 2022 11:58:57 -0400 (EDT)

branch: elpa/doc-show-inline
commit 275716483132826570b9291be1aee527cf4a4514
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Fix for displaying indented doc-strings
    
    Include leading white-space when extracting comments.
---
 changelog.rst      | 3 +++
 doc-show-inline.el | 8 +++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/changelog.rst b/changelog.rst
index 22896af405..3ad207dc3a 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -4,6 +4,9 @@ Change Log
 ##########
 
 
+- 2021-12-10
+  - Include leading white-space to properly align indented multi-line 
doc-strings.
+
 - 2021-12-08
   - Keep blank space between the symbol and comments.
 
diff --git a/doc-show-inline.el b/doc-show-inline.el
index 41a2645c37..496b6007d3 100644
--- a/doc-show-inline.el
+++ b/doc-show-inline.el
@@ -116,8 +116,10 @@ This hook is called instead of the mode hooks such as:
 (defvar-local doc-show-inline-extract-doc 'doc-show-inline-extract-doc-default
   "Function to extract the doc-string given the destination buffer.
 The buffer and point will be the destination (the header file for example).
-The function must return a (BEG . END) cons cell representing the range
-or nil on failure.")
+The function must return a (BEG . END) cons cell representing the range to
+display or nil on failure.
+Note that the beginning may contain white-space (before the comment begins)
+in order to maintain alignment with the following lines.")
 
 (defvar-local doc-show-inline-filter nil
   "Optionally skip some symbols when this function returns nil.
@@ -310,7 +312,7 @@ the point should not be moved by this function."
 
             (t
               ;; Success.
-              (cons pos-beg pos-end)))))
+              (cons pos-beg-of-line pos-end)))))
       (t
         (doc-show-inline--log-info
           "symbol \"%s\" in %S at point %d has no comment before it"



reply via email to

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