aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/run.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-06-11 18:51:16 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2010-06-11 18:51:16 -0400
commit8e66381a040f695f4203b28bc3f1d6818d0da7a2 (patch)
treee30e8115d27b423b579e60178f36a151dc795f50 /modules/textadept/run.lua
parent7a4800f05f26067a1cef77e5431256aab4c3d675 (diff)
downloadtextadept-8e66381a040f695f4203b28bc3f1d6818d0da7a2.tar.gz
textadept-8e66381a040f695f4203b28bc3f1d6818d0da7a2.zip
Removed _G.textadept.
Created new _SCINTILLA core module. Renamed textadept.constants to _SCINTILLA.constants Renamed textadept.buffer_functions to _SCINTILLA.functions Renamed textadept.buffer_properties to _SCINTILLA.properties Created new gui core module. Renamed textadept._print() to gui._print(). Renamed textadept.check_focused_buffer() to gui.check_focused_buffer(). Renamed textadept.clipboard_text to gui.clipboard_text. Renamed textadept.context_menu to gui.context_menu Renamed textadept.command_entry to gui.command_entry. Renamed textadept.dialog to gui.dialog. Renamed textadept.docstatusbar_text to gui.docstatusbar_text. Renamed textadept.find to gui.find. Renamed textadept.focused_doc_pointer to gui.focused_doc_pointer. Renamed textadept.get_split_table() to gui.get_split_table(). Renamed textadept.gtkmenu() to gui.gtkmenu(). Renamed textadept.goto_view() to gui.goto_view(). Renamed textadept.menubar to gui.menubar. Renamed textadept.print() to gui.print(). Renamed textadept.size to gui.size. Renamed textadept.statusbar_text to gui.statusbar_text. Renamed textadept.switch_buffer() to gui.switch_buffer(). Renamed textadept.title to gui.title. Renamed textadept.buffers to _G._BUFFERS. Renamed textadept.new_buffer() to _G.new_buffer(). Renamed textadept.quit() to _G.quit(). Renamed textadept.reset() to _G.reset(). Renamed textadept.views to _G._VIEWS. Renamed textadept.user_dofile() to _G.user_dofile(). Renamed textadept.iconv to string.iconv. Renamed textadept.session_file to _SESSIONFILE. Renamed appropriate C functions.
Diffstat (limited to 'modules/textadept/run.lua')
-rw-r--r--modules/textadept/run.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index a576ff27..78b1fbdb 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -1,6 +1,5 @@
-- Copyright 2007-2010 Mitchell mitchell<att>caladbolg.net. See LICENSE.
-local textadept = _G.textadept
local locale = _G.locale
---
@@ -19,7 +18,7 @@ module('_m.textadept.run', package.seeall)
-- * %(filename) The name of the file including extension.
-- * %(filename_noext) The name of the file excluding extension.
function execute(command)
- local filepath = textadept.iconv(buffer.filename, _CHARSET, 'UTF-8')
+ local filepath = buffer.filename:iconv(_CHARSET, 'UTF-8')
local filedir, filename
if filepath:find('[/\\]') then
filedir, filename = filepath:match('^(.+[/\\])([^/\\]+)$')
@@ -39,7 +38,7 @@ function execute(command)
local out = p:read('*all')
p:close()
lfs.chdir(current_dir)
- textadept.print(textadept.iconv('> '..command..'\n'..out, 'UTF-8', _CHARSET))
+ gui.print(('> '..command..'\n'..out):iconv('UTF-8', _CHARSET))
buffer:goto_pos(buffer.length)
end
@@ -115,7 +114,7 @@ function goto_error(pos, line_num)
if #captures > 0 then
local lfs = require 'lfs'
local utf8_filename = captures[error_detail.filename]
- local filename = textadept.iconv(utf8_filename, _CHARSET, 'UTF-8')
+ local filename = utf8_filename:iconv(_CHARSET, 'UTF-8')
if lfs.attributes(filename) then
io.open_file(utf8_filename)
_m.textadept.editing.goto_line(captures[error_detail.line])