File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5900,6 +5900,31 @@ is the last child of the enclosing sexp as defined by
59005900 (sp-backward-sexp)))))))
59015901 re)))
59025902
5903+ ;; TODO: skip empty lines?
5904+ (defun sp-forward-hybrid-sexp (&optional arg)
5905+ "Move forward over one hybrid sexp.
5906+
5907+ See `sp-get-hybrid-sexp'."
5908+ (interactive "^p")
5909+ (-when-let (sexp (sp-get-hybrid-sexp))
5910+ (sp-get sexp
5911+ ;; if we did not move forward at all, let's try one more time
5912+ (if (< (point) :end-suf)
5913+ (sp-get sexp (goto-char :end-suf))
5914+ (when (= (forward-line 1) 0)
5915+ (-when-let (sexp2 (sp-get-hybrid-sexp))
5916+ (sp-get sexp2 (goto-char :end-suf))))))))
5917+
5918+ (defun sp-backward-hybrid-sexp (&optional arg)
5919+ "Move backward over one hybrid sexp.
5920+
5921+ See `sp-get-hybrid-sexp'."
5922+ (interactive "^p")
5923+ (-when-let (sexp (save-excursion
5924+ (when (sp-backward-sexp)
5925+ (sp-get-hybrid-sexp))))
5926+ (sp-get sexp (goto-char :beg-prf))))
5927+
59035928(defun sp--raw-argument-p (arg)
59045929 "Return t if ARG represents raw argument, that is a non-empty list."
59055930 (and (listp arg) (car arg)))
You can’t perform that action at this time.
0 commit comments