Closed timlod closed 2 years ago
I think the problem might be related to the change described here (this actual change) and so the offsets that python-docstring-fill
uses are now slightly off.
Very hacky patch because I'm too lazy to fix my github auth problems and push to a fork:
diff --git a/python-docstring.el b/python-docstring.el
index de9781e..ff5fa30 100644
--- a/python-docstring.el
+++ b/python-docstring.el
@@ -61,7 +61,7 @@ single space is used."
(setf fill-it-anyway t)
(throw 'not-a-string nil))))
(string-start (+ (goto-char (nth 8 syx))
- 3))
+ 1))
(rawchar (if (eql (char-before (point)) ?r)
1
0))
@@ -75,7 +75,7 @@ single space is used."
(progn (forward-sexp)
(point))
(error (point-max)))
- 3))
+ 1))
(orig-offset (- orig-point string-start)))
(let*
((offset-within
Seems to work for me. A proper fix probably needs to check the version of python.el and set offsets appropriately rather than just blindly overwriting them, or possibly could check that (- string-start 1)
is actually the quote as expected, or something?
Appears to work for me, too - thanks! I will patch this for myself for now and see if it would run into any issues.
created a pr
@vale981 Is the PR
approved?
not yet :{
Sorry, I get a lot of github spam and things often fall through the cracks.
After installing from Elpa I can see the error quite clearly, thanks for the example.
Since the new update to the built-in python mode,
python-docstring-fill
does not work fully anymore.The following code will not change when formatted with
python-docstring-fill
, python.el version 0.27.1:When using python.el, version 0.28,
python-docstring-fill
will now format this code as such:I'm now going to step through execution of the function to see if I can find the issue, but I may not be adept enough at elisp to debug it myself.