[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-surround 88f371a77f 029/175: Use `surround-line' inst
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-surround 88f371a77f 029/175: Use `surround-line' instead of `evil-line' for linewise operations |
Date: |
Mon, 9 Oct 2023 13:01:01 -0400 (EDT) |
branch: elpa/evil-surround
commit 88f371a77f426ed5fb37c4f1824decf15c726c07
Author: Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de>
Commit: Frank Fischer <frank.fischer@mathematik.tu-chemnitz.de>
Use `surround-line' instead of `evil-line' for linewise operations
`evil-line' is a motion that covers a number of lines as a line
range. This causes surround to add additional line breaks before and
after the text to be wrapped if used with `yss' commands.
The function `surround-line' covers the same characters but this time
as exclusive character range.
---
README.md | 3 +--
surround.el | 12 +++++++++++-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 5b01b195a2..868a045cde 100644
--- a/README.md
+++ b/README.md
@@ -95,8 +95,7 @@ space): `cs]{`
{ Hello } world!
-Now wrap the entire line in parentheses with `yssb` or `yss)` (wrapping the
line
-is currently broken see [issue
#5](https://github.com/timcharper/evil-surround/issues/5)).
+Now wrap the entire line in parentheses with `yssb` or `yss)`.
({ Hello } world!)
diff --git a/surround.el b/surround.el
index 72d726df7f..8b931f6619 100644
--- a/surround.el
+++ b/surround.el
@@ -139,6 +139,16 @@ See also `surround-outer-overlay'."
(evil-range-end inner)
nil nil t))))))
+(evil-define-motion surround-line (count)
+ "Move COUNT - 1 lines down but return exclusive character motion."
+ :type exclusive
+ (let ((beg (line-beginning-position)))
+ (evil-line count)
+ (end-of-line)
+ (let ((range (evil-range beg (point) 'exclusive)))
+ (evil-expand-range range)
+ range)))
+
;;;###autoload
(defun surround-delete (char &optional outer inner)
"Delete the surrounding delimiters represented by CHAR.
@@ -205,7 +215,7 @@ Otherwise call `surround-delete'."
((eq operation 'delete)
(call-interactively 'surround-delete))
(t
- (define-key evil-operator-shortcut-map "s" 'evil-line)
+ (define-key evil-operator-shortcut-map "s" 'surround-line)
(call-interactively 'surround-region))))
(evil-define-operator surround-region (beg end type char &optional
force-new-line)
- [nongnu] elpa/evil-surround e25f5f9c00 015/175: Add note about sentence behavior with link to issue., (continued)
- [nongnu] elpa/evil-surround e25f5f9c00 015/175: Add note about sentence behavior with link to issue., ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround ac3f8ca8b0 014/175: Add readme., ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 0a6741684b 024/175: Merge pull request #13 from milkypostman/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 92eee31db7 028/175: Fix link to Evil, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround f33d940264 036/175: Rename surround.el to evil-surround.el, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround a4a04c6f01 075/175: Merge pull request #74 from lislon/surround-repeat, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 16c534b173 089/175: Unset execute permission for files, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround eda6b0d6ca 079/175: Merge pull request #78 from vyp/#55, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 50c10ab484 025/175: add autoloads to interactive functions for use in emacs proper, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 2de26062dd 031/175: Fix doc for surround delete operator, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 88f371a77f 029/175: Use `surround-line' instead of `evil-line' for linewise operations,
ELPA Syncer <=
- [nongnu] elpa/evil-surround 47721ca824 035/175: Improve surround-outer-overlay and surround-inner-overlay (issue/30), ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 277534ce75 003/175: Replaced with Vegard's port of vimpulse-surround, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 0209cf9170 004/175: adds angle bracket surround, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround d911f1eb70 012/175: Merge pull request #3 from epsilon47/master, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround b40d2b6542 017/175: Merge pull request #7 from cofi/docs, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround e50649f7cd 061/175: Improve evil-surround-block doc comment, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 9f1ab3c302 065/175: typo, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 18a33859d7 055/175: Merge pull request #57 from Drolyt/patch-1, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 4c5e3bf0bc 056/175: Fix indentation of surrounded lines, ELPA Syncer, 2023/10/09
- [nongnu] elpa/evil-surround 9724dcce1b 091/175: fix #84: revert 66b8f89 which reintroduced #24 as a regression, ELPA Syncer, 2023/10/09