From ace233829a7887299a77f9a3a7ad808ddc356b36 Mon Sep 17 00:00:00 2001 From: "Michael T. Richter" Date: Sat, 30 Mar 2013 21:07:01 +0800 Subject: [PATCH] add textadept editor support Signed-off-by: Michael T. Richter --- basis/editors/textadept/authors.txt | 1 + basis/editors/textadept/summary.txt | 1 + basis/editors/textadept/tags.txt | 1 + basis/editors/textadept/textadept.factor | 47 ++++++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 basis/editors/textadept/authors.txt create mode 100644 basis/editors/textadept/summary.txt create mode 100644 basis/editors/textadept/tags.txt create mode 100644 basis/editors/textadept/textadept.factor diff --git a/basis/editors/textadept/authors.txt b/basis/editors/textadept/authors.txt new file mode 100644 index 0000000000..f777da0cf2 --- /dev/null +++ b/basis/editors/textadept/authors.txt @@ -0,0 +1 @@ +Michael T. Richter diff --git a/basis/editors/textadept/summary.txt b/basis/editors/textadept/summary.txt new file mode 100644 index 0000000000..b8e8f59bc6 --- /dev/null +++ b/basis/editors/textadept/summary.txt @@ -0,0 +1 @@ +Textadept text editor integration diff --git a/basis/editors/textadept/tags.txt b/basis/editors/textadept/tags.txt new file mode 100644 index 0000000000..ebb74b4d5f --- /dev/null +++ b/basis/editors/textadept/tags.txt @@ -0,0 +1 @@ +not loaded diff --git a/basis/editors/textadept/textadept.factor b/basis/editors/textadept/textadept.factor new file mode 100644 index 0000000000..9c2a0a7fe5 --- /dev/null +++ b/basis/editors/textadept/textadept.factor @@ -0,0 +1,47 @@ +! Copyright 2013 Michael T. Richter +! +! This program is free software and comes without any warranty, express nor +! implied. It is, in short, warranted to do absolutely nothing but (possibly) +! occupy storage space. You can redistribute it and/or modify it under the +! terms of the Do What The Fuck You Want To Public License, Version 2, as +! published by Sam Hocevar. Consult http://www.wtfpl.net/txt/copying for full +! legal details. +! +! For this code to work, the following code needs to be added to the textadept +! "init.lua" file: +! +! function my_goto_line(line) +! _G.buffer:goto_line(line - 1) +! end +! args.register('-J', '--JUMP', 1, my_goto_line, 'Jump to line') +! +! For more information about Textadept, consult http://foicica.com/textadept/ + +USING: editors io.launcher kernel make math math.parser namespaces sequences + system ; +IN: editors.textadept + +SINGLETON: textadept +textadept editor-class set-global + +HOOK: find-textadept-path os ( -- path ) + +M: object find-textadept-path "textadept" ; + +! Example of OS-specific method +! ----------------------------- +! M: windows find-textadept-path +! let-Windows-users-fill-this-in +! ; + +: textadept-path ( -- path ) + \ textadept-path get-global [ + find-textadept-path "textadept" or + ] unless* + ; + +M: textadept editor-command ( file line -- command ) + swap [ + textadept-path , "-f" , , "-J" , number>string , + ] { } make + ;