editors.textadept: use "-e goto_line(n-1)".
(as suggested by Mitchell@foicica.com on the textadept mailing list)db4
parent
23c154c06f
commit
dc27c21ab0
|
@ -7,14 +7,6 @@
|
||||||
! published by Sam Hocevar. Consult http://www.wtfpl.net/txt/copying for full
|
! published by Sam Hocevar. Consult http://www.wtfpl.net/txt/copying for full
|
||||||
! legal details.
|
! 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/
|
! For more information about Textadept, consult http://foicica.com/textadept/
|
||||||
|
|
||||||
USING: editors io.launcher io.pathnames io.standard-paths kernel
|
USING: editors io.launcher io.pathnames io.standard-paths kernel
|
||||||
|
@ -47,5 +39,6 @@ M: macosx find-textadept-path
|
||||||
|
|
||||||
M: textadept editor-command ( file line -- command )
|
M: textadept editor-command ( file line -- command )
|
||||||
swap [
|
swap [
|
||||||
textadept-path , "-f" , , "-J" , number>string ,
|
textadept-path , "-f" , , "-e" ,
|
||||||
|
1 - number>string "goto_line(" ")" surround ,
|
||||||
] { } make ;
|
] { } make ;
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
--[[
|
|
||||||
Sample init.lua for Textadept with the required "Jump to line" command line
|
|
||||||
option for the Textadept support in the Factor distribution.
|
|
||||||
|
|
||||||
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.
|
|
||||||
]]
|
|
||||||
|
|
||||||
_M.textadept = require 'textadept'
|
|
||||||
|
|
||||||
-- Add a "Jump to line" command line option.
|
|
||||||
function my_goto_line(line)
|
|
||||||
_G.buffer:goto_line(line - 1)
|
|
||||||
end
|
|
||||||
args.register('-J', '--JUMP', 1, my_goto_line, 'Jump to line')
|
|
Loading…
Reference in New Issue