[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 891716a 059/486: Fix single-line-style paragraph
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 891716a 059/486: Fix single-line-style paragraph fills with code immediately before or after |
Date: |
Sat, 7 Aug 2021 09:24:48 -0400 (EDT) |
branch: elpa/rust-mode
commit 891716aecc720667ee720b3f2b9e482e1ae7e3a0
Author: Micah Chalmer <micah@micahchalmer.net>
Commit: Micah Chalmer <micah@micahchalmer.net>
Fix single-line-style paragraph fills with code immediately before or after
---
rust-mode-tests.el | 29 +++++++++++++++++++++++++++++
rust-mode.el | 3 ++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/rust-mode-tests.el b/rust-mode-tests.el
index 4bfdee5..67e779e 100644
--- a/rust-mode-tests.el
+++ b/rust-mode-tests.el
@@ -196,6 +196,35 @@ This is some more text. Fee fie fo fum. Humpty dumpty
sat on a wall.
*very very very long string
*/"))
+(ert-deftest fill-paragraph-single-line-style-with-code-before ()
+ (test-fill-paragraph
+ "fn foo() { }
+/// This is my comment. This is more of my comment. This is even more."
+ "fn foo() { }
+/// This is my comment. This is
+/// more of my comment. This is
+/// even more." 14))
+
+(ert-deftest fill-paragraph-single-line-style-with-code-after ()
+ (test-fill-paragraph
+ "/// This is my comment. This is more of my comment. This is even more.
+fn foo() { }"
+ "/// This is my comment. This is
+/// more of my comment. This is
+/// even more.
+fn foo() { }" 1 73))
+
+(ert-deftest fill-paragraph-single-line-style-code-before-and-after ()
+ (test-fill-paragraph
+ "fn foo() { }
+/// This is my comment. This is more of my comment. This is even more.
+fn bar() { }"
+ "fn foo() { }
+/// This is my comment. This is
+/// more of my comment. This is
+/// even more.
+fn bar() { }" 14 67))
+
(defun test-auto-fill (initial position inserted expected)
(rust-test-manip-code
initial
diff --git a/rust-mode.el b/rust-mode.el
index bad1ea5..a3b7581 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -300,7 +300,8 @@
(let
((fill-paragraph-function
(if (not (eq fill-paragraph-function 'rust-fill-paragraph))
- fill-paragraph-function)))
+ fill-paragraph-function))
+ (fill-paragraph-handle-comment t))
(apply 'fill-paragraph args)
t))))))
- [nongnu] elpa/rust-mode 664c7b0 277/486: improve position recovery in rust-format-buffer, (continued)
- [nongnu] elpa/rust-mode 664c7b0 277/486: improve position recovery in rust-format-buffer, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 46e7fc0 285/486: fix PR link in README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 35298ed 288/486: Don't use "&optional &rest", ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 3301c70 047/486: Align field names in struct expressions with fields on same line as the opening curly brace, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode fe55b71 046/486: Multiline comments with leading *s line up the *s, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode af2aba9 049/486: Indent correctly after opening square bracket, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b83aabf 054/486: Add ERT tests, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 38dab12 063/486: Fix rust-align-to-expr-after-brace, closes #11239., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 7625c5c 058/486: Add 'continue' keyword to emacs, vim, gedit, kate, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d82b5a7 062/486: Add "proc" as keyword to emacs mode, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 891716a 059/486: Fix single-line-style paragraph fills with code immediately before or after,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 6b323f3 064/486: Add crate to emacs and kate modefiles, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 4f40156 071/486: Emacs: Remove README warning of old whitespace bug, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ef048b3 082/486: emacs: highlight `#[foo = "bar"]` attributes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d4264a9 065/486: extern mod => extern crate, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode f3c784f 083/486: Update repo location, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0617f1c 078/486: Recommend autoload instead of require, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode a8fad0f 085/486: emacs: Don't overwrite font lock for attributes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 9c94ec4 079/486: auto merge of #13922 : Rufflewind/rust/patch-1, r=pnkfelix, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b2c9e05 069/486: Emacs: indent relative to enclosing block, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 336c052 087/486: emacs: Remove outdated references to ~ in tests, ELPA Syncer, 2021/08/07