aboutsummaryrefslogtreecommitdiff
path: root/core/init.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2007-08-06 04:59:15 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2007-08-06 04:59:15 -0400
commitf23283b23db8dd67ac7c951ab4093b8b1d54ada4 (patch)
tree02df5bf4cc3c18b2e4281c3eefbf1980c24abdc1 /core/init.lua
parent1aa6c6702415079a6546f1325789c3a86f733f34 (diff)
downloadtextadept-f23283b23db8dd67ac7c951ab4093b8b1d54ada4.tar.gz
textadept-f23283b23db8dd67ac7c951ab4093b8b1d54ada4.zip
Initial import of core Lua files.
Diffstat (limited to 'core/init.lua')
-rw-r--r--core/init.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/init.lua b/core/init.lua
new file mode 100644
index 00000000..297495e6
--- /dev/null
+++ b/core/init.lua
@@ -0,0 +1,21 @@
+-- Copyright 2007 Mitchell mitchell<att>caladbolg.net. See LICENSE.
+
+---
+-- Checks if the buffer being indexed is the currently focused buffer.
+-- This is necessary because any buffer actions are performed in the focused
+-- views' buffer, which may not be the buffer being indexed. Throws an error
+-- if the check fails.
+-- @param buffer The buffer in question.
+function textadept.check_focused_buffer(buffer)
+ if type(buffer) ~= 'table' or not buffer.doc_pointer then
+ error('Buffer argument expected.', 2)
+ elseif textadept.focused_doc_pointer ~= buffer.doc_pointer then
+ error('The indexed buffer is not the focused one.', 2)
+ end
+end
+
+package.path = package.path..';'.._HOME..'/core/?.lua'
+
+require 'iface'
+require 'handlers'
+require 'file_io'