SciTE 找不到用户定义的函数。编辑器执行“/bin/sh”由于某种原因

发布于 01-18 10:45 字数 826 浏览 4 评论 0原文

所以,这是我第一次尝试让我的源代码编辑更加舒适。我遵循 SciTE 脚本编写指南。

ext.lua.startup.script=$(SciteDefaultHome)/startup.lua

command.name.1.*= Programmer's Manual (selected text)
command.subsystem.1.*= 3
command.1.*=man_select
command.shortcut.1.*=F1

上面是用户属性文件。它将F1键绑定到用户定义的Lua函数。

问题是,在我的例子中,man_select 启动函数,SciTE 编辑器输出给了我

>man_select
/bin/sh: man_select: not found
>Exit code: 127

所以,编辑器以我的函数名称作为参数运行一个 shell 。我找不到 SciTE 日志或控制台来查看原因。

我将 man_select 定义为一个简单的 Lua 函数,不带参数:

function man_select()
   local sel = editor:GetSelText()
   ...
end

我应该如何使我自己的 Lua 函数对 SciTE 编辑器可见?有没有办法向 SciTE 询问有关其脚本系统流程的更多信息?

So, this is my first attempt to make my source code editing more comfortable. I follow the SciTE scripting guide.

ext.lua.startup.script=$(SciteDefaultHome)/startup.lua

command.name.1.*= Programmer's Manual (selected text)
command.subsystem.1.*= 3
command.1.*=man_select
command.shortcut.1.*=F1

Above is the user properties file. It binds F1 key to user defined Lua function.

The problem is, that insteed of starting the function, man_select in my case, the SciTE editor output gives me

>man_select
/bin/sh: man_select: not found
>Exit code: 127

So, the editor runs a shell with my function name as a argument. I can't find no SciTE logs, or console, to see what the cause is.

I define man_select as a simple Lua function, without arguments:

function man_select()
   local sel = editor:GetSelText()
   ...
end

What should I do to make my own Lua functions visible to SciTE editor? Is there a way to ask SciTE for more information on its scripting system flow?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文