lang/rest: fix za, zm & zr fold keys

This commit is contained in:
Henrik Lissner 2018-08-16 17:36:05 +02:00
parent d60296111e
commit 772febedb7
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,28 @@
;;; lang/rest/autoload.el -*- lexical-binding: t; -*-
(defun +rest-request-at-point-p (&optional pos)
(save-excursion
(if pos (goto-char pos))
(beginning-of-line)
(and (re-search-forward restclient-method-url-regexp
(line-end-position) t)
(not (nth 4 (syntax-ppss))))))
;;;###autoload
(defun +rest/dwim-at-point ()
"TODO"
(interactive)
(when (+rest-request-at-point-p)
(restclient-http-send-current-stay-in-window)))
;;;###autoload
(defun +rest/fold-all ()
"TODO"
(interactive)
(save-excursion
(goto-char (point-min))
(let ((last (point)))
(while (and (restclient-jump-next)
(not (= last (setq last (point)))))
(unless (overlays-at (line-end-position))
(restclient-toggle-body-visibility))))))