aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/command_entry.lua6
-rw-r--r--modules/textadept/editing.lua4
-rw-r--r--modules/textadept/find.lua4
-rw-r--r--modules/textadept/menu.lua4
-rw-r--r--modules/textadept/run.lua12
-rw-r--r--modules/textadept/session.lua6
-rw-r--r--modules/textadept/snippets.lua17
7 files changed, 25 insertions, 28 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua
index dd1b6bc2..0a51a76b 100644
--- a/modules/textadept/command_entry.lua
+++ b/modules/textadept/command_entry.lua
@@ -91,9 +91,9 @@ local env = setmetatable({}, {
})
---
--- Executes string *code* as Lua code.
--- Code is subject to an "abbreviated" environment where the contents of the
--- `buffer`, `view`, and `ui` tables are also considered as globals.
+-- Executes string *code* as Lua code subject to an "abbreviated" environment
+-- where the contents of the `buffer`, `view`, and `ui` tables are also
+-- considered as global functions and fields.
-- Prints the results of '=' expressions like in the Lua prompt.
-- @param code The Lua code to execute.
-- @name execute_lua
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 1335b8aa..5c86130c 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -22,7 +22,7 @@ local M = {}
-- Typeover characters are defined in the [`typeover_chars`](#typeover_chars)
-- table.
-- @field AUTOINDENT (bool)
--- Match the indentation level of the previous line when inserting a new line.
+-- Match the previous line's indentation level when inserting a new line.
-- The default value is `true`.
-- @field STRIP_TRAILING_SPACES (bool)
-- Strip trailing whitespace before saving files.
@@ -512,7 +512,7 @@ end
--
-- 1. If text is selected and spans multiple lines, all text on the lines
-- containing the selection is passed as stdin. However, if the end of the
--- selection is at the beginning of a line, only the line ending characters from
+-- selection is at the beginning of a line, only the line ending delimiters from
-- the previous line are included. The rest of the line is excluded.
-- 2. If text is selected and spans a single line, only the selected text is
-- used.
diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua
index 4a9e6054..f367d5fa 100644
--- a/modules/textadept/find.lua
+++ b/modules/textadept/find.lua
@@ -189,7 +189,7 @@ end
-- otherwise continues an incremental search by searching for the next or
-- previous instance of string *text* depending on boolean *next*.
-- *anchor* indicates whether or not to search for *text* starting from the
--- current position instead of the position where incremental search began at.
+-- caret position instead of the position where incremental search began at.
-- Only the `match_case` find option is recognized. Normal command entry
-- functionality is unavailable until the search is finished by pressing `Esc`
-- (`⎋` on Mac OSX | `Esc` in curses).
@@ -197,7 +197,7 @@ end
-- incremental search.
-- @param next Flag indicating whether or not the search direction is forward.
-- @param anchor Optional flag indicating whether or not to start searching from
--- the current position. The default value is `false`.
+-- the caret position. The default value is `false`.
-- @name find_incremental
function M.find_incremental(text, next, anchor)
if text then find_incremental(text, next, anchor) return end
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 4099cc28..2833311a 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -297,7 +297,7 @@ end
local items, commands
---
--- Sets `ui.menubar` from *menubar*, a table of menus.
+-- Sets `ui.menubar` from menu table *menubar*.
-- Each menu is an ordered list of menu items and has a `title` key for the
-- title text. Menu items are tables containing menu text and either a function
-- to call or a table containing a function with its parameters to call when an
@@ -322,7 +322,7 @@ end
M.set_menubar(menubar)
---
--- Sets `ui.context_menu` from *menu*, an ordered list of menu items.
+-- Sets `ui.context_menu` from menu item list *menu*.
-- Menu items are tables containing menu text and either a function to call or
-- a table containing a function with its parameters to call when an item is
-- clicked. Menu items may also be sub-menus, ordered lists of menu items with
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 32823c47..7a0d5920 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -4,7 +4,7 @@ local M = {}
--[[ This comment is for LuaDoc.
---
--- Compile and run/execute source files with Textadept.
+-- Compile and run source code files with Textadept.
-- [Language modules][] may tweak the `compile_commands`, `run_commands`, and/or
-- `error_patterns` tables for particular languages.
--
@@ -129,10 +129,10 @@ end
-- strings.
-- Command line strings may have the following macros:
--
--- + `%(filepath)`: The full path of the current file.
+-- + `%(filepath)`: The current file's full path.
-- + `%(filedir)`: The current file's directory path.
--- + `%(filename)`: The name of the file, including its extension.
--- + `%(filename_noext)`: The name of the file, excluding its extension.
+-- + `%(filename)`: The file's name, including its extension.
+-- + `%(filename_noext)`: The file's name, excluding its extension.
-- @class table
-- @name compile_commands
M.compile_commands = {actionscript='mxmlc "%(filename)"',ada='gnatmake "%(filename)"',antlr='antlr4 "%(filename)"',g='antlr3 "%(filename)"',applescript='osacompile "%(filename)" -o "%(filename_noext).scpt"',boo='booc "%(filename)"',caml='ocamlc -o "%(filename_noext)" "%(filename)"',csharp=WIN32 and 'csc "%(filename)"' or 'mcs "%(filename)"',cpp='g++ -o "%(filename_noext)" "%(filename)"',c='gcc -o "%(filename_noext)" "%(filename)"',coffeescript='coffee -c "%(filename)"',context='context --nonstopmode "%(filename)"',cuda=WIN32 and 'nvcc -o "%(filename_noext).exe" "%(filename)"' or 'nvcc -o "%(filename_noext)" "%(filename)"',dmd='dmd "%(filename)"',dot='dot -Tps "%(filename)" -o "%(filename_noext).ps"',eiffel='se c "%(filename)"',erlang='erl -compile "%(filename_noext)"',fsharp=WIN32 and 'fsc.exe "%(filename)"' or 'mono fsc.exe "%(filename)"',fortran='gfortran -o "%(filename_noext)" "%(filename)"',gap='gac -o "%(filename_noext)" "%(filename)"',go='go build "%(filename)"',groovy='groovyc "%(filename)"',haskell=WIN32 and 'ghc -o "%(filename_noext).exe" "%(filename)"' or 'ghc -o "%(filename_noext)" "%(filename)"',inform=function() return 'inform -c "'..buffer.filename:match('^(.+%.inform[/\\])Source')..'"' end,java='javac "%(filename)"',latex='pdflatex -file-line-error -halt-on-error "%(filename)"',less='lessc "%(filename)" "%(filename_noext).css"',lilypond='lilypond "%(filename)"',lisp='clisp -c "%(filename)"',litcoffee='coffee -c "%(filename)"',lua='luac -o "%(filename_noext).luac" "%(filename)"',markdown='markdown "%(filename)" > "%(filename_noext).html"',nemerle='ncc "%(filename)" -out:"%(filename_noext).exe"',nimrod='nimrod c "%(filename)"',nsis='MakeNSIS "%(filename)"',objective_c='gcc -o "%(filename_noext)" "%(filename)"',pascal='fpc "%(filename)"',perl='perl -c "%(filename)"',php='php -l "%(filename)"',prolog='gplc --no-top-level "%(filename)"',python='python -m py_compile "%(filename)"',ruby='ruby -c "%(filename)"',sass='sass "%(filename)" "%(filename_noext).css"',scala='scalac "%(filename)"',tex='pdftex -file-line-error -halt-on-error "%(filename)"',vala='valac "%(filename)"',vb=WIN32 and 'vbc "%(filename)"' or 'vbnc "%(filename)"',}
@@ -162,8 +162,8 @@ events.connect(events.COMPILE_OUTPUT, print_output)
M.run_commands = {actionscript=WIN32 and 'start "" "%(filename_noext).swf"' or OSX and 'open "file://%(filename_noext).swf"' or 'xdg-open "%(filename_noext).swf"',ada=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',applescript='osascript "%(filename)"',awk='awk -f "%(filename)"',batch='"%(filename)"',boo='booi "%(filename)"',caml='ocamlrun "%(filename_noext)"',csharp=WIN32 and '"%(filename_noext)"' or 'mono "%(filename_noext).exe"',cpp=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',chuck='chuck "%(filename)"',cmake='cmake -P "%(filename)"',coffeescript='coffee "%(filename)"',context=WIN32 and 'start "" "%(filename_noext).pdf"' or OSX and 'open "%(filename_noext).pdf"' or 'xdg-open "%(filename_noext).pdf"',cuda=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',dmd=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',eiffel="./a.out",fsharp=WIN32 and '"%(filename_noext)"' or 'mono "%(filename_noext).exe"',forth='gforth "%(filename)" -e bye',fortran=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',gnuplot='gnuplot "%(filename)"',go='go run "%(filename)"',groovy='groovy "%(filename)"',haskell=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',hypertext=WIN32 and 'start "" "%(filename)"' or OSX and 'open "file://%(filename)"' or 'xdg-open "%(filename)"',idl='idl -batch "%(filename)"',Io='io "%(filename)"',java='java "%(filename_noext)"',javascript='node "%(filename)"',latex=WIN32 and 'start "" "%(filename_noext).pdf"' or OSX and 'open "%(filename_noext).pdf"' or 'xdg-open "%(filename_noext).pdf"',less='lessc --no-color "%(filename)"',lilypond=WIN32 and 'start "" "%(filename_noext).pdf"' or OSX and 'open "%(filename_noext).pdf"' or 'xdg-open "%(filename_noext).pdf"',lisp='clisp "%(filename)"',litcoffee='coffee "%(filename)"',lua='lua -e "io.stdout:setvbuf(\'no\')" "%(filename)"',makefile=WIN32 and 'nmake -f "%(filename)"' or 'make -f "%(filename)"',markdown='markdown "%(filename)"',nemerle=WIN32 and '"%(filename_noext)"' or 'mono "%(filename_noext).exe"',nimrod=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',objective_c=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',pascal=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',perl='perl "%(filename)"',php='php "%(filename)"',pike='pike "%(filename)"',pkgbuild='makepkg -p "%(filename)"',prolog=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',python='python "%(filename)"',rstats=WIN32 and 'Rterm -f "%(filename)"' or 'R -f "%(filename)"',rebol='REBOL "%(filename)"',rexx=WIN32 and 'rexx "%(filename_noext)"' or 'regina "%(filename_noext)"',ruby='ruby "%(filename)"',sass='sass "%(filename)"',scala='scala "%(filename_noext)"',bash='bash "%(filename)"',csh='tcsh "%(filename)"',sh='sh "%(filename)"',zsh='zsh "%(filename)"',smalltalk='gst "%(filename)"',tcl='tclsh "%(filename)"',tex=WIN32 and 'start "" "%(filename_noext).pdf"' or OSX and 'open "%(filename_noext).pdf"' or 'xdg-open "%(filename_noext).pdf"',vala=WIN32 and '"%(filename_noext)"' or './"%(filename_noext)"',vb=WIN32 and '"%(filename_noext)"' or 'mono "%(filename_noext).exe"',}
---
--- Runs/executes the file based on its extension or lexer, using the command
--- from the `run_commands` table.
+-- Runs the file based on its extension or lexer, using the command from the
+-- `run_commands` table.
-- Emits a `RUN_OUTPUT` event.
-- @see run_commands
-- @see _G.events
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index d470ce5a..0aa2bc23 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -29,8 +29,8 @@ M.SAVE_ON_QUIT = true
M.MAX_RECENT_FILES = 10
---
--- Loads Textadept session file *filename* or user-selected file, returning
--- `true` if the session file was opened and read.
+-- Loads session file *filename* or user-selected file, returning `true` if the
+-- session file was opened and read.
-- Textadept restores split views, opened buffers, cursor information, and
-- recent files.
-- @param filename Optional absolute path to the session file to load. If `nil`,
@@ -116,7 +116,7 @@ events.connect(events.ARG_NONE, function()
end)
---
--- Saves a Textadept session to file *filename* or user-selected file.
+-- Saves the session to file *filename* or user-selected file.
-- Saves split views, opened buffers, cursor information, and recent files.
-- @param filename Optional absolute path to the session file to save. If `nil`,
-- the user is prompted for one.
diff --git a/modules/textadept/snippets.lua b/modules/textadept/snippets.lua
index da6193df..0f68246e 100644
--- a/modules/textadept/snippets.lua
+++ b/modules/textadept/snippets.lua
@@ -50,10 +50,7 @@ local M = {}
-- code's return text. The code may use a temporary `selected_text` global
-- variable that contains the currently selected text. An example is
--
--- snippets['foo'] = [[
--- %2<('%1'):gsub('^.', function(c)
--- return c:upper() -- capitalize the word
--- end)>, %1(mirror) on the wall.]]
+-- snippets['add'] = '%1(1) + %2(2) = %3<%1 + %2>'
--
-- Textadept executes shell code using Lua's [`io.popen()`][] and replaces the
-- transform with the process' standard output (stdout). An example is
@@ -127,8 +124,8 @@ end
---
-- Inserts snippet text *text* or the snippet associated with the trigger behind
--- the caret as a snippet, or goes to the next placeholder of the active
--- snippet, ultimately only returning `false` if no action was taken.
+-- the caret as a snippet, or goes to the active snippet's next placeholder,
+-- ultimately only returning `false` if no action was taken.
-- @param text Optional snippet text to insert. If `nil`, attempts to insert a
-- new snippet based on the trigger, the word behind caret, and the current
-- lexer.
@@ -153,8 +150,8 @@ function M._insert(text)
end
---
--- Goes back to the previous snippet placeholder, reverting any changes from the
--- current one, but returns `false` only if no snippet is active.
+-- Jumps back to the previous snippet placeholder, reverting any changes from
+-- the current one, but returns `false` only if no snippet is active.
-- @return `false` if no snippet is active; `nil` otherwise.
-- @name _previous
function M._previous()
@@ -163,14 +160,14 @@ function M._previous()
end
---
--- Cancels insertion of the active snippet.
+-- Cancels the active snippet, removing all inserted text.
-- @name _cancel_current
function M._cancel_current()
if #snippet_stack > 0 then snippet_stack[#snippet_stack]:cancel() end
end
---
--- Prompts the user for a snippet to insert from a list of global and
+-- Prompts the user to select a snippet to insert from a list of global and
-- language-specific snippets.
-- @name _select
function M._select()