aboutsummaryrefslogtreecommitdiff
path: root/core/events.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-02-10 10:24:56 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-02-10 10:24:56 -0500
commitddcc45f0615ab6ba776635a15e2183f8d50401a7 (patch)
tree958e817be2c18db9005db29ddcbdeeb72350d77e /core/events.lua
parent59c9eb6528d1759bc2734150cb3d99ec2e3eab5b (diff)
downloadtextadept-ddcc45f0615ab6ba776635a15e2183f8d50401a7.tar.gz
textadept-ddcc45f0615ab6ba776635a15e2183f8d50401a7.zip
Moved the textadept.locale table into the globals table.
Diffstat (limited to 'core/events.lua')
-rw-r--r--core/events.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/events.lua b/core/events.lua
index 52093fc3..23ce1ae3 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -1,6 +1,7 @@
-- Copyright 2007-2009 Mitchell mitchell<att>caladbolg.net. See LICENSE.
local textadept = _G.textadept
+local locale = _G.locale
---
-- Module that handles Scintilla and Textadept notifications/events.
@@ -359,7 +360,7 @@ local title_text = '%s %s Textadept (%s)'
-- @param buffer The currently focused buffer.
local function set_title(buffer)
local buffer = buffer
- local filename = buffer.filename or buffer._type or textadept.locale.UNTITLED
+ local filename = buffer.filename or buffer._type or locale.UNTITLED
local d = buffer.dirty and '*' or '-'
textadept.title =
string.format(title_text, filename:match('[^/\\]+$'), d, filename)
@@ -393,14 +394,13 @@ add_handler('uri_dropped',
end)
local EOLs = {
- textadept.locale.STATUS_CRLF,
- textadept.locale.STATUS_CR,
- textadept.locale.STATUS_LF
+ locale.STATUS_CRLF,
+ locale.STATUS_CR,
+ locale.STATUS_LF
}
add_handler('update_ui',
function() -- sets docstatusbar text
local buffer = buffer
- local locale = textadept.locale
local pos = buffer.current_pos
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count
local col = buffer.column[pos] + 1
@@ -444,12 +444,11 @@ add_handler('view_switch',
add_handler('quit',
function() -- prompts for confirmation if any buffers are dirty; saves session
- local locale = textadept.locale
local any = false
local list = {}
for _, buffer in ipairs(textadept.buffers) do
if buffer.dirty then
- list[#list + 1] = buffer.filename or locale.UNTITLED
+ list[#list + 1] = buffer.filename or buffer._type or locale.UNTITLED
any = true
end
end
@@ -475,4 +474,4 @@ end
-- Default error handler.
-- Prints the errors to an error buffer.
-- @param ... Error strings.
-function error(...) textadept._print(textadept.locale.ERROR_BUFFER, ...) end
+function error(...) textadept._print(locale.ERROR_BUFFER, ...) end