diff --git a/langs/docstr-python.el b/langs/docstr-python.el index d779ac1..8dcc5ee 100644 --- a/langs/docstr-python.el +++ b/langs/docstr-python.el @@ -148,15 +148,10 @@ "Trigger document string inside Python." (when (and (memq major-mode docstr-python-modes) docstr-mode - (docstr-util-looking-back "\"\"\"" 3) - ;; This should avoid pairing plugins inserting document string - ;; twice by accident. e.g. `electric-pair-mode', `smartparens', - ;; etc. - ;; - ;; See #5. - (not (docstr-util-looking-back "\"\"\"\"" 4))) - ;; If no pairing, help complete it! - (unless (looking-at-p "\"\"\"") (save-excursion (insert "\"\"\""))) + (docstr-util-looking-back "\"\"\"" 3)) + (when (looking-at-p "\"\"\"") + (delete-char 3)) + (save-excursion (insert "\"\"\"")) (docstr--insert-doc-string (docstr-python--parse)))) (provide 'docstr-python)