From f23283b23db8dd67ac7c951ab4093b8b1d54ada4 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Mon, 6 Aug 2007 04:59:15 -0400 Subject: Initial import of core Lua files. --- core/init.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 core/init.lua (limited to 'core/init.lua') 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 mitchellcaladbolg.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' -- cgit v1.2.3