mirror of https://github.com/helix-editor/helix
extra stuff
parent
d3845014ff
commit
4544bffbe9
16
STEEL.md
16
STEEL.md
|
@ -70,6 +70,22 @@ to be used as typed commands. For example:
|
||||||
;; Adds the current file to git
|
;; Adds the current file to git
|
||||||
(define (git-add cx)
|
(define (git-add cx)
|
||||||
(shell cx "git" "add" "%"))
|
(shell cx "git" "add" "%"))
|
||||||
|
|
||||||
|
|
||||||
|
;; Functions to assist with the above
|
||||||
|
|
||||||
|
(define (editor-get-doc-if-exists editor doc-id)
|
||||||
|
(if (editor-doc-exists? editor doc-id) (editor->get-document editor doc-id) #f))
|
||||||
|
|
||||||
|
(define (current-path cx)
|
||||||
|
(let* ([editor (cx-editor! cx)]
|
||||||
|
[focus (editor-focus editor)]
|
||||||
|
[focus-doc-id (editor->doc-id editor focus)]
|
||||||
|
[document (editor-get-doc-if-exists editor focus-doc-id)])
|
||||||
|
|
||||||
|
(if document (Document-path document) #f)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue