aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/.buffer.luadoc8
-rw-r--r--core/events.lua4
-rw-r--r--core/file_io.lua2
-rw-r--r--core/gui.lua2
-rw-r--r--core/init.lua9
-rw-r--r--core/keys.lua2
6 files changed, 13 insertions, 14 deletions
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc
index 248d90b6..6f57ac5b 100644
--- a/core/.buffer.luadoc
+++ b/core/.buffer.luadoc
@@ -2785,6 +2785,14 @@ function check_global(buffer) end
function delete(buffer) end
---
+-- Creates and returns a new buffer.
+-- Emits a `BUFFER_NEW` event.
+-- @return the new buffer.
+-- @class function
+-- @see events.BUFFER_NEW
+function new() end
+
+---
-- Returns the range of text from *start_pos* to *end_pos* in the buffer.
-- @param buffer The global buffer.
-- @param start_pos The start position of the range of text to get in *buffer*.
diff --git a/core/events.lua b/core/events.lua
index 6f755110..ecc35032 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -53,7 +53,7 @@ local M = {}
-- Emitted by [`buffer:delete()`][].
-- @field BUFFER_NEW (string)
-- Called after creating a new buffer.
--- Emitted on startup and by [`new_buffer()`][].
+-- Emitted on startup and by [`buffer.new()`][].
-- @field CALL_TIP_CLICK (string)
-- Called when clicking on a calltip.
-- Arguments:
@@ -244,7 +244,7 @@ local M = {}
--
-- [`buffer:auto_c_cancel()`]: buffer.html#auto_c_cancel
-- [`view:goto_buffer()`]: view.html#goto_buffer
--- [`new_buffer()`]: _G.html#new_buffer
+-- [`buffer.new()`]: buffer.html#new
-- [`buffer:delete()`]: buffer.html#delete
-- [dwell period]: buffer.html#mouse_dwell_time
-- [`gui.menu()`]: gui.html#menu
diff --git a/core/file_io.lua b/core/file_io.lua
index 7ccf7605..5314d51d 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -173,7 +173,7 @@ function io.open_file(utf8_filenames)
elseif lfs.attributes(filename) then
error(err)
end
- local buffer = new_buffer()
+ local buffer = buffer.new()
-- Tries to detect character encoding and convert text from it to UTF-8.
local encoding, encoding_bom = detect_encoding(text)
if encoding ~= 'binary' then
diff --git a/core/gui.lua b/core/gui.lua
index e9aa763b..a69ccbd6 100644
--- a/core/gui.lua
+++ b/core/gui.lua
@@ -34,7 +34,7 @@ local function _print(buffer_type, ...)
if buffer._type == buffer_type then view:goto_buffer(i) break end
end
if buffer._type ~= buffer_type then
- new_buffer()._type = buffer_type
+ buffer.new()._type = buffer_type
events.emit(events.FILE_OPENED)
end
end
diff --git a/core/init.lua b/core/init.lua
index 7cb91798..68275835 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -104,15 +104,6 @@ local view
-- The functions below are Lua C functions.
---
--- Creates and returns a new buffer.
--- Emits a `BUFFER_NEW` event.
--- @return the new buffer.
--- @class function
--- @see events.BUFFER_NEW
--- @name new_buffer
-local new_buffer
-
----
-- Emits a `QUIT` event, and unless any handler returns `false`, quits
-- Textadept.
-- @see events.QUIT
diff --git a/core/keys.lua b/core/keys.lua
index 080ce400..f6373af6 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -58,7 +58,7 @@ local M = {}
-- containing Lua functions with a set of arguments to call the function with.
-- Examples are:
--
--- keys['cn'] = new_buffer
+-- keys['cn'] = buffer.new
-- keys['cs'] = buffer.save
-- keys['a('] = {_M.textadept.editing.enclose, '(', ')'}
-- keys['cu'] = function() io.snapopen(_USERHOME) end