[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed f9c3819 020/166: Tweak sexp object again
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/objed f9c3819 020/166: Tweak sexp object again |
Date: |
Sun, 29 Dec 2019 08:20:53 -0500 (EST) |
branch: externals/objed
commit f9c3819f90908baf76fbd461cdb918a3cb098088
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Tweak sexp object again
---
objed-objects.el | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/objed-objects.el b/objed-objects.el
index db2df7d..6521826 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1573,19 +1573,30 @@ comments."
(let* ((opos (point))
(objed--block-p t)
(real-this-command 'forward-sexp)
+ (instring (objed--in-string-p nil t))
(other nil)
- (atp (or (save-excursion
- (ignore-errors
- (forward-sexp 1)
- (setq other (point))
- (forward-sexp -1)
- (= (point) opos)))
- (save-excursion
- (ignore-errors
- (forward-sexp -1)
- (setq other (point))
- (forward-sexp 1)
- (= (point) opos))))))
+ (atp (or (when (or (bobp)
+ ;; prevent the annoying "feature" that sexp
+ ;; movement works across strings
+ (not instring)
+ (not (eq (char-syntax (char-after)) ?\")))
+ (save-excursion
+ (ignore-errors
+ (forward-sexp 1)
+ (setq other (point))
+ (forward-sexp -1)
+ (= (point) opos))))
+ (when (or (eobp)
+ ;; prevent the annoying "feature" that sexp
+ ;; movement works across strings
+ (not instring)
+ (not (eq (char-syntax (char-before)) ?\")))
+ (save-excursion
+ (ignore-errors
+ (forward-sexp -1)
+ (setq other (point))
+ (forward-sexp 1)
+ (= (point) opos)))))))
(when atp
(cons (min opos other)
- [elpa] externals/objed 333b58c 014/166: Change indentation object to include leading ws, (continued)
- [elpa] externals/objed 333b58c 014/166: Change indentation object to include leading ws, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 89e1e18 016/166: Also activate mc if only one fake cursor, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0cb2593 017/166: Tweak sexp object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed dc673b8 022/166: Fix for mc counting non fake cursor as cursor, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 252a1d3 021/166: For brackets, strings and comments switch to sexp on continuation, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0fa1ea3 024/166: Default to sexp for continuation object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed be2c78c 027/166: Fix word object for subword-mode, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 0956db5 029/166: Don't add additional undo bounds for numeric repeats, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 781f0ee 031/166: Make word object behave correctly with superword/subword-mode, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed a16418c 040/166: Refactor object-toggle-state, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed f9c3819 020/166: Tweak sexp object again,
Clemens Radermacher <=
- [elpa] externals/objed 2701f73 026/166: Fix backward kill for continuation, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed bddcb432 032/166: Fix dosctring, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 8babcfc 030/166: Make obj state buffer local and keep it on movement, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed e6d306b 033/166: Don't exclude current object for objed-ace, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 32221a6 041/166: Remember object type for marked object, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 74204af 037/166: Add ability to jump to objects inside current one, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 87cdeee 039/166: Improve toggle state, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 6ae9bff 042/166: When repeating backward/forward until proceed to object boundary, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed 1b50645 048/166: Update docstring, Clemens Radermacher, 2019/12/29
- [elpa] externals/objed db01e08 046/166: Undo last commit, Clemens Radermacher, 2019/12/29