Skip to content

Commit fef75ce

Browse files
committed
Updated LDoc.
Utilize the first documentation line instead of making it a blank header and added LDoc for local functions and tables.
1 parent 2f95106 commit fef75ce

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

init.lua

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
-- Copyright 2014-2023 Mitchell. See LICENSE.
22

3-
---
4-
-- A Textadept module for loading an interactive Lua REPL using the editor's Lua State, similar
3+
--- A Textadept module for loading an interactive Lua REPL using the editor's Lua State, similar
54
-- to Lua's interactive REPL.
65
--
76
-- This is an alternative to the single-line Lua command entry.
@@ -22,10 +21,10 @@ local M = {}
2221
-- Localizations.
2322
if not rawget(_L, 'Lua REPL') then _L['Lua REPL'] = 'L_ua REPL' end
2423

25-
-- A special environment for a Lua REPL.
24+
--- A special environment for a Lua REPL.
2625
-- It has an `__index` metafield for accessing Textadept's global environment.
27-
-- @class table
28-
-- @name env
26+
-- @table env
27+
-- @local
2928
local env = setmetatable({
3029
print = function(...)
3130
buffer:add_text('--> ')
@@ -38,13 +37,11 @@ local env = setmetatable({
3837
end
3938
}, {__index = _G})
4039

41-
---
42-
-- Lua command history.
40+
--- Lua command history.
4341
-- It has a numeric `pos` field that indicates where in the history the user currently is.
4442
M.history = {pos = 0}
4543

46-
---
47-
-- Evaluates as Lua code the current line or the text on the currently selected lines.
44+
--- Evaluates as Lua code the current line or the text on the currently selected lines.
4845
-- If the current line has a syntax error, it is ignored and treated as a line continuation.
4946
function M.evaluate_repl()
5047
local s, e = buffer.selection_start, buffer.selection_end
@@ -161,8 +158,7 @@ M.keys = {
161158
['ctrl+n'] = M.cycle_history_next
162159
}
163160

164-
-- Cannot initially define keys in `keys.lua` because that table does not exist yet and will
165-
-- be overwritten by the Lua language module. Instead, define keys here.
161+
--- Register REPL keys.
166162
local function register_keys()
167163
if not keys.lua[next(M.keys)] then
168164
for key, f in pairs(M.keys) do
@@ -175,8 +171,7 @@ local function register_keys()
175171
end
176172
events.connect(events.RESET_AFTER, register_keys)
177173

178-
---
179-
-- Creates or switches to a Lua REPL.
174+
--- Creates or switches to a Lua REPL.
180175
-- If *new* is `true`, creates a new REPL even if one already exists.
181176
-- @param new Flag that indicates whether or not to create a new REPL even if one already exists.
182177
function M.open(new)

0 commit comments

Comments
 (0)