From 6fd68c1c52ae4ec41ea1111d1e7c7ff918d92de2 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 6 Dec 2022 10:35:04 -0800 Subject: [PATCH] editors.lapce: adding Lapce editor integration --- basis/editors/lapce/authors.txt | 1 + basis/editors/lapce/lapce.factor | 27 +++++++++++++++++++++++++++ basis/editors/lapce/summary.txt | 1 + 3 files changed, 29 insertions(+) create mode 100644 basis/editors/lapce/authors.txt create mode 100644 basis/editors/lapce/lapce.factor create mode 100644 basis/editors/lapce/summary.txt diff --git a/basis/editors/lapce/authors.txt b/basis/editors/lapce/authors.txt new file mode 100644 index 0000000000..e091bb8164 --- /dev/null +++ b/basis/editors/lapce/authors.txt @@ -0,0 +1 @@ +John Benediktsson diff --git a/basis/editors/lapce/lapce.factor b/basis/editors/lapce/lapce.factor new file mode 100644 index 0000000000..6777e7bfcb --- /dev/null +++ b/basis/editors/lapce/lapce.factor @@ -0,0 +1,27 @@ +USING: editors io.pathnames io.standard-paths kernel make +math.parser namespaces sequences system ; + +IN: editors.lapce + +SINGLETON: lapce + +editor-class [ lapce ] initialize + +HOOK: find-lapce-path os ( -- path ) + +M: object find-lapce-path f ; + +M: macosx find-lapce-path + "io.lapce" find-native-bundle [ + "Contents/MacOS/lapce" append-path + ] [ + f + ] if* ; + +: lapce-path ( -- path ) + \ lapce-path get [ + find-lapce-path [ "lapce" ?find-in-path ] unless* + ] unless* ; + +M: lapce editor-command + [ lapce-path , drop , ] { } make ; diff --git a/basis/editors/lapce/summary.txt b/basis/editors/lapce/summary.txt new file mode 100644 index 0000000000..bf4c1acf8d --- /dev/null +++ b/basis/editors/lapce/summary.txt @@ -0,0 +1 @@ +Lapce editor integration -- 2.34.1