]> gitweb.factorcode.org Git - factor.git/blob - basis/editors/lapce/lapce.factor
editors.lapce: adding Lapce editor integration
[factor.git] / basis / editors / lapce / lapce.factor
1 USING: editors io.pathnames io.standard-paths kernel make
2 math.parser namespaces sequences system ;
3
4 IN: editors.lapce
5
6 SINGLETON: lapce
7
8 editor-class [ lapce ] initialize
9
10 HOOK: find-lapce-path os ( -- path )
11
12 M: object find-lapce-path f ;
13
14 M: macosx find-lapce-path
15     "io.lapce" find-native-bundle [
16         "Contents/MacOS/lapce" append-path
17     ] [
18         f
19     ] if* ;
20
21 : lapce-path ( -- path )
22     \ lapce-path get [
23         find-lapce-path [ "lapce" ?find-in-path ] unless*
24     ] unless* ;
25
26 M: lapce editor-command
27     [ lapce-path , drop , ] { } make ;