From 96c85498c019e381d0aeed2e33e626563563ea8c Mon Sep 17 00:00:00 2001
From: mitchell <70453897+667e-11@users.noreply.github.com>
Date: Wed, 7 Mar 2012 09:28:43 -0500
Subject: Documentation overhaul with Discount (Markdown implementation). The
standard LuaDoc template is no longer used. Instead, the new
`scripts/markdowndoc.lua` has the template for LuaDoc and
`scripts/update_doc` has the template for the Manual. Also added README,
CHANGELOG, and THANKS files.
---
CHANGELOG.md | 1003 ++++++++++++++++++++++++++++++++++++++
README.md | 51 ++
THANKS.md | 30 ++
core/._M.luadoc | 61 ++-
core/.buffer.luadoc | 520 ++++++++++----------
core/args.lua | 4 +-
core/events.lua | 186 +++----
core/file_io.lua | 21 +-
core/init.lua | 11 +-
core/keys.lua | 19 +-
core/locale.lua | 8 +-
doc/manual/10_Advanced.md | 38 +-
doc/manual/11_Scripting.md | 42 +-
doc/manual/12_Compiling.md | 67 +--
doc/manual/13_Help.md | 10 +-
doc/manual/14_Appendix.md | 421 +++++++++++++++-
doc/manual/1_Introduction.md | 38 +-
doc/manual/2_Installation.md | 73 +--
doc/manual/3_UserInterface.md | 6 +-
doc/manual/4_WorkingWithFiles.md | 7 +-
doc/manual/5_FileNavigation.md | 2 -
doc/manual/6_AdeptEditing.md | 79 +--
doc/manual/7_Modules.md | 106 ++--
doc/manual/8_Themes.md | 37 +-
doc/manual/9_Preferences.md | 36 +-
modules/cpp/init.lua | 4 +-
modules/lua/init.lua | 4 +-
modules/textadept/adeptsense.lua | 77 +--
modules/textadept/keys.lua | 2 +-
modules/textadept/mime_types.lua | 2 +-
modules/textadept/run.lua | 16 +-
modules/textadept/snippets.lua | 12 +-
scripts/adeptsensedoc.lua | 10 +-
scripts/markdowndoc.lua | 221 +++++++++
scripts/update_doc | 156 +++---
35 files changed, 2554 insertions(+), 826 deletions(-)
create mode 100644 CHANGELOG.md
create mode 100644 README.md
create mode 100644 THANKS.md
create mode 100644 scripts/markdowndoc.lua
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..91da4a4b
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,1003 @@
+# Changelog
+
+## 5.1 (01 Mar 2012)
+
+Bugfixes:
+
+* Fixed crash caused by [`gui.filteredlist()`][] dialogs.
+* Support multiple `@return` tags in Lua Adeptsense.
+* Fixed display of `buffer._type` when it has slashes in its name.
+
+Changes:
+
+* Better Lua Adeptsense formatting.
+* Use new Cocoa-based [GtkOSXApplication][] library for better OSX support.
+* Lexers with no tokens can be styled manually.
+* Added more OSX default key shortcuts.
+
+[`gui.filteredlist()`]: api/gui.html#filteredlist
+[GtkOSXApplication]: https://live.gnome.org/GTK%2B/OSX/Integration#Gtk-mac-integration.2BAC8-GtkOSXApplication
+
+## 5.0 (01 Feb 2012)
+
+Please see the [4 to 5 migration guide][] for upgrading from Textadept 4 to
+Textadept 5.
+
+Bugfixes:
+
+* Fixed bug with recent files in sessions.
+
+Changes:
+
+* Added default extension and folder filters in
+ `modules/textadept/snapopen.lua`.
+* Added ChucK lexer.
+* Updated to [Scintilla][] 3.0.3.
+* Also include [LuaJIT][] executables in releases.
+
+[4 to 5 migration guide]: manual/14_Appendix.html#Textadept.4.to.5
+[Scintilla]: http://scintilla.org
+[LuaJIT]: http://luajit.org
+
+## 5.0 beta (11 Jan 2012)
+
+Bugfixes:
+
+* Fixed bug in [`reset()`][] from update to Lua 5.2.
+
+Changes:
+
+* Changed `locale.localize()` to global [`_L`][] table and removed `locale`
+ module.
+* Renamed `_m` to [`_M`][].
+* Do not clear registered images when autocompleting with Adeptsense.
+* Renamed editing module's `current_word()` to [`select_word()`][].
+* Updated [manual][].
+
+[`reset()`]: api/_G.html#reset
+[`_L`]: api/_L.html
+[`_M`]: api/_M.html
+[manual]: manual
+[`select_word()`]: api/_M.textadept.editing.html#select_word
+
+## 5.0 alpha (21 Dec 2012)
+
+Bugfixes:
+
+* None.
+
+Changes:
+
+* Updated to [Lua 5.2][].
+* Updated sections in the [manual][] to reflect Lua 5.2 changes.
+* Textadept can be compiled with [LuaJIT][].
+
+[Lua 5.2]: http://www.lua.org/manual/5.2/
+[manual]: manual
+[LuaJIT]: http://luajit.org
+
+## 4.3 (01 Dec 2011)
+
+Bugfixes:
+
+* Fixed bug with opening files in the current directory from the command line.
+* Fixed erroneous charset conversion.
+
+Changes:
+
+* Added on-the-fly [theme switching][].
+* All new `light` and `dark` themes.
+* Removed `_m.textadept.editing.select_style()`.
+* Simplify theming via [gtkrc][] by naming `GtkWindow` only.
+* Updated to [Scintilla][] 3.0.1.
+
+[theme switching]: api/gui.html#set_theme
+[gtkrc]: manual/8_Themes.html#Theming.the.GUI
+[Scintilla]: http://scintilla.org
+
+## 4.2 (01 Nov 2011)
+
+Bugfixes:
+
+* Fixed bug with `%n` in Replace introduced in 4.1.
+* Fixed Adeptsense autocomplete for single item.
+
+Changes:
+
+* Updated to [Scintilla][] 3.0.0.
+
+[Scintilla]: http://scintilla.org
+
+## 4.1 (01 Oct 2011)
+
+Bugfixes:
+
+* Only fold when clicking on fold margin, not any sensitive one.
+* Fixed bug with `CALL_TIP_CLICK` event disconnect in Adeptsense.
+* Fixed bug with autocomplete and capitalization.
+
+Changes:
+
+* Handle mouse [dwell events][] `DWELL_START` and `DWELL_END`.
+* Rearranged `Tools` menu slightly.
+* Slight API changes:
+ + [`_BUFFERS`][] and [`_VIEWS`][] structure changed.
+ + Removed `buffer.doc_pointer` and `view.doc_pointer`.
+ + Added `view.buffer` field.
+ + Renamed `gui.check_focused_buffer()` to [`buffer:check_global()`][].
+ + [`view:goto_buffer()`][] and [`gui.goto_view()`] arguments make sense now.
+ (May require changes to custom key commands.)
+* Directory is remembered in file chooser dialog after open or save as.
+* Added language-specific [context menu][] support.
+* Use [LuaCoco][] patch for Lua 5.1.4.
+* Use lexer at the caret for key commands and snippets.
+* Updated to [Scintilla][] 2.29.
+
+[dwell events]: api/events.html
+[`_BUFFERS`]: api/_G.html#_BUFFERS
+[`_VIEWS`]: api/_G.html#_VIEWS
+[`buffer:check_global()`]: api/buffer.html#buffer.check_global
+[`view:goto_buffer()`]: api/view.html#view:goto_buffer
+[`gui.goto_view()`]: api/gui.html#goto_view
+[context menu]: api/_M.html#Context.Menu
+[LuaCoco]: http://coco.luajit.org/
+[Scintilla]: http://scintilla.org
+
+## 4.0 (01 Sep 2011)
+
+Please see the [3 to 4 migration guide][] for upgrading from Textadept 3 to
+Textadept 4.
+
+Bugfixes:
+
+* Makefile should only link to `libdl.so` on Linux/BSD.
+* Fixed memory access bug in [`gui.dialog()`][].
+* Autocompletion list sort order respects `buffer.auto_c_ignore_case` now.
+* Fixed split view focus bug with the same buffer in two views.
+* Set new buffer EOL mode properly on Mac OSX.
+
+Changes:
+
+* Added Russian translation.
+* Changed some key commands from 4.0 beta 2.
+* Do not hide the statusbar when the command entry has focus.
+
+[3 to 4 migration guide]: manual/14_Appendix.html#Textadept.3.to.4
+[`gui.dialog()`]: api/gui.html#dialog
+
+## 4.0 beta 2 (11 Aug 2011)
+
+Bugfixes:
+
+* Fixed transpose characters bug at end of buffer.
+* Do not autosave over explicitly loaded session.
+* Fixed startup crash on Mac OSX.
+* Fixed resize crash on Mac OSX Lion.
+
+Changes:
+
+* Added Scala lexer.
+* Add [recent file list][] to session files.
+* Autocomplete supports multiple selections.
+* Swapped OSX `c` and `m` key command definition modifiers.
+* Changed some key bindings from 4.0 beta.
+
+[recent file list]: api/io.html#recent_files
+
+## 4.0 beta (01 Aug 2011)
+
+Bugfixes:
+
+* None.
+
+Changes:
+
+* Mac OSX uses GTK 2.24.
+* Added [`io.open_recent_file()`][].
+* Changes to localization file again.
+* [`buffer` functions][] may omit the first `buffer` argument (e.g.
+ `buffer.line_down()` is allowed).
+* Complete overhaul of menus and added accelerators to [menu][] items.
+* Renamed `_m.textadept.editing.SAVE_STRIPS_WS` to
+ `_m.textadept.editing.STRIP_WHITESPACE_ON_SAVE`.
+* Renamed `_m.textadept.editing.select_scope()` to
+ `_m.textadept.editing.select_style()`.
+* *Completely new set of key commands.*
+* Updated to [Scintilla][] 2.28.
+
+[`io.open_recent_file()`]: api/io.html#open_recent_file
+[`buffer` functions]: api/buffer.html#Functions
+[menu]: api/gui.html#gtkmenu
+[Scintilla]: http://scintilla.org
+
+## 3.9 (01 Jul 2011)
+
+Bugfixes:
+
+* Fixed bug for when [`gui.dialog`][] steals focus.
+
+Changes:
+
+* Added support for [GTK][] 3.0.
+* Use ID generator [functions][] for marker, indicator, and user list IDs.
+* Updated to [Scintilla][] 2.27.
+* Use string constants for event names.
+* Compile and run commands [emit events][].
+* Enhanced Luadoc and Lua Adeptsense.
+* Added `fold.line.comments` property for folding multiple single-line comments.
+* Use [GTK][] 2.22 on Windows.
+* Can localize the labels and buttons in the GUI [find][] frame.
+* Added ConTeXt lexer.
+
+[GTK]: http://gtk.org
+[`gui.dialog`]: api/gui.html#dialog
+[functions]: api/_SCINTILLA.html#Functions
+[Scintilla]: http://scintilla.org
+[emit events]: api/_M.textadept.run.html#Run.Events
+[find]: api/gui.find.html
+
+## 3.8 (11 Jun 2011)
+
+Bugfixes:
+
+* Removed non-existant key chain.
+* Fixed bug in snippets.
+
+Changes:
+
+* Updated Adeptsense and documentation.
+* [`events.handlers`][] is accessible.
+* Added menu mnemonics for indentation size.
+* Added support for indicator and hotspot [events][].
+* Updated [documentation][] for installing [official modules][].
+* Updated to [Scintilla][] 2.26.
+* Writing custom folding for lexers is much [easier][] now.
+* Added native folding for more than 60% of existing lexers. The rest still use
+ folding by indentation by default.
+
+[`events.handlers`]: api/events.html#handlers
+[events]: api/events.html
+[documentation]: manual/7_Modules.html#Getting.Modules
+[official modules]: http://foicica.com/hg
+[Scintilla]: http://scintilla.org
+[easier]: api/lexer.html#Simple.Code.Folding
+
+## 3.7 (01 May 2011)
+
+Bugfixes:
+
+* Fixed bug in [`buffer:get_lexer()`][].
+
+Changes:
+
+* Changed Mac OSX Adeptsense complete key command from `~` to `Ctrl+Escape`.
+* Added [PHP module][].
+
+[`buffer:get_lexer()`]: api/buffer.html#buffer.get_lexer
+[PHP module]: api/_M.php.html
+
+## 3.7 beta 3 (01 Apr 2011)
+
+Bugfixes:
+
+* Small Adeptsense bugfixes.
+* Snapopen respects filesystem encoding.
+* Standard input dialogs have "Cancel" button by default.
+
+Changes:
+
+* Adeptsense tweaks for better completion and apidoc support.
+* Language modules load a user [`post_init.lua`][] script if it exists.
+* Added Ruby on Rails lexer and [module][].
+* Added [RHTML module][].
+* Updated mime-types and prioritize by shebang, pattern, and then file
+ extension.
+* [`buffer:get_lexer(true)`] returns the lexer at the caret position.
+* Adeptsense can be triggered in embedded lexers now.
+* Added C standard library and Lua C API to C/C++ Adeptsense.
+* Lua module fields are now in Lua Adeptsense.
+* Updated to [Scintilla][] 2.25.
+* Rewrote [`_m.textadept.snippets`][] with syntax changes.
+* `Alt+I` (`Ctrl+I` on Mac OSX) is now "Select Snippet" instead of "Show Style".
+ "Show Style" is now `Ctrl+Alt+Shift+I` (`Ctrl+Apple+Shift+I`).
+* Adeptsense can exclude types matched by `sense.syntax.type_declarations`
+ patterns.
+* `Ctrl+T, V` (`Apple+T, V` on Mac OSX) keychain for toggling whitespace, wrap,
+ etc. is now `Ctrl+Shift+B` (`Apple+Shift+B`).
+* Key commands and menu definition syntax changed.
+* Snapopen allows for multiple-selection.
+* [`gui.print()`] handles `nil` and non-string arguments properly.
+* Officially supported modules have their own [repositories][] and are available
+ as a separate download.
+
+[`post_init.lua`]: manual/7_Modules.html#Customizing.Modules
+[module]: api/_M.rails.html
+[RHTML module]: api/_M.rhtml.html
+[`buffer:get_lexer(true)`]: api/buffer.html#buffer.get_lexer
+[Scintilla]: http://scintilla.org
+[`_m.textadept.snippets`]: api/_M.textadept.snippets.html
+[`gui.print()`]: api/gui.html#print
+[repositories]: http://foicica.com/hg
+
+## 3.7 beta 2 (01 Mar 2011)
+
+Bugfixes:
+
+* Fixed bug with Win32 paths in Adeptsense [`goto_ctag()`][].
+* Adeptsense could not recognize some symbols.
+* Handle `\n` sequences correctly in Adeptsense apidoc.
+* Fixed bug with Adeptsense C/C++ type declarations.
+* Adeptsense can now recognize more than 1 level of inheritence.
+* Keychain is cleared on key command error.
+* Fixed infinite loop bug in `_m.textadept.editing.select_scope()`.
+
+Changes:
+
+* Updated to [Scintilla][] 2.24.
+* Updated mime-types.
+* Line margin width is now `4`.
+* Adeptsense completion list images are accessible via scripts.
+* Added class context completion to Adeptsense.
+* Added class type-inference through variable assignment to Adeptsense.
+* Added Adeptsense [tutorial][].
+* Added `_m.textadept.adeptsense.always_show_globals` setting for showing
+ globals in completion lists.
+* `Ctrl+H` (highlight word) is now `Ctrl+Shift+H`.
+* `Ctrl+H` now shows Adeptsense documentation.
+* Added Adeptsense [`complete()`][] and [`show_documentation()`][] functions to
+ the menu.
+* Language modules condensed into single `init.lua` file.
+* Added `sense.syntax.word_chars` to Adeptsense.
+* Included libpng12 build for 64-bit Debian-based Linux distros (Ubuntu).
+* Added [CSS][], [HTML][], [Java][], and [Ruby][] modules with Adeptsenses.
+
+[`goto_ctag()`]: api/_M.textadept.adeptsense.html#goto_ctag
+[Scintilla]: http://scintilla.org
+[tutorial]: api/_M.textadept.adeptsense.html
+[`complete()`]: api/_M.textadept.adeptsense.html#complete
+[`show_documentation()`]: api/_M.textadept.adeptsense.html#show_documentation
+[CSS]: api/_M.css.html
+[HTML]: api/_M.hypertext.html
+[Java]: api/_M.java.html
+[Ruby]: api/_M.ruby.html
+
+## 3.7 beta (01 Feb 2011)
+
+Bugfixes:
+
+* `update_ui` is called properly for `buffer_new` and `view_new` events.
+* Use proper pointer type for Scintilla calls.
+* Fixed bug with loading lexers from `_USERHOME` on Win32.
+
+Changes:
+
+* More informative error message for unfocused buffer.
+* Added [Adeptsense][], a smarter form of autocompletion for programming
+ languages.
+* Emit a [`language_module_loaded`][] as appropriate.
+* Added indentation settings to "Buffer" menu (finally).
+* Added [`gui.filteredlist()`][] shortcut for `gui.dialog('filteredlist', ...)`.
+* Can navigate between bookmarks with a filteredlist.
+* Language-specific [`char_matches`][] and [`braces`][] can be defined.
+* `command_entry_keypress` event accepts modifier keys.
+
+[Adeptsense]: manual/6_AdeptEditing.html#Adeptsense
+[`language_module_loaded`]: api/_M.textadept.mime_types.html#Mime-type.Events
+[`gui.filteredlist()`]: api/gui.html#filteredlist
+[`char_matches`]: api/_M.textadept.editing.html#char_matches
+[`braces`]: api/_M.textadept.editing.html#braces
+
+## 3.6 (01 Jan 2011)
+
+Bugfixes:
+
+* Fixed infinite recursion errors caused in events.
+* Fix statusbar update bug with key chains.
+* Do not emit `buffer_new` event when splitting the view.
+
+Changes:
+
+* `buffer.rectangular_selection_modifier` on Linux is the Super/Windows key.
+* Improved Hypertext lexer.
+* Added Markdown, BibTeX, CMake, CUDA, Desktop Entry, F#, GLSL, and Nemerle
+ lexers.
+* Added [`_m.textadept.filter_through`][] module for [shell commands][].
+* Moved GUI events from `core/events.lua` to `core/gui.lua`.
+* Separated key command manager from key command definitions.
+
+[`_m.textadept.filter_through`]: api/_M.textadept.filter_through.html
+[shell commands]: manual/10_Advanced.html#Shell.Commands.and.Filtering.Text
+
+## 3.5 (01 Dec 2010)
+
+Bugfixes:
+
+* Fixed bug introduced when exposing Find in Files API.
+
+Changes:
+
+* Lua files are syntax-checked for errors on save.
+* [Menus][] are easier to create.
+* Changed [`_m.textadept.editing.enclose()`][] behavior.
+* Win32 and Mac OSX packages are all-in-one bundles; GTK is no longer an
+ external dependency.
+* New [manual][].
+* Added `file_after_save` [event][].
+
+[Menus]: api/_M.textadept.menu.html
+[`_m.textadept.editing.enclose()`]: api/_M.textadept.editing.html#enclose
+[manual]: manual
+[event]: api/io.html#File.Events
+
+## 3.4 (01 Nov 2010)
+
+Bugfixes:
+
+* Fixed menu item conflicts.
+* Pressing `Cancel` in the [Switch Buffers][] dialog does not jump to the
+ selected buffer anymore.
+* Autocomplete lists sort properly for machines with a different locale.
+* Statusbar is not cleared when set from a key command.
+* Unreadable files are handled appropriately.
+
+Changes:
+
+* Multi-language lexers (HTML, PHP, RHTML, etc.) are processed as fast as single
+ language ones, resulting in a huge speed improvement.
+* An `update_ui` event is triggered after a Lua command is entered.
+* [`gui.dialog()`][] can take tables of strings as arguments now.
+* [`_m.textadept.snapopen.open()`][] takes a recursion depth as a parameter and
+ falls back on a `DEFAULT_DEPTH` if necessary.
+* Removed `_m.textadept.editing.smart_cutcopy()` and
+ `_m.textadept.editing.squeeze()` functions.
+* Added `_m.textadept.editing.SAVE_STRIPS_WS` option to disable strip whitespace
+ on save.
+* Changed locale implementation. Locale files are much easier to create now.
+* `gui.statusbar_text` is now readable instead of being write-only.
+* Can [highlight][] all occurances of a word.
+* Added jsp lexer.
+* More consistant handling of `\` directory separator for Win32.
+* Consolidated `textadept.h` and `lua_interface.c` into single `textadept.c`
+ file.
+* Added [`_G.timeout()`][] function for calling functions and/or events after a
+ period of time.
+* Find in files is accessible through [find API][].
+* Updated to [Scintilla][] 2.22.
+* Renamed `_G.MAC` to `_G.OSX`.
+
+[Switch Buffers]: manual/4_WorkingWithFiles.html#Buffer.Browser
+[`gui.dialog()`]: api/gui.html#dialog
+[`_m.textadept.snapopen.open()`]: api/_M.textadept.snapopen.html#open
+[highlight]: manual/6_AdeptEditing.html#Word.Highlight
+[`_G.timeout()`]: api/_G.html#timeout
+[find API]: api/gui.find.html#find_in_files
+[Scintilla]: http://scintilla.org
+
+## 3.3 (01 Oct 2010)
+
+Bugfixes:
+
+* Fixed buggy snippet menu.
+
+Changes:
+
+* Added [`_m.textadept.snapopen`][] module with menu options for rapidly opening
+ files.
+
+[`_m.textadept.snapopen`]: api/_M.textadept.snapopen.html
+
+## 3.2 (01 Sep 2010)
+
+Bugfixes:
+
+* Fixed "Replace All" infinite loop bug.
+
+Changes:
+
+* Updated to the new [Scintillua][] that does not required patched Scintilla.
+* Updated to [Scintilla][] 2.21.
+
+[Scintillua]: http://foicica.com/scintillua
+[Scintilla]: http://scintilla.org
+
+## 3.1 (21 Aug 2010)
+
+Bugfixes:
+
+* Fixed memory leak in Mac OSX.
+
+Changes:
+
+* Refactored key commands to support [propagation][].
+* Updated to [Scintilla][] 2.20.
+* Added Lua autocompletion.
+
+[propagation]: api/keys.html#Propagation
+[Scintilla]: http://scintilla.org
+
+## 3.0 (01 Jul 2010)
+
+Please see the [2 to 3 migration guide][] for upgrading from Textadept 2 to
+Textadept 3.
+
+Bugfixes:
+
+* None
+
+Changes:
+
+* More accurate CSS and Diff lexers.
+
+[2 to 3 migration guide]: manual/14_Appendix.html#Textadept.2.to.3
+
+## 3.0 beta (21 Jun 2010)
+
+Bugfixes:
+
+* Fixed Mac OSX paste issue.
+* Fixed [`buffer:text_range()`][] argcheck problem.
+
+Changes:
+
+* Remove initial "Untitled" buffer when necessary.
+* Moved core extension modules into [`textadept`][] module.
+* New [API][].
+* `~/.textadept/init.lua` is created for you if one does not exist.
+* No more autoload of `~/.textadept/key_commands.lua` and
+ `~/.textadept/snippets.lua`
+* Updated to [Scintilla][] 2.12.
+* [Abbreviated][] Lua commands in the command entry.
+* Dynamic command line [arguments][].
+* Added statusbar notification on [`reset()`][].
+* Added Gtkrc, Prolog, and Go lexers.
+
+[`buffer:text_range()`]: api/buffer.html#buffer.text_range
+[`textadept`]: api/_M.textadept.html
+[API]: api
+[Scintilla]: http://scintilla.org
+[Abbreviated]: manual/10_Advanced.html#Command.Entry
+[arguments]: api/args.html
+[`reset()`]: api/_G.html#reset
+
+## 2.2 (11 May 2010)
+
+Bugfixes:
+
+* Save buffer before compiling or running.
+* Fixed error in the manual for `~/.textadept/init.lua` example.
+* Ignore `file://` prefix for filenames.
+
+Changes:
+
+* `_USERHOME` comes before `_HOME` in `package.path` so `require` searches
+ `~/.textadept/` first.
+
+## 2.2 beta 2 (01 May 2010)
+
+Bugfixes:
+
+* Fixed crash with [`buffer:text_range()`][].
+* Fixed snippets bug with `%n` sequences.
+* Respect tab settings for snippets.
+* Fixed help hanging bug in Win32.
+* Fixed Lua module commands bug.
+
+Changes:
+
+* Added BSD support.
+* Removed kill-ring from editing module.
+* [Run][] and [compile][] commands are in language-specific modules.
+* [Block comment][] strings are in language-specific modules now.
+* Remove "Untitled" buffer when necessary.
+* Moved "Search" menu into "Tools" menu to prevent `Alt+S` key conflict.
+* Rewrote lexers implementation.
+* Added Inform, Lilypond, and NSIS lexers.
+* `_m.textadept.editing.enclosure` is now an accessible table.
+
+[`buffer:text_range()`]: api/buffer.html#buffer.text_range
+[run]: api/_M.html#Run
+[compile]: api/_M.html#Compile
+[Block comment]: api/_M.html#Block.Comment
+
+## 2.2 beta (01 Apr 2010)
+
+Bugfixes:
+
+* Fixed transform bug in snippets.
+* Fixed bug with Io lexer mime-type.
+* Fixed embedded css/javascript bug in hypertext (HTML) lexer.
+
+Changes:
+
+* Removed `_m.textadept.mlines` module since Scintilla's multiple selections
+ supercedes it.
+* Removed side pane.
+* New [`gui.dialog('filteredlist', ...)] from [gcocoadialog][].
+* Can select buffer from filteredlist dialog (replacing side pane buffer list).
+* Can select lexer from filteredlist dialog.
+* Can have user `key_commands.lua`, `snippets.lua`, `mime_types.conf`,
+ `locale.conf` that are loaded by their respective modules.
+* Added Matlab/Octave lexer.
+* Backspace deletes auto-inserted character pairs.
+* Added notification for session files not found.
+* Snippets use multiple carets.
+* Removed api file support.
+
+[gcocoadialog]: http://foicica.com/gcocoadialog
+[`gui.dialog('filteredist', ...)]: api/gui.html#dialog
+
+## 2.1 (01 Mar 2010)
+
+Bugfixes:
+
+* Do not close files opened from command line when loading PM session.
+* Fixed bug for running a file with no path.
+* Fixed error message for session file not being found.
+* Fixed key command for word autocomplete on Win32.
+* Changed conflicting menu shortcut for Lexers menu.
+* Fixed typos in templates generated by modules PM browser.
+
+Changes:
+
+* Added Dot and JSON lexers.
+* Search `_USERHOME` in addition to `_HOME` for themes.
+* Added command line switch for not loading/saving session.
+* Modified key commands to be more key-layout agnostic.
+* Added `reset_before` and `reset_after` events while `textadept.reset()` is
+ being run.
+* Reload current lexer module after `textadept.reset()`.
+* Added `~/.textadept/modules/` to `package.path`.
+* Updated to [Scintilla][] 2.03.
+* Modified quit and close dialogs to be more readable.
+
+[Scintilla]: http://scintilla.org
+
+## 2.0 (01 Oct 2009)
+
+Bugfixes:
+
+* Fixed bug with reloading PM width from session file.
+* Only show a non-nil PM context menu.
+* Fixed bug in `modules/textadept/lsnippets.lua`.
+* Fixed bug in `core/ext/mime_types.lua` caused during `textadept.reset()`.
+* Close all buffers before loading a session.
+* Identify `shellscript` files correctly.
+* D lexer no longer has key-command conflicts.
+
+Changes:
+
+* Refactored `modules/textadept/lsnippets.lua`.
+* Updated key commands.
+* Allow PM modules in the `~/.textadept` user directory.
+* Added `style_whitespace` to [lexers][] for custom styles.
+* Added standard `F3` key command for "Find Next" for Windows/Linux.
+
+[lexers]: api/lexer.html
+
+## 2.0 beta (31 Jul 2009)
+
+Bugfixes:
+
+* Alphabetize lexer list.
+* Fixed some locale issues.
+* Fixed some small memory leaks.
+* Try a [list of encodings][] rather than just UTF-8 so "conversion failed" does
+ not happen so often.
+* Restore a manually set lexer.
+
+Changes:
+
+* Removed `_m.textadept.macros` module and respective PM browser (use Lua
+ instead).
+* Linux version can be installed and run from anywhere; no need to recompile
+ anymore.
+* Added many more [events][] to hook into lots of core functionality.
+* Updated to [Scintilla][] 1.79.
+* Run module allows more flexible [compile commands][] and [run commands][].
+* Save project manager cursor over sessions.
+* Allow mime-types and compile and run commands to be user-redefinable in user
+ scripts.
+* Use `~/.textadept/` for holding user lexers, themes, sessions, etc.
+* Added "Help" menu linking to Manual and LuaDoc.
+* Textadept compiles as C99 code. (Drops Microsoft Visual Studio support.)
+* Sessions functionality moved to `modules/textadept/session.lua` from
+ `core/file_io.lua`.
+* The `char_added` event now passes an int, not a string, to handler functions.
+* Replaced [cocoaDialog][] and [lua_dialog][] with my C-based [gcocoadialog][].
+* [Incremental find][] via the Lua command entry.
+* *NO* dependencies other than [GTK][] on _all_ platforms.
+
+ + Win32 no longer requires the MSVC++ 2008 Runtime.
+ + Linux no longer requires `libffi`.
+ + Mac OSX no longer requires [cocoaDialog][].
+
+* Can cross compile to Win32 from Linux.
+* Removed confusing `local function` and `local table` LuaDoc.
+* Rewrote the manual and most of the documentation.
+
+[list of encodings]: api/io.html#try_encodings
+[events]: api/events.html
+[Scintilla]: http://scintilla.org
+[compile commands]: api/_M.textadept.run.html#compile_command
+[run commands]: api/_M.textadept.run.html#run_command
+[gcocoadialog]: http://foicica.com/gcocoadialog
+[lua_dialog]: http://luaforge.net/projects/lua-dialog
+[cocoaDialog]: http://cocoadialog.sf.net
+[Incremental find]: manual/6_AdeptEditing.html#Find.Incremental
+[GTK]: http://gtk.org
+
+## 1.6 (01 Apr 2009)
+
+Bugfixes:
+
+* Fixed `NULL` byte bug associated with Lua interface due to multi-encoding
+ support.
+* Find marker is colored consistently.
+* Fixed issue with buffer browser cursor saving.
+* Fixed block character insertion issue on GTK-OSX.
+
+Updates:
+
+* Trimmed theme files.
+* Added `file_before_save` [event][].
+
+[event]: api/io.html#File.Events
+
+## 1.6 beta (01 Mar 2009)
+
+Bugfixes:
+
+* Fixed bookmarks bugs.
+* PM browsers are not re-added to the list again on `textadept.reset()`.
+* Fixed ctags PM browser bug with filenames.
+* Marker colors are set for all views now.
+* Fixed never-ending "reload modified file?" dialog bug.
+* Fixed key command for `m_snippets.list`.
+* Fixed issues with [`_m.textadept.run`][] module.
+* Fixed document modification status bug for unfocused split views.
+* Fixed filename encoding issues for Windows.
+
+Updates:
+
+* Added key commands and menu items to navigate "Find in Files" list.
+* The `recent_files` popup list behaves better.
+* Attempt to preserve existing EOL mode for opened files.
+* Add drag-and-dropped directories to the PM browser list.
+* Removed `project` PM browser.
+* Multiple character encoding support for opening and saving files.
+
+[`_m.textadept.run`]: api/_M.textadept.run.html
+
+## 1.5 (20 Feb 2009)
+
+Bugfixes:
+
+* Fixed some corner cases in Find in Files user interface.
+* Fixed some OSX key command issues for consistency.
+* Fixed some key command modifiers for "enclose in" series.
+
+Updates:
+
+* Consolidated `core/ext/key_commands_{std,mac}.lua` into single
+ `core/ext/key_commands.lua`.
+* Can use the `Tab` and `Shift+Tab` keys for snippets now.
+* Removed support for Textmate-style snippets in favor of Lua-style snippets.
+* Load drag-and-dropped directories into file browser.
+* Can toggle showing "dot" files in file browser.
+* Prompt for file reload when files are modified outside Textadept.
+* Added `textadept.context_menu` field for right-click inside Scintilla.
+* Project Manager cursors are saved and restored.
+* Only use escape sequences in Lua pattern searches.
+* Rewrote `modules/textadept/run.lua` to be easier to use and configure.
+* Find in Files marks the selected line for easier reference.
+* Save special buffers in session file (e.g. error buffer, message buffer, etc.)
+* Moved mime-types into `core/ext/mime_types.conf` configuration file.
+* Moved localization into `core/locale.conf` configuration file.
+
+## 1.4 (10 Feb 2009)
+
+Bugfixes:
+
+* Handle empty clipboard properly.
+* Fixed some widget focus issues.
+* Fixed a couple Find in Files bugs.
+* Workaround for GTK-OSX pasting issue.
+
+Updates:
+
+* Added menu options for changing line endings.
+* The Project Manager Entry responds better.
+* Improved Lua State integrity for critical data.
+* Keep only 10 items in Find/Replace history.
+* Special buffers are not "Untitled" anymore.
+* Moved `textadept.locale` table to `_G`.
+
+## 1.3 (30 Jan 2009)
+
+Bugfixes:
+
+* Binary files are opened and handled properly.
+* Drag-and-dropped files are now opened in the correct split view they were
+ dropped in.
+* Fixed some various GTK-OSX UI issues.
+* Fixed a special case of "Replace All".
+* Clicking "Ok" closes any error dialogs on init.
+* Fixed statusbar glitch when creating new buffers.
+* Windows' CR+LF line endings are handled properly.
+* Do not go to non-existent buffer index when loading session.
+* Do not attempt to open non-existent files when double-clicking error messages.
+
+Updates:
+
+* Look for `~/.ta_theme` for setting Textadept `_THEME`.
+* `_THEME` can now be a directory path.
+* Themes now contain their own `lexer.lua` for defining lexer colors.
+* Added "Find in Files" support.
+* Can set the Project Manager cursor through Lua.
+* Look for `~/.ta_modules` to load instead of default modules in `init.lua`.
+* Added "Replace All" for just selected text.
+* Removed menu label text in favor of using menu id numbers for menu actions.
+* Added Find/Replace history.
+* Use a combo entry for the Project Manager browser entry.
+* Print messages to a split view instead of switching buffers.
+
+## 1.2 (21 Jan 2009)
+
+Bugfixes:
+
+* None.
+
+Updates:
+
+* Windows command line support ("Open With Textadept" works too).
+* New [`_m.textadept.run`][] module for compiling and running programs. Output
+ is displayed in a message buffer and you can double-click errors and warnings
+ to go to them in the source file.
+
+[`_m.textadept.run`]: api/_M.textadept.run.html
+
+## 1.1 (11 Jan 2009)
+
+Bugfixes:
+
+* Fixed `core/ext/key_commands_std.lua` key conflict (`Ctrl+V`).
+
+Updates:
+
+* Dramatic speed increase in lexing for large, single-language files.
+* Added [localization][] support.
+* Added [bookmarks][] support.
+* All `require` statements have been moved to `init.lua` for easy module
+ configuration.
+* Various improvements to efficiency, speed, and readability of source code.
+* Manually parse `~/.gtkrc-2.0` on Mac since GTK-OSX does not do it.
+
+[localization]: api/_L.html
+[bookmarks]: api/_M.textadept.bookmarks.html
+
+## 1.0 (01 Jan 2009)
+
+Bugfixes:
+
+* Fixed bug with placeholders in Lua-style snippets.
+* Fixed view grow/shrink error thrown when the view is not split.
+* Various fixes to recognize windows directory separators.
+* Fixed some Find bugs.
+* Fixed macro recording and playback bugs.
+
+Updates:
+
+* Added actions for all menu items.
+* Added Lua interface functions and fields for the [find][] box.
+* Nearly full Mac OSX support with [GTK-OSX][].
+* Compile [LPeg][] and [LuaFileSystem][] libraries into Textadept by default.
+* Use UTF-8 encoding by default.
+* Added `light` color theme used by default.
+* New Textadept icons.
+* Added a true project manager.
+
+[find]: api/gui.find.html
+[GTK-OSX]: http://www.gtk.org/download/macos.php
+[LPeg]: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
+[LuaFileSystem]: http://keplerproject.github.com/luafilesystem/
+
+## 0.6 (03 Oct 2008)
+
+Bugfixes:
+
+* Gracefully exit when `core/init.lua` fails to load.
+
+Updates:
+
+* Windows support! (finally)
+* [Theming][] support (SciTE theme used by default).
+* Added `textadept.size` field and save it in session files.
+* Some C++ API-simplifying changes.
+* Drag-and-drop files into Textadept works as expected.
+* Revised [manual][].
+* Buffer and View properties are no longer set in C++, but in Lua through
+ "buffer_new" and "view_new" event handlers respectively.
+* File types can be recognized by [pattern matching][] the first line.
+
+[Theming]: manual/8_Themes.html
+[manual]: manual
+[pattern matching]: manual/9_Preferences.html#Detect.by.Pattern
+
+## 0.5 (23 Jul 2008)
+
+Bugfixes:
+
+* Fixed bug in Lua module when there is no matching file to go to.
+
+Updates:
+
+* Added user-friendly key commands and menus.
+* Added 43 more lexers.
+* Moved block-comment commands from language modules to `textadept.editing`
+ module.
+* Updated some Luadoc.
+
+## 0.4 (25 Jun 2008)
+
+Bugfixes:
+
+* Fixed bug with "%" being contained in text to replace.
+* Fixed compile warnings.
+* Fixed bug for menu actions on non-focused buffer.
+
+Updates:
+
+* Added [bookmark][] support through `modules/textadept/bookmarks.lua` (not
+ loaded by default).
+* Added icons to Textadept.
+* Added a modules browser for adding, deleting, and editing modules easily.
+* Consolidated source files into `textadept.c`, `textadept.h`, and
+ `lua_interface.c`.
+* Always load project manager settings from session file if available.
+* Include `liblua5.1.a` for compiling Lua into Textadept.
+* Added true [tab-completion][] to Lua command entry.
+* Added Doxygen documentation for C source files.
+* Updated Luadoc, and added Textadept manual.
+
+[bookmark]: api/_M.textadept.bookmarks.html
+[tab-completion]: manual/10_Advanced.html#Tab.Completion
+
+## 0.3 (04 Mar 2008)
+
+Bugfixes:
+
+* Fixed bug in editing module's [`select_indented_block()`][].
+* Fixed empty `buffer.filename` bug in `textadept.io.save_as()`.
+* Fixed setting of Ruby lexer after detecting filetype.
+
+Updates:
+
+* Makefile builds Textadept to optimize for small size.
+* Lua is no longer an external dependency and built into Textadept.
+* [Zenity][] is no longer a dependency on Linux. [lua_dialog][] is used instead.
+* Resources from `io.popen()` are handled more appropriately.
+* Added `textadept.reset()` function for for reloading Lua scripts.
+* Added new find in files project manager browser.
+* Fixed some code redundancy and typos in documentation.
+
+[`select_indented_block()`]: api/_M.textadept.editing.html#select_indented_block
+[Zenity]: http://live.gnome.org/Zenity
+[lua_dialog]: http://luaforge.net/projects/lua-dialog
+
+## 0.2 (20 Dec 2007)
+
+Bugfixes:
+
+* Fixed command line parameters bug.
+* Fixed `package.path` precedence bug.
+* Use 8 style bits by default.
+
+Updates:
+
+* Scintilla-st.
+* Lexers.
+* Improved support for embedded language-specific snippets.
+
+## 0.1 (01 Dec 2007)
+
+Initial Release
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..6bc94601
--- /dev/null
+++ b/README.md
@@ -0,0 +1,51 @@
+# Textadept
+
+## Overview
+
+Textadept is a fast, minimalist, and ridiculously extensible cross-platform text
+editor for programmers. Written in a combination of C and [Lua][] and
+relentlessly optimized for speed and minimalism over the years, Textadept is an
+ideal editor for programmers who want endless extensibility options without
+sacrificing speed or succumbing to code bloat and featuritis.
+
+[Lua]: http://lua.org
+
+## Features
+
+* Self-contained executable -- no installation necessary.
+* Entirely keyboard driven.
+* Unlimited split views.
+* Support for over 80 programming languages.
+* Powerful snippets and key commands.
+* Code autocompletion and API lookup.
+* Unparalleled extensibility.
+
+## Requirements
+
+In its bid for minimalism, Textadept has no dependencies on Windows and Mac OSX
+operating systems and depends only on [GTK+ 2.0][] version 2.16 or greater on
+Linux. Lua is pre-compiled into Textadept on all platforms and a GTK runtime is
+included on Windows and Mac OSX.
+
+[GTK+ 2.0]: http://gtk.org
+
+## Download
+
+Download Textadept from the [project page][].
+
+[project page]: http://foicica.com/textadept
+
+## Installation and Usage
+
+Textadept comes with a comprehensive manual and API documentation in the `doc/`
+directory. They are also available [online][].
+
+[online]: http://foicica.com/textadept
+
+## Contact
+
+Contact me by email: mitchell.at.foicica.com.
+
+There is also a [mailing list][].
+
+[mailing list]: http://foicica.com/lists
diff --git a/THANKS.md b/THANKS.md
new file mode 100644
index 00000000..28a971ac
--- /dev/null
+++ b/THANKS.md
@@ -0,0 +1,30 @@
+# Thanks
+
+Thank you everyone for your contributions and feedback. They have helped make
+Textadept the amazing editor that it is today.
+
+## Code and Documentation Contributors
+
+* Alex Bepple
+* Anton Verbitski
+* Brian Schott
+* Callum Wilson
+* Jay Gould
+* Jeff Stone
+* M Rawash
+* Martin Morawetz
+* Neil Hodgson
+* Nils Nordman
+* Patrick McMorris
+* Robert Gieseke
+* Russell Dickinson
+* Ryan Pusztai
+* Scott Weisman
+* Steve Donovan
+* Tymur Gubayev
+* Vais Salikhov
+* Vladimir Lomov
+
+If I have left off your name, please [contact me][]. I am very sorry about that.
+
+[contact me]: README.html#Contact
diff --git a/core/._M.luadoc b/core/._M.luadoc
index 04d2e938..bf9ed787 100644
--- a/core/._M.luadoc
+++ b/core/._M.luadoc
@@ -13,52 +13,64 @@ module('_M')]]
-- Note that while language-specific modules can only be used by files of that
-- language, they persist in Textadept's Lua state. Because of this, it is not
-- recommended to set global functions or variables and depend on them, as they
--- may be inadvertantly overwritten. Keep these inside the module.
+-- may be inadvertantly overwritten. Keep them inside the module.
--
-- ## Structure
--
-- Each module should have an `init.lua` that `require`s all submodules it
-- needs. For an example, see `modules/textadept/init.lua`.
--
--- ## Recommended Features for Language-Specific Modules
+-- ## Language-Specific Modules
--
--- #### Snippets
+-- The following is a list of recommended features for Language-Specific
+-- modules. They are all entirely optional.
--
--- [Snippets](../modules/_M.textadept.snippets.html) for common code constructs.
+-- ### Snippets
--
--- #### Commands
+-- [Snippets][] for common code constructs.
--
--- ##### Run
+-- [Snippets]: _M.textadept.snippets.html
+--
+-- ### Commands
+--
+-- #### Run
--
-- If the code can be run by an interpreter or other executable, create a [run
--- command](../modules/_M.textadept.run.html#run_command) for it as well as an
--- [error format](../modules/_M.textadept.run.html#error_detail) for the ability
--- to jump to the position in a file where the error occured.
+-- command][] for it as well as an [error format][] for the ability to jump to
+-- the position in a file where the error occured.
--
-- For example:
--
-- _M.textadept.run.run_command.lua = 'lua %(filename)'
--
--- ##### Compile
+-- [run command]: _M.textadept.run.html#run_command
+-- [error format]: _M.textadept.run.html#error_detail
+--
+-- #### Compile
--
--- If the code can be compiled by an executable, create a [compile
--- command](../modules/_M.textadept.run.html#compile_command) for it.
+-- If the code can be compiled by an executable, create a [compile command][]
+-- for it.
--
-- For example:
--
-- _M.textadept.run.compile_command.lua = 'luac %(filename)'
--
--- ##### Block Comment
+-- [compile command]: _M.textadept.run.html#compile_command
+--
+-- #### Block Comment
+--
+-- Create a [comment prefix][] for it so code can be easily commented and
+-- uncommented.
--
--- Create a [comment
--- prefix](../modules/_M.textadept.editing.html#comment_string) for it so code
--- can be easily commented and uncommented.
+-- [comment prefix]: _M.textadept.editing.html#comment_string
--
-- For example:
--
-- _M.textadept.editing.comment_string.lua = '--'
--
--- #### Buffer Properties
+-- [comment prefix]: _M.textadept.editing.html#comment_string
+--
+-- ### Buffer Properties
--
-- Add a `set_buffer_properties` function with default buffer properties for
-- code like tab and indentation settings.
@@ -72,7 +84,7 @@ module('_M')]]
-- buffer.indent = 2
-- end
--
--- #### Context Menu (Optional)
+-- ### Context Menu
--
-- Language-specific context menus, accessible by right-clicking inside the
-- view, can be defined as:
@@ -84,16 +96,3 @@ module('_M')]]
-- }
--
-- See `modules/textadept/menu.lua` for examples on how to define menus.
---
--- ## Modules and Key Commands
---
--- When assigning [key commands](../modules/_M.textadept.keys.html) to module
--- functions, do not forget to do so AFTER the function has been defined.
--- Typically key commands are placed at the end of files, like `init.lua` in
--- the `textadept` module.
-
----
--- This module contains no functions.
--- @class function
--- @name no_functions
-local no_functions
diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc
index e2acea09..52be35cf 100644
--- a/core/.buffer.luadoc
+++ b/core/.buffer.luadoc
@@ -45,13 +45,12 @@ module('buffer')
-- looking up the style.
-- * `annotation_visible` [number]
-- The visibility of annotations.
--- * `_SCINTILLA.constants.ANNOTATION_HIDDEN` (0)
--- Annotations are not displayed.
--- * `_SCINTILLA.constants.ANNOTATION_STANDARD` (1)
--- Annotations are drawn left justified with no adornment.
--- * `_SCINTILLA.constants.ANNOTATION_BOXED` (2)
--- Annotations are indented to match the text and are surrounded by a
--- box.
+-- * `_SCINTILLA.constants.ANNOTATION_HIDDEN` (0)
+-- Annotations are not displayed.
+-- * `_SCINTILLA.constants.ANNOTATION_STANDARD` (1)
+-- Annotations are drawn left justified with no adornment.
+-- * `_SCINTILLA.constants.ANNOTATION_BOXED` (2)
+-- Annotations are indented to match the text and are surrounded by a box.
-- * `auto_c_auto_hide` [bool]
-- Whether or not autocompletion is hidden automatically when nothing matches.
-- By default, the list is cancelled if there are no viable matches (the user
@@ -131,26 +130,26 @@ module('buffer')
-- 500 milliseconds.
-- * `caret_sticky` [number]
-- The caret preferred x position changing when the user types.
--- * `_SCINTILLA.constants.SC_CARETSTICKY_OFF` (0)
--- All text changes (and all caret position changes) will remember the
--- caret's new horizontal position when moving to different lines.
--- This is the default.
--- * `_SCINTILLA.constants.SC_CARETSTICKY_ON` (1)
--- The only thing which will cause the editor to remember the horizontal
--- caret position is moving the caret with mouse or keyboard (left/right
--- arrow keys, home/end keys, etc).
--- * `_SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE` (2)
--- The caret acts like sticky off except under one special case; when
--- space or tab characters are inserted. (Including pasting
--- *only space/tabs* -- undo, redo, etc. do not exhibit this behavior.)
+-- * `_SCINTILLA.constants.SC_CARETSTICKY_OFF` (0)
+-- All text changes (and all caret position changes) will remember the
+-- caret's new horizontal position when moving to different lines.
+-- This is the default.
+-- * `_SCINTILLA.constants.SC_CARETSTICKY_ON` (1)
+-- The only thing which will cause the editor to remember the horizontal
+-- caret position is moving the caret with mouse or keyboard (left/right
+-- arrow keys, home/end keys, etc).
+-- * `_SCINTILLA.constants.SC_CARETSTICKY_WHITESPACE` (2)
+-- The caret acts like sticky off except under one special case; when
+-- space or tab characters are inserted. (Including pasting
+-- *only space/tabs* -- undo, redo, etc. do not exhibit this behavior.)
-- * `caret_style` [number]
-- The style of the caret to be drawn.
--- * `_SCINTILLA.constants.CARETSTYLE_INVISIBLE` (0)
--- Not draw the caret at all.
--- * `_SCINTILLA.constants.CARETSTYLE_LINE` (1)
--- A line caret. This is the default value.
--- * `_SCINTILLA.constants.CARETSTYLE_BLOCK` (2)
--- A block caret.
+-- * `_SCINTILLA.constants.CARETSTYLE_INVISIBLE` (0)
+-- Not draw the caret at all.
+-- * `_SCINTILLA.constants.CARETSTYLE_LINE` (1)
+-- A line caret. This is the default value.
+-- * `_SCINTILLA.constants.CARETSTYLE_BLOCK` (2)
+-- A block caret.
-- * `caret_width` [number]
-- The width of the insert mode caret in pixels.
-- Can be `0`, `1`, `2` or `3` pixels. The default width is 1 pixel. This
@@ -174,10 +173,10 @@ module('buffer')
-- When setting, the caret is not scrolled into view.
-- * `cursor` [number]
-- The cursor type.
--- * `_SCINTILLA.constants.SC_CURSORNORMAL` (-1)
--- The normal cursor is displayed.
--- * `_SCINTILLA.constants.SC_CURSORWAIT` (4)
--- The wait cursor is displayed when the mouse is over the view.
+-- * `_SCINTILLA.constants.SC_CURSORNORMAL` (-1)
+-- The normal cursor is displayed.
+-- * `_SCINTILLA.constants.SC_CURSORWAIT` (4)
+-- The wait cursor is displayed when the mouse is over the view.
-- * `direct_function` [number] (Read-only)
-- A pointer to a function that processes messages for this view.
-- * `direct_pointer` [number] (Read-only)
@@ -188,26 +187,26 @@ module('buffer')
-- last saved.
-- * `eol_mode` [number]
-- The current end of line mode.
--- * `_SCINTILLA.constants.SC_EOL_CRLF` (0)
--- `CRLF`.
--- * `_SCINTILLA.constants.SC_EOL_CR` (1)
--- `CR`.
--- * `_SCINTILLA.constants.SC_EOL_LF` (2)
--- `LF`.
+-- * `_SCINTILLA.constants.SC_EOL_CRLF` (0)
+-- `CRLF`.
+-- * `_SCINTILLA.constants.SC_EOL_CR` (1)
+-- `CR`.
+-- * `_SCINTILLA.constants.SC_EOL_LF` (2)
+-- `LF`.
-- * `edge_colour` [number]
-- The color used in edge indication in `0xBBGGRR` format.
-- * `edge_column` [number]
-- The column number which text should be kept within.
-- * `edge_mode` [number]
-- The edge highlight mode.
--- * `_SCINTILLA.constants.EDGE_NONE` (0)
--- Long lines are not marked. This is the default state.
--- * `_SCINTILLA.constants.EDGE_LINE` (1)
--- A vertical line is drawn at the column number set by
--- `buffer.edge_column`.
--- * `_SCINTILLA.constants.EDGE_BACKGROUND` (2)
--- The background color of characters after the column limit is changed
--- to the color set by `buffer.edge_colour`.
+-- * `_SCINTILLA.constants.EDGE_NONE` (0)
+-- Long lines are not marked. This is the default state.
+-- * `_SCINTILLA.constants.EDGE_LINE` (1)
+-- A vertical line is drawn at the column number set by
+-- `buffer.edge_column`.
+-- * `_SCINTILLA.constants.EDGE_BACKGROUND` (2)
+-- The background color of characters after the column limit is changed to
+-- the color set by `buffer.edge_colour`.
-- * `encoding` [string or nil]
-- The encoding of the file on the hard disk.
-- It will be `nil` if the file is a binary file.
@@ -228,8 +227,7 @@ module('buffer')
-- added to each line.
-- * `filename` [string]
-- The absolute path to the file associated with this buffer.
--- It is encoded in UTF-8. Use [`string.iconv()`][string_iconv] for charset
--- conversions.
+-- It is encoded in UTF-8. Use [`string.iconv()`][] for charset conversions.
-- * `first_visible_line` [number]
-- The display line at the top of the display.
-- * `focus` [bool]
@@ -240,21 +238,21 @@ module('buffer')
-- Table of fold levels for lines starting from zero.
-- Fold levels encodes an integer level along with flags indicating whether
-- the line is a header and whether it is effectively white space.
--- * `_SCINTILLA.constants.SC_FOLDLEVELBASE` (0x400)
--- Initial fold level.
--- * `_SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG` (0x1000)
--- Indicates that the line is blank.
--- * `_SCINTILLA.constants.SC_FOLDLEVELHEADERFLAG` (0x2000)
--- Indicates that the line is a header (fold point).
+-- * `_SCINTILLA.constants.SC_FOLDLEVELBASE` (0x400)
+-- Initial fold level.
+-- * `_SCINTILLA.constants.SC_FOLDLEVELWHITEFLAG` (0x1000)
+-- Indicates that the line is blank.
+-- * `_SCINTILLA.constants.SC_FOLDLEVELHEADERFLAG` (0x2000)
+-- Indicates that the line is a header (fold point).
-- * `fold_parent` [table] (Read-only)
-- Table of parent line numbers for child lines starting from zero.
-- `-1` means no line was found.
-- * `font_quality` [number] (Windows only)
-- The quality level for text.
--- * `_SCINTILLA.constants.SC_EFF_QUALITY_DEFAULt` (0).
--- * `_SCINTILLA.constants.SC_EFF_QUALITY_NON_ANTIALIASED` (1).
--- * `_SCINTILLA.constants.SC_EFF_QUALITY_ANTIALIASED` (2).
--- * `_SCINTILLA.constants.SC_EFF_QUALITY_LCD_OPTIMIZED` (3).
+-- * `_SCINTILLA.constants.SC_EFF_QUALITY_DEFAULt` (0).
+-- * `_SCINTILLA.constants.SC_EFF_QUALITY_NON_ANTIALIASED` (1).
+-- * `_SCINTILLA.constants.SC_EFF_QUALITY_ANTIALIASED` (2).
+-- * `_SCINTILLA.constants.SC_EFF_QUALITY_LCD_OPTIMIZED` (3).
-- * `h_scroll_bar` [bool]
-- Whether the horizontal scroll bar is visible.
-- Set to `false` to never see it and `true` to enable it again. The default
@@ -274,21 +272,21 @@ module('buffer')
-- Indentation guides appearance.
-- Indentation guides are dotted vertical lines that appear within indentation
-- white space every indent size columns.
--- * `_SCINTILLA.constants.SC_IV_NONE` (0)
--- No indentation guides are shown.
--- * `_SCINTILLA.constants.SC_IV_REAL` (1)
--- Indentation guides are shown inside real indentation white space.
--- * `_SCINTILLA.constants.SC_IV_LOOKFORWARD` (2)
--- Indentation guides are shown beyond the actual indentation up to the
--- level of the next non-empty line.
--- If the previous non-empty line was a fold header then indentation
--- guides are shown for one more level of indent than that line. This
--- setting is good for Python.
--- * `_SCINTILLA.constants.SC_IV_LOOKBOTH` (3)
--- Indentation guides are shown beyond the actual indentation up to the
--- level of the next non-empty line or previous non-empty line whichever
--- is the greater.
--- This setting is good for most languages.
+-- * `_SCINTILLA.constants.SC_IV_NONE` (0)
+-- No indentation guides are shown.
+-- * `_SCINTILLA.constants.SC_IV_REAL` (1)
+-- Indentation guides are shown inside real indentation white space.
+-- * `_SCINTILLA.constants.SC_IV_LOOKFORWARD` (2)
+-- Indentation guides are shown beyond the actual indentation up to the
+-- level of the next non-empty line.
+-- If the previous non-empty line was a fold header then indentation
+-- guides are shown for one more level of indent than that line. This
+-- setting is good for Python.
+-- * `_SCINTILLA.constants.SC_IV_LOOKBOTH` (3)
+-- Indentation guides are shown beyond the actual indentation up to the
+-- level of the next non-empty line or previous non-empty line whichever
+-- is the greater.
+-- This setting is good for most languages.
-- * `indic_alpha` [table]
-- Table of alpha transparency values ranging from `0` (transparent) to `255`
-- (opaque) or `256` (no alpha) for indicators from `0` to `31`.
@@ -304,48 +302,48 @@ module('buffer')
-- `INDIC_STRAIGHTBOX` rectangle.
-- * `indic_style` [table]
-- Table of styles for indicators from `0` to `31`.
--- * `_SCINTILLA.constants.INDIC_PLAIN` (0)
--- Underlined with a single, straight line.
--- * `_SCINTILLA.constants.INDIC_SQUIGGLE` (1)
--- A squiggly underline. Requires 3 pixels of descender space.
--- * `_SCINTILLA.constants.INDIC_TT` (2)
--- A line of small T shapes.
--- * `_SCINTILLA.constants.INDIC_DIAGONAL` (3)
--- Diagonal hatching.
--- * `_SCINTILLA.constants.INDIC_STRIKE` (4)
--- Strike out.
--- * `_SCINTILLA.constants.INDIC_HIDDEN` (5)
--- An indicator with no visual effect.
--- * `_SCINTILLA.constants.INDIC_BOX` (6)
--- A rectangle around the text.
--- * `_SCINTILLA.constants.INDIC_ROUNDBOX` (7)
--- A rectangle with rounded corners around the text using translucent
--- drawing with the interior usually more transparent than the border.
--- Use `buffer.indic_alpha` and `buffer.indic_outline_alpha` to control
--- the alpha transparency values. The default alpha values are `30` for
--- fill color and `50` for outline color.
--- * `_SCINTILLA.constants.INDIC_STRAIGHTBOX` (8)
--- A rectangle around the text using translucent drawing with the
--- interior usually more transparent than the border.
--- You can use `buffer.indic_alpha` and `buffer.indic_outline_alpha` to
--- control the alpha transparency values. The default alpha values are
--- `30` for fill color and `50` for outline color.
--- * `_SCINTILLA.constants.INDIC_DASH` (9)
--- A dashed underline.
--- * `_SCINTILLA.constants.INDIC_DOTS` (10)
--- A dotted underline.
--- * `_SCINTILLA.constants.INDIC_SQUIGGLELOW` (11)
--- Similar to `INDIC_SQUIGGLE` but only using 2 vertical pixels so will
--- fit under small fonts.
--- * `_SCINTILLA.constants.INDIC_DOTBOX` (12)
--- A dotted rectangle around the text using translucent drawing.
--- Translucency alternates between the alpha and outline alpha settings
--- with the top-left pixel using the alpha setting. `buffer.indic_alpha`
--- and `buffer.indic_outline_alpha` control the alpha transparency
--- values. The default values are `30` for alpha and `50` for outline
--- alpha. To avoid excessive memory allocation the maximum width of a
--- dotted box is 4000 pixels.
--- * Use `_SCINTILLA.next_indic_number()` for custom indicators.
+-- * `_SCINTILLA.constants.INDIC_PLAIN` (0)
+-- Underlined with a single, straight line.
+-- * `_SCINTILLA.constants.INDIC_SQUIGGLE` (1)
+-- A squiggly underline. Requires 3 pixels of descender space.
+-- * `_SCINTILLA.constants.INDIC_TT` (2)
+-- A line of small T shapes.
+-- * `_SCINTILLA.constants.INDIC_DIAGONAL` (3)
+-- Diagonal hatching.
+-- * `_SCINTILLA.constants.INDIC_STRIKE` (4)
+-- Strike out.
+-- * `_SCINTILLA.constants.INDIC_HIDDEN` (5)
+-- An indicator with no visual effect.
+-- * `_SCINTILLA.constants.INDIC_BOX` (6)
+-- A rectangle around the text.
+-- * `_SCINTILLA.constants.INDIC_ROUNDBOX` (7)
+-- A rectangle with rounded corners around the text using translucent
+-- drawing with the interior usually more transparent than the border. Use
+-- `buffer.indic_alpha` and `buffer.indic_outline_alpha` to control the
+-- alpha transparency values. The default alpha values are `30` for fill
+-- color and `50` for outline color.
+-- * `_SCINTILLA.constants.INDIC_STRAIGHTBOX` (8)
+-- A rectangle around the text using translucent drawing with the interior
+-- usually more transparent than the border.
+-- You can use `buffer.indic_alpha` and `buffer.indic_outline_alpha` to
+-- control the alpha transparency values. The default alpha values are
+-- `30` for fill color and `50` for outline color.
+-- * `_SCINTILLA.constants.INDIC_DASH` (9)
+-- A dashed underline.
+-- * `_SCINTILLA.constants.INDIC_DOTS` (10)
+-- A dotted underline.
+-- * `_SCINTILLA.constants.INDIC_SQUIGGLELOW` (11)
+-- Similar to `INDIC_SQUIGGLE` but only using 2 vertical pixels so will
+-- fit under small fonts.
+-- * `_SCINTILLA.constants.INDIC_DOTBOX` (12)
+-- A dotted rectangle around the text using translucent drawing.
+-- Translucency alternates between the alpha and outline alpha settings
+-- with the top-left pixel using the alpha setting. `buffer.indic_alpha`
+-- and `buffer.indic_outline_alpha` control the alpha transparency values.
+-- The default values are `30` for alpha and `50` for outline alpha. To
+-- avoid excessive memory allocation the maximum width of a dotted box is
+-- 4000 pixels.
+-- * Use `_SCINTILLA.next_indic_number()` for custom indicators.
-- * `indic_under` [table]
-- Table of booleans for drawing under text or over (default) for indicators
-- from `0` to `31`.
@@ -359,15 +357,15 @@ module('buffer')
-- Interpret keyboard input as Unicode.
-- * `layout_cache` [number]
-- The degree of caching of layout information.
--- * `_SCINTILLA.constants.SC_CACHE_NONE` (0)
--- No lines are cached.
--- * `_SCINTILLA.constants.SC_CACHE_CARET` (1)
--- The line containing the text caret.
--- This is the default.
--- * `_SCINTILLA.constants.SC_CACHE_PAGE` (2)
--- Visible lines plus the line containing the caret.
--- * `_SCINTILLA.constants.SC_CACHE_DOCUMENT` (3)
--- All lines in the document.
+-- * `_SCINTILLA.constants.SC_CACHE_NONE` (0)
+-- No lines are cached.
+-- * `_SCINTILLA.constants.SC_CACHE_CARET` (1)
+-- The line containing the text caret.
+-- This is the default.
+-- * `_SCINTILLA.constants.SC_CACHE_PAGE` (2)
+-- Visible lines plus the line containing the caret.
+-- * `_SCINTILLA.constants.SC_CACHE_DOCUMENT` (3)
+-- All lines in the document.
-- * `length` [number] (Read-only)
-- The number of bytes in the document.
-- * `lexer` [number]
@@ -404,10 +402,10 @@ module('buffer')
-- * `margin_cursor_n` [table]
-- Table of cursors shown for margins from zero to four.
-- A reversed arrow cursor is normally shown over all margins.
--- * `_SCINTILLA.constants.SC_CURSORARROW`
--- Normal arrow.
--- * `_SCINTILLA.constants.SC_CURSORREVERSEARROW`
--- Reversed arrow.
+-- * `_SCINTILLA.constants.SC_CURSORARROW`
+-- Normal arrow.
+-- * `_SCINTILLA.constants.SC_CURSORREVERSEARROW`
+-- Reversed arrow.
-- * `margin_left` [number]
-- The size in pixels of the left margin.
-- The default is to one pixel.
@@ -416,13 +414,13 @@ module('buffer')
-- A mask determines which markers are displayed in a margin.
-- * `margin_options` [number]
-- A bit mask of margin options.
--- * `_SCINTILLA.constants.SC_MARGINOPTION_NONE` (0)
--- None (default).
--- * `_SCINTILLA.constants.SC_MARGINOPTION_SUBLINESELECT` (1)
--- Controls how wrapped lines are selected when clicking on margin in
--- front of them.
--- If set, only sub line of wrapped line is selected, otherwise whole
--- wrapped line is selected.
+-- * `_SCINTILLA.constants.SC_MARGINOPTION_NONE` (0)
+-- None (default).
+-- * `_SCINTILLA.constants.SC_MARGINOPTION_SUBLINESELECT` (1)
+-- Controls how wrapped lines are selected when clicking on margin in
+-- front of them.
+-- If set, only sub line of wrapped line is selected, otherwise whole
+-- wrapped line is selected.
-- * `margin_right` [number]
-- The size in pixels of the right margin.
-- The default is to one pixel.
@@ -441,20 +439,20 @@ module('buffer')
-- the offset added before looking up the style.
-- * `margin_type_n` [table]
-- Table of margin types for margins from zero to four.
--- * `_SCINTILLA.constants.SC_MARGIN_SYMBOL` (0)
--- A symbol margin.
--- * `_SCINTILLA.constants.SC_MARGIN_NUMBER` (1)
--- A line number margin.
--- * `_SCINTILLA.constants.SC_MARGIN_BACK` (2)
--- A symbol margin that sets its background color to match the default
--- text background color.
--- * `_SCINTILLA.constants.SC_MARGIN_FORE` (3)
--- A symbol margin that sets its background color to match the default
--- text foreground color.
--- * `_SCINTILLA.constants.SC_MARGIN_TEXT` (4)
--- A text margin.
--- * `_SCINTILLA.constants.SC_MARGIN_RTEXT` (5)
--- A right justified text margin.
+-- * `_SCINTILLA.constants.SC_MARGIN_SYMBOL` (0)
+-- A symbol margin.
+-- * `_SCINTILLA.constants.SC_MARGIN_NUMBER` (1)
+-- A line number margin.
+-- * `_SCINTILLA.constants.SC_MARGIN_BACK` (2)
+-- A symbol margin that sets its background color to match the default
+-- text background color.
+-- * `_SCINTILLA.constants.SC_MARGIN_FORE` (3)
+-- A symbol margin that sets its background color to match the default
+-- text foreground color.
+-- * `_SCINTILLA.constants.SC_MARGIN_TEXT` (4)
+-- A text margin.
+-- * `_SCINTILLA.constants.SC_MARGIN_RTEXT` (5)
+-- A right justified text margin.
-- * `margin_width_n` [table]
-- Table of margin widths expressed in pixes for margins from zero to four.
-- * `max_line_state` [number] (Read-only)
@@ -469,10 +467,10 @@ module('buffer')
-- events are generated.
-- * `multi_paste` [bool]
-- The effect of pasting when there are multiple selections.
--- * `_SCINTILLA.constants.SC_MULTIPASTE_ONCE` (0)
--- Pasted text can go into just the main selection (default).
--- * `_SCINTILLA.constants.SC_MULTIPASTE_EACH` (1)
--- Pasted text can go into each selection.
+-- * `_SCINTILLA.constants.SC_MULTIPASTE_ONCE` (0)
+-- Pasted text can go into just the main selection (default).
+-- * `_SCINTILLA.constants.SC_MULTIPASTE_EACH` (1)
+-- Pasted text can go into each selection.
-- * `multiple_selection` [bool]
-- Whether multiple selections can be made.
-- When multiple selection is disabled, it is not possible to select multiple
@@ -485,33 +483,33 @@ module('buffer')
-- that their layout can be determined more quickly if the run recurs.
-- * `print_colour_mode` [number]
-- The print color mode.
--- * `_SCINTILLA.constants.SC_PRINT_NORMAL` (0)
--- Print using the current screen colors.
--- This is the default.
--- * `_SCINTILLA.constants.SC_PRINT_INVERTLIGHT` (1)
--- If you use a dark screen background this saves ink by inverting the
--- light value of all colors and printing on a white background.
--- * `_SCINTILLA.constants.SC_PRINT_BLACKONWHITE` (2)
--- Print all text as black on a white background.
--- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITE` (3)
--- Everything prints in its own color on a white background.
--- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG` (4)
--- Everything prints in its own color on a white background except that
--- line numbers use their own background color.
+-- * `_SCINTILLA.constants.SC_PRINT_NORMAL` (0)
+-- Print using the current screen colors.
+-- This is the default.
+-- * `_SCINTILLA.constants.SC_PRINT_INVERTLIGHT` (1)
+-- If you use a dark screen background this saves ink by inverting the
+-- light value of all colors and printing on a white background.
+-- * `_SCINTILLA.constants.SC_PRINT_BLACKONWHITE` (2)
+-- Print all text as black on a white background.
+-- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITE` (3)
+-- Everything prints in its own color on a white background.
+-- * `_SCINTILLA.constants.SC_PRINT_COLOURONWHITEDEFAULTBG` (4)
+-- Everything prints in its own color on a white background except that
+-- line numbers use their own background color.
-- * `print_magnification` [number]
-- The print magnification added to the point size of each style for printing.
-- * `print_wrap_mode` [number]
-- Printing line wrap mode.
--- * `_SCINTILLA.constants.SC_WRAP_NONE` (0)
--- Each line of text generates one line of output and the line is
--- truncated if it is too long to fit into the print area.
--- * `_SCINTILLA.constants.SC_WRAP_WORD` (1)
--- Wraps printed output so that all characters fit into the print
--- rectangle.
--- Tries to wrap only between words as indicated by white space or style
--- changes although if a word is longer than a line, it will be wrapped
--- before the line end. This is the default.
--- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2).
+-- * `_SCINTILLA.constants.SC_WRAP_NONE` (0)
+-- Each line of text generates one line of output and the line is
+-- truncated if it is too long to fit into the print area.
+-- * `_SCINTILLA.constants.SC_WRAP_WORD` (1)
+-- Wraps printed output so that all characters fit into the print
+-- rectangle.
+-- Tries to wrap only between words as indicated by white space or style
+-- changes although if a word is longer than a line, it will be wrapped
+-- before the line end. This is the default.
+-- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2).
-- * `property` [table] (Write-only)
-- Table of keyword:value string pairs used by a lexer for some optional
-- features.
@@ -531,12 +529,12 @@ module('buffer')
-- * `rectangular_selection_modifier` [number]
-- The modifier key used to indicate that a rectangular selection should be
-- created when combined with a mouse drag.
--- * `_SCINTILLA.constants.SCMOD_CTRL` (2)
--- Control key (default).
--- * `_SCINTILLA.constants.SCMOD_ALT` (4)
--- Alt key.
--- * `_SCINTILLA.constants.SCMOD_SUPER` (8)
--- Left Windows key on a Windows keyboard or the Command key on a Mac.
+-- * `_SCINTILLA.constants.SCMOD_CTRL` (2)
+-- Control key (default).
+-- * `_SCINTILLA.constants.SCMOD_ALT` (4)
+-- Alt key.
+-- * `_SCINTILLA.constants.SCMOD_SUPER` (8)
+-- Left Windows key on a Windows keyboard or the Command key on a Mac.
-- * `rgba_image_height` [number]
-- The height for future RGBA image data.
-- * `rgba_image_width` [number]
@@ -552,20 +550,20 @@ module('buffer')
-- Whether the maximum width line displayed is used to set scroll width.
-- * `search_flags` [number]
-- The search flags used by `buffer:search_in_target()`.
--- * `_SCINTILLA.constants.SCFIND_WHOLEWORD` (2)
--- A match only occurs with text that matches the case of the search
--- string.
--- * `_SCINTILLA.constants.SCFIND_MATCHCASE` (4)
--- A match only occurs if the characters before and after are not word
--- characters.
--- * `_SCINTILLA.constants.SCFIND_WORDSTART` (0x00100000)
--- A match only occurs if the character before is not a word character.
--- * `_SCINTILLA.constants.SCFIND_REGEXP` (0x00200000)
--- The search string should be interpreted as a regular expression.
--- * `_SCINTILLA.constants.SCFIND_POSIX` (0x00400000)
--- Treat regular expression in a more POSIX compatible manner by
--- interpreting bare `(` and `)` for tagged sections rather than `\(`
--- and `\)`.
+-- * `_SCINTILLA.constants.SCFIND_WHOLEWORD` (2)
+-- A match only occurs with text that matches the case of the search
+-- string.
+-- * `_SCINTILLA.constants.SCFIND_MATCHCASE` (4)
+-- A match only occurs if the characters before and after are not word
+-- characters.
+-- * `_SCINTILLA.constants.SCFIND_WORDSTART` (0x00100000)
+-- A match only occurs if the character before is not a word character.
+-- * `_SCINTILLA.constants.SCFIND_REGEXP` (0x00200000)
+-- The search string should be interpreted as a regular expression.
+-- * `_SCINTILLA.constants.SCFIND_POSIX` (0x00400000)
+-- Treat regular expression in a more POSIX compatible manner by
+-- interpreting bare `(` and `)` for tagged sections rather than `\(` and
+-- `\)`.
-- * `sel_alpha` [number]
-- The alpha of the selection, between `0` (transparent) and `255` (opaque),
-- or `256` for no alpha.
@@ -581,14 +579,14 @@ module('buffer')
-- The alternative is the more common stream selection.
-- * `selection_mode` [number]
-- The mode of the current selection.
--- * `_SCINTILLA.constants.SC_SEL_STREAM` (0)
--- Stream.
--- * `_SCINTILLA.constants.SC_SEL_RECTANGLE` (1)
--- Rectangle.
--- * `_SCINTILLA.constants.SC_SEL_LINES` (2)
--- Lines.
--- * `_SCINTILLA.constants.SC_SEL_THIN` (3)
--- Thin rectangular.
+-- * `_SCINTILLA.constants.SC_SEL_STREAM` (0)
+-- Stream.
+-- * `_SCINTILLA.constants.SC_SEL_RECTANGLE` (1)
+-- Rectangle.
+-- * `_SCINTILLA.constants.SC_SEL_LINES` (2)
+-- Lines.
+-- * `_SCINTILLA.constants.SC_SEL_THIN` (3)
+-- Thin rectangular.
-- * `selection_n_anchor` [table]
-- Table of anchor positions for existing selections starting from zero, the
-- main selection.
@@ -614,12 +612,12 @@ module('buffer')
-- The number of selections currently active.
-- * `status` [number]
-- The error status.
--- * `_SCINTILLA.constants.SC_STATUS_OK` (0)
--- No failures.
--- * `_SCINTILLA.constants.SC_STATUS_FAILURE` (1)
--- Generic failure.
--- * `_SCINTILLA.constants.SC_STATUS_BADALLOC` (2)
--- Memory is exhausted.
+-- * `_SCINTILLA.constants.SC_STATUS_OK` (0)
+-- No failures.
+-- * `_SCINTILLA.constants.SC_STATUS_FAILURE` (1)
+-- Generic failure.
+-- * `_SCINTILLA.constants.SC_STATUS_BADALLOC` (2)
+-- Memory is exhausted.
-- * `style_at` [table] (Read-only)
-- Table of style bytes at positions in the document starting at zero.
-- * `style_back` [table]
@@ -633,12 +631,12 @@ module('buffer')
-- Table of booleans for bold styles from `0` to `255`.
-- * `style_case` [table]
-- Table of cases for styles from `0` to `255`.
--- * `_SCINTILLA.constants.SC_CASE_MIXED` (0)
--- Normal, mixed case.
--- * `_SCINTILLA.constants.SC_CASE_UPPER` (1)
--- Upper case.
--- * `_SCINTILLA.constants.SC_CASE_LOWER` (2)
--- Lower case.
+-- * `_SCINTILLA.constants.SC_CASE_MIXED` (0)
+-- Normal, mixed case.
+-- * `_SCINTILLA.constants.SC_CASE_UPPER` (1)
+-- Upper case.
+-- * `_SCINTILLA.constants.SC_CASE_LOWER` (2)
+-- Lower case.
-- * `style_changeable` [table]
-- Table of booleans for changeable styles from `0` to `255`.
-- The default setting is `true`.
@@ -672,12 +670,12 @@ module('buffer')
-- with 1 being very light and 999 very heavy. While any value can be used,
-- fonts often only support between 2 and 4 weights with three weights being
-- common enough to use symbolic names:
--- * `_SCINTILLA.constants.SC_WEIGHT_NORMAL` (400)
--- Normal.
--- * `_SCINTILLA.constants.SC_WEIGHT_SEMIBOLD` (600)
--- Semi-bold.
--- * `_SCINTILLA.constants.SC_WEIGHT_BOLD` (700)
--- Bold.
+-- * `_SCINTILLA.constants.SC_WEIGHT_NORMAL` (400)
+-- Normal.
+-- * `_SCINTILLA.constants.SC_WEIGHT_SEMIBOLD` (600)
+-- Semi-bold.
+-- * `_SCINTILLA.constants.SC_WEIGHT_BOLD` (700)
+-- Bold.
-- * `tab_indents` [bool]
-- Whether a tab pressed when caret is within indentation indents.
-- * `tab_width` [number]
@@ -714,22 +712,22 @@ module('buffer')
-- Normally, the end of line characters are hidden.
-- * `view_ws` [number]
-- The visibility of white space characters.
--- * `_SCINTILLA.constants.SCWS_INVISIBLE` (0)
--- The normal display mode with white space displayed as an empty
--- background color.
--- * `_SCINTILLA.constants.SCWS_VISIBLEALWAYS` (1)
--- White space characters are drawn as dots and arrows.
--- * `_SCINTILLA.constants.SCWS_VISIBLEAFTERINDENT` (2)
--- White space used for indentation is displayed normally but after the
--- first visible character, it is shown as dots and arrows.
+-- * `_SCINTILLA.constants.SCWS_INVISIBLE` (0)
+-- The normal display mode with white space displayed as an empty
+-- background color.
+-- * `_SCINTILLA.constants.SCWS_VISIBLEALWAYS` (1)
+-- White space characters are drawn as dots and arrows.
+-- * `_SCINTILLA.constants.SCWS_VISIBLEAFTERINDENT` (2)
+-- White space used for indentation is displayed normally but after the
+-- first visible character, it is shown as dots and arrows.
-- * `virtual_space_options` [number]
-- Virtual space options.
--- * `_SCINTILLA.constants.SCVS_NONE` (0)
--- Disables all use of virtual space (default).
--- * `_SCINTILLA.constants.SCVS_RECTANGULARSELECTION` (1)
--- Enabled only for rectangular selections.
--- * `_SCINTILLA.constants.SCVS_USERACCESSIBLE` (2)
--- Enabled.
+-- * `_SCINTILLA.constants.SCVS_NONE` (0)
+-- Disables all use of virtual space (default).
+-- * `_SCINTILLA.constants.SCVS_RECTANGULARSELECTION` (1)
+-- Enabled only for rectangular selections.
+-- * `_SCINTILLA.constants.SCVS_USERACCESSIBLE` (2)
+-- Enabled.
-- * `whitespace_chars` [string] (Write-only)
-- The set of characters making up whitespace for when moving or selecting by
-- word.
@@ -737,45 +735,45 @@ module('buffer')
-- * `wrap_indent_mode` [number]
-- How wrapped sublines are placed.
-- Default is fixed.
--- * `_SCINTILLA.constants.SC_WRAP_INDENT_FIXED` (0)
--- Wrapped sublines aligned to left of window plus amount set by
--- `buffer.wrap_start_indent`.
--- * `_SCINTILLA.constants.SC_WRAP_INDENT_SAME` (1)
--- Wrapped sublines are aligned to first subline indent.
--- * `_SCINTILLA.constants.SC_WRAP_INDENT_INDENT` (2)
--- Wrapped sublines are aligned to first subline indent plus one more
--- level of indentation.
+-- * `_SCINTILLA.constants.SC_WRAP_INDENT_FIXED` (0)
+-- Wrapped sublines aligned to left of window plus amount set by
+-- `buffer.wrap_start_indent`.
+-- * `_SCINTILLA.constants.SC_WRAP_INDENT_SAME` (1)
+-- Wrapped sublines are aligned to first subline indent.
+-- * `_SCINTILLA.constants.SC_WRAP_INDENT_INDENT` (2)
+-- Wrapped sublines are aligned to first subline indent plus one more
+-- level of indentation.
-- * `whitespace_size` [number]
-- The size of the dots used to mark space characters.
-- * `word_chars` [string]
-- The set of characters making up words when moving or selecting by word.
-- * `wrap_mode` [number]
-- Text word wrap mode.
--- * `_SCINTILLA.constants.SC_WRAP_NONE` (0)
--- Disable line wrapping.
--- * `_SCINTILLA.constants.SC_WRAP_WORD` (1)
--- Enable wrapping on word boundaries.
--- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2)
--- Enable wrapping between any characters.
+-- * `_SCINTILLA.constants.SC_WRAP_NONE` (0)
+-- Disable line wrapping.
+-- * `_SCINTILLA.constants.SC_WRAP_WORD` (1)
+-- Enable wrapping on word boundaries.
+-- * `_SCINTILLA.constants.SC_WRAP_CHAR` (2)
+-- Enable wrapping between any characters.
-- * `wrap_start_indent` [number]
-- The start indent for wrapped lines.
-- * `wrap_visual_flags` [number]
-- The display mode of visual flags for wrapped lines.
--- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_NONE` (0)
--- No visual flags.
--- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_END` (1)
--- Visual flag at end of subline of a wrapped line.
--- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_START` (2)
--- Visual flag at begin of subline of a wrapped line.
--- Subline is indented by at least 1 to make room for the flag.
+-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_NONE` (0)
+-- No visual flags.
+-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_END` (1)
+-- Visual flag at end of subline of a wrapped line.
+-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAG_START` (2)
+-- Visual flag at begin of subline of a wrapped line.
+-- Subline is indented by at least 1 to make room for the flag.
-- * `wrap_visual_flags_location` [number]
-- The location of visual flags for wrapped lines.
--- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_DEFAULT` (0)
--- Visual flags drawn near border.
--- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_END_BY_TEXT` (1)
--- Visual flag at end of subline drawn near text.
--- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_START_BY_TEXT` (2)
--- Visual flag at beginning of subline drawn near text.
+-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_DEFAULT` (0)
+-- Visual flags drawn near border.
+-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_END_BY_TEXT` (1)
+-- Visual flag at end of subline drawn near text.
+-- * `_SCINTILLA.constants.SC_WRAPVISUALFLAGLOC_START_BY_TEXT` (2)
+-- Visual flag at beginning of subline drawn near text.
-- * `x_offset` [number]
-- The horizontal scroll position.
-- A value of `0` is the normal position with the first text column visible at
@@ -784,7 +782,7 @@ module('buffer')
-- The number of points added to the size of all fonts.
-- It may be positive to magnify or negative to reduce.
--
--- [string_iconv]: ../modules/string.html#iconv
+-- [`string.iconv()`]: string.html#iconv
---
-- Add a selection from anchor to caret as the main selection.
diff --git a/core/args.lua b/core/args.lua
index 0f383544..f0b0fcf2 100644
--- a/core/args.lua
+++ b/core/args.lua
@@ -10,8 +10,8 @@ module('args')]]
-- Markdown:
-- ## Arg Events
--
--- + `'arg_none'`: Called when no command line arguments are passed to Textadept
--- on init.
+-- + `'arg_none'`
+-- Called when no command line arguments are passed to Textadept on init.
local arg = arg
diff --git a/core/events.lua b/core/events.lua
index c939e0db..02a1dcc5 100644
--- a/core/events.lua
+++ b/core/events.lua
@@ -36,7 +36,7 @@ module('events')]]
--
-- * `APPLEEVENT_ODOC`
-- Called when Mac OSX tells Textadept to open a document.
--- * `uri`: The URI to open encoded in UTF-8.
+-- * `uri`: The URI to open encoded in UTF-8.
-- * `AUTO_C_CHAR_DELETED`
-- Called when the user deleted a character while the autocompletion list was
-- active.
@@ -45,10 +45,11 @@ module('events')]]
-- * `AUTO_C_SELECTION`
-- Called when the user has selected an item in an autocompletion list and
-- before the selection is inserted.
--- Automatic insertion can be cancelled by calling `buffer:auto_c_cancel()`
--- before returning from the event handler. Arguments:
--- * `text`: The text of the selection.
--- * `position`: The start position of the word being completed.
+-- Automatic insertion can be cancelled by calling
+-- [`buffer:auto_c_cancel()`][] before returning from the event handler.
+-- Arguments:
+-- * `text`: The text of the selection.
+-- * `position`: The start position of the word being completed.
-- * `BUFFER_AFTER_SWITCH`
-- Called right after a buffer is switched to.
-- * `BUFFER_BEFORE_SWITCH`
@@ -60,134 +61,134 @@ module('events')]]
-- * `CALL_TIP_CLICK`
-- Called when the user clicks on a calltip.
-- Arguments:
--- * `position`: Set to 1 if the click is in an up arrow, 2 if in a down
--- arrow, and 0 if elsewhere.
+-- * `position`: Set to 1 if the click is in an up arrow, 2 if in a down
+-- arrow, and 0 if elsewhere.
-- * `CHAR_ADDED`
-- Called when an ordinary text character is added to the buffer.
-- Arguments:
--- * `ch`: The text character byte.
+-- * `ch`: The text character byte.
-- * `COMMAND_ENTRY_COMMAND`
-- Called when a command is entered into the Command Entry.
-- Arguments:
--- * `command`: The command text.
+-- * `command`: The command text.
-- * `COMMAND_ENTRY_KEYPRESS`
-- Called when a key is pressed in the Command Entry.
-- Arguments:
--- * `code`: The key code.
--- * `shift`: The Shift key is held down.
--- * `ctrl`: The Control/Command key is held down.
--- * `alt`: The Alt/option key is held down.
--- * `meta`: The Control key on Mac OSX is held down.
+-- * `code`: The key code.
+-- * `shift`: The Shift key is held down.
+-- * `ctrl`: The Control/Command key is held down.
+-- * `alt`: The Alt/option key is held down.
+-- * `meta`: The Control key on Mac OSX is held down.
-- * `DOUBLE_CLICK`
-- Called when the mouse button is double-clicked.
-- Arguments:
--- * `position`: The text position of the double click.
--- * `line`: The line of the double click.
--- * `modifiers`: The key modifiers held down. It is a combination of zero
--- or more of `_SCINTILLA.constants.SCMOD_ALT`,
--- `_SCINTILLA.constants.SCMOD_CTRL`,
--- `_SCINTILLA.constants.SCMOD_SHIFT`, and
--- `_SCINTILLA.constants.SCMOD_META`.
--- Note: If you set `buffer.rectangular_selection_modifier` to
--- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
--- Ctrl and Alt due to a Scintilla limitation with GTK.
+-- * `position`: The text position of the double click.
+-- * `line`: The line of the double click.
+-- * `modifiers`: The key modifiers held down. It is a combination of zero
+-- or more of `_SCINTILLA.constants.SCMOD_ALT`,
+-- `_SCINTILLA.constants.SCMOD_CTRL`,
+-- `_SCINTILLA.constants.SCMOD_SHIFT`, and
+-- `_SCINTILLA.constants.SCMOD_META`.
+-- Note: If you set `buffer.rectangular_selection_modifier` to
+-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
+-- Ctrl and Alt due to a Scintilla limitation with GTK.
-- * `DWELL_END`
-- Called after a `DWELL_START` and the mouse is moved or other activity such
-- as key press indicates the dwell is over.
-- Arguments:
--- * `position`: The nearest position in the document to the position
--- where the mouse pointer was lingering.
--- * `x`: Where the pointer lingered.
--- * `y`: Where the pointer lingered.
+-- * `position`: The nearest position in the document to the position where
+-- the mouse pointer was lingering.
+-- * `x`: Where the pointer lingered.
+-- * `y`: Where the pointer lingered.
-- * `DWELL_START`
-- Called when the user keeps the mouse in one position for the dwell period
-- (see `_SCINTILLA.constants.SCI_SETMOUSEDWELLTIME`).
-- Arguments:
--- * `position`: The nearest position in the document to the position
--- where the mouse pointer was lingering.
--- * `x`: Where the pointer lingered.
--- * `y`: Where the pointer lingered.
+-- * `position`: The nearest position in the document to the position where
+-- the mouse pointer was lingering.
+-- * `x`: Where the pointer lingered.
+-- * `y`: Where the pointer lingered.
-- * `ERROR`
-- Called when an error occurs.
-- Arguments:
--- * `text`: The error text.
+-- * `text`: The error text.
-- * `FIND`
-- Called when finding text via the Find dialog box.
-- Arguments:
--- * `text`: The text to search for.
--- * `next`: Search forward.
+-- * `text`: The text to search for.
+-- * `next`: Search forward.
-- * `HOTSPOT_CLICK`
-- Called when the user clicks on text that is in a style with the hotspot
-- attribute set.
-- Arguments:
--- * `position`: The text position of the click.
--- * `modifiers`: The key modifiers held down. It is a combination of zero
--- or more of `_SCINTILLA.constants.SCMOD_ALT`,
--- `_SCINTILLA.constants.SCMOD_CTRL`,
--- `_SCINTILLA.constants.SCMOD_SHIFT`, and
--- `_SCINTILLA.constants.SCMOD_META`.
--- Note: If you set `buffer.rectangular_selection_modifier` to
--- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
--- Ctrl and Alt due to a Scintilla limitation with GTK.
+-- * `position`: The text position of the click.
+-- * `modifiers`: The key modifiers held down. It is a combination of zero
+-- or more of `_SCINTILLA.constants.SCMOD_ALT`,
+-- `_SCINTILLA.constants.SCMOD_CTRL`,
+-- `_SCINTILLA.constants.SCMOD_SHIFT`, and
+-- `_SCINTILLA.constants.SCMOD_META`.
+-- Note: If you set `buffer.rectangular_selection_modifier` to
+-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
+-- Ctrl and Alt due to a Scintilla limitation with GTK.
-- * `HOTSPOT_DOUBLE_CLICK`
-- Called when the user double clicks on text that is in a style with the
-- hotspot attribute set.
-- Arguments:
--- * `position`: The text position of the double click.
--- * `modifiers`: The key modifiers held down. It is a combination of zero
--- or more of `_SCINTILLA.constants.SCMOD_ALT`,
--- `_SCINTILLA.constants.SCMOD_CTRL`,
--- `_SCINTILLA.constants.SCMOD_SHIFT`, and
--- `_SCINTILLA.constants.SCMOD_META`.
--- Note: If you set `buffer.rectangular_selection_modifier` to
--- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
--- Ctrl and Alt due to a Scintilla limitation with GTK.
+-- * `position`: The text position of the double click.
+-- * `modifiers`: The key modifiers held down. It is a combination of zero
+-- or more of `_SCINTILLA.constants.SCMOD_ALT`,
+-- `_SCINTILLA.constants.SCMOD_CTRL`,
+-- `_SCINTILLA.constants.SCMOD_SHIFT`, and
+-- `_SCINTILLA.constants.SCMOD_META`.
+-- Note: If you set `buffer.rectangular_selection_modifier` to
+-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
+-- Ctrl and Alt due to a Scintilla limitation with GTK.
-- * `HOTSPOT_RELEASE_CLICK`
-- Called when the user releases the mouse on text that is in a style with the
-- hotspot attribute set.
-- Arguments:
--- * `position`: The text position of the release.
+-- * `position`: The text position of the release.
-- * `INDICATOR_CLICK`
-- Called when the user clicks the mouse on text that has an indicator.
-- Arguments:
--- * `position`: The text position of the click.
--- * `modifiers`: The key modifiers held down. It is a combination of zero
--- or more of `_SCINTILLA.constants.SCMOD_ALT`,
--- `_SCINTILLA.constants.SCMOD_CTRL`,
--- `_SCINTILLA.constants.SCMOD_SHIFT`, and
--- `_SCINTILLA.constants.SCMOD_META`.
--- Note: If you set `buffer.rectangular_selection_modifier` to
--- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
--- Ctrl and Alt due to a Scintilla limitation with GTK.
+-- * `position`: The text position of the click.
+-- * `modifiers`: The key modifiers held down. It is a combination of zero
+-- or more of `_SCINTILLA.constants.SCMOD_ALT`,
+-- `_SCINTILLA.constants.SCMOD_CTRL`,
+-- `_SCINTILLA.constants.SCMOD_SHIFT`, and
+-- `_SCINTILLA.constants.SCMOD_META`.
+-- Note: If you set `buffer.rectangular_selection_modifier` to
+-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
+-- Ctrl and Alt due to a Scintilla limitation with GTK.
-- * `INDICATOR_RELEASE`
-- Called when the user releases the mouse on text that has an indicator.
-- Arguments:
--- * `position`: The text position of the release.
+-- * `position`: The text position of the release.
-- * `KEYPRESS`
-- Called when a key is pressed.
-- Arguments:
--- * `code`: The key code.
--- * `shift`: The Shift key is held down.
--- * `ctrl`: The Control/Command key is held down.
--- * `alt`: The Alt/option key is held down.
--- * `meta`: The Control key on Mac OSX is held down.
+-- * `code`: The key code.
+-- * `shift`: The Shift key is held down.
+-- * `ctrl`: The Control/Command key is held down.
+-- * `alt`: The Alt/option key is held down.
+-- * `meta`: The Control key on Mac OSX is held down.
-- * `MARGIN_CLICK`
-- Called when the mouse is clicked inside a margin.
-- Arguments:
--- * `margin`: The margin number that was clicked.
--- * `position`: The position of the start of the line in the buffer that
--- corresponds to the margin click.
--- * `modifiers`: The appropriate combination of
--- `_SCINTILLA.constants.SCI_SHIFT`, `_SCINTILLA.constants.SCI_CTRL`,
--- and `_SCINTILLA.constants.SCI_ALT` to indicate the keys that were
--- held down at the time of the margin click.
--- Note: If you set `buffer.rectangular_selection_modifier` to
--- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
--- Ctrl and Alt due to a Scintilla limitation with GTK.
+-- * `margin`: The margin number that was clicked.
+-- * `position`: The position of the start of the line in the buffer that
+-- corresponds to the margin click.
+-- * `modifiers`: The appropriate combination of
+-- `_SCINTILLA.constants.SCI_SHIFT`, `_SCINTILLA.constants.SCI_CTRL`,
+-- and `_SCINTILLA.constants.SCI_ALT` to indicate the keys that were
+-- held down at the time of the margin click.
+-- Note: If you set `buffer.rectangular_selection_modifier` to
+-- `_SCINTILLA.constants.SCMOD_CTRL`, the Ctrl key is reported as *both*
+-- Ctrl and Alt due to a Scintilla limitation with GTK.
-- * `MENU_CLICKED`
-- Called when a menu item is selected.
-- Arguments:
--- * `menu_id`: The numeric ID of the menu item set in `gui.gtkmenu()`.
+-- * `menu_id`: The numeric ID of the menu item set in [`gui.gtkmenu()`][].
-- * `QUIT`
-- Called when quitting Textadept.
-- When connecting to this event, connect with an index of 1 or the handler
@@ -195,18 +196,18 @@ module('events')]]
-- * `REPLACE`
-- Called to replace selected (found) text.
-- Arguments:
--- * `text`: The text to replace selected text with.
+-- * `text`: The text to replace selected text with.
-- * `REPLACE_ALL`
-- Called to replace all occurances of found text.
-- Arguments:
--- * `find_text`: The text to search for.
--- * `repl_text`: The text to replace found text with.
+-- * `find_text`: The text to search for.
+-- * `repl_text`: The text to replace found text with.
-- * `RESET_AFTER`
-- Called after resetting the Lua state.
--- This is triggered by `reset()`.
+-- This is triggered by [`reset()`][].
-- * `RESET_BEFORE`
-- Called before resetting the Lua state.
--- This is triggered by `reset()`.
+-- This is triggered by [`reset()`][].
-- * `SAVE_POINT_LEFT`
-- Called when a save point is left.
-- * `SAVE_POINT_REACHED`
@@ -217,14 +218,14 @@ module('events')]]
-- * `URI_DROPPED`
-- Called when the user has dragged a URI such as a file name onto the view.
-- Arguments:
--- * `text`: The URI text encoded in UTF-8.
+-- * `text`: The URI text encoded in UTF-8.
-- * `USER_LIST_SELECTION`
-- Called when the user has selected an item in a user list.
-- Arguments:
--- * `list_type`: This is set to the list_type parameter from the
--- `buffer:user_list_show()` call that initiated the list.
--- * `text`: The text of the selection.
--- * `position`: The position the list was displayed at.
+-- * `list_type`: This is set to the list_type parameter from the
+-- [`buffer:user_list_show()`][] call that initiated the list.
+-- * `text`: The text of the selection.
+-- * `position`: The position the list was displayed at.
-- * `VIEW_NEW`
-- Called when a new view is created.
-- * `VIEW_BEFORE_SWITCH`
@@ -232,6 +233,11 @@ module('events')]]
-- * `VIEW_AFTER_SWITCH`
-- Called right after another view is switched to.
--
+-- [`buffer:auto_c_cancel()`]: buffer.html#buffer.auto_c_cancel
+-- [`gui.gtkmenu()`]: gui.html#gtkmenu
+-- [`reset()`]: _G.html#reset
+-- [`buffer:user_list_show()`]: buffer.html#buffer.user_list_show
+--
-- ## Example
--
-- The following Lua code generates and handles a custom `my_event` event:
diff --git a/core/file_io.lua b/core/file_io.lua
index 8ff6d5be..1d31f1e6 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -6,13 +6,14 @@
module('io')]]
-- Markdown:
--- ## Converting Filenames to and from UTF-8
+-- ## Working with UTF-8
--
-- If your filesystem does not use UTF-8 encoded filenames, conversions to and
--- from that encoding will be necessary. When opening and saving files through
--- dialogs, Textadept takes care of these conversions for you, but if you need
--- to do them manually, use [`string.iconv()`][string_iconv] along with
--- `_CHARSET`, your filesystem's detected encoding.
+-- from that encoding are necessary since all of Textadept's internal strings
+-- are UTF-8 encoded. When opening and saving files through dialogs, these
+-- conversions are performed autmatically, but if you need to do them manually,
+-- use [`string.iconv()`][] along with `_CHARSET`, your filesystem's detected
+-- encoding.
--
-- Example:
--
@@ -23,26 +24,26 @@ module('io')]]
-- f:close()
-- end)
--
--- [string_iconv]: ../modules/string.html#iconv
+-- [`string.iconv()`]: string.html#iconv
--
-- ## File Events
--
-- * `_G.events.FILE_OPENED`
-- Called when a file is opened in a new buffer.
-- Arguments:
--- * `filename`: The filename encoded in UTF-8.
+-- * `filename`: The filename encoded in UTF-8.
-- * `_G.events.FILE_BEFORE_SAVE`
-- Called right before a file is saved to disk.
-- Arguments:
--- * `filename`: The filename encoded in UTF-8.
+-- * `filename`: The filename encoded in UTF-8.
-- * `_G.events.FILE_AFTER_SAVE`
-- Called right after a file is saved to disk.
-- Arguments:
--- * `filename`: The filename encoded in UTF-8.
+-- * `filename`: The filename encoded in UTF-8.
-- * `_G.events.FILE_SAVED_AS`
-- Called when a file is saved under a different filename.
-- Arguments:
--- * `filename`: The filename encoded in UTF-8.
+-- * `filename`: The filename encoded in UTF-8.
-- Events.
local events, events_connect = events, events.connect
diff --git a/core/init.lua b/core/init.lua
index 056a212b..8f7fd360 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -30,23 +30,24 @@ module('_G')]]
-- * `_HOME` [string]
-- Path to the directory containing Textadept.
-- * `_LEXERPATH` [string]
--- Paths to lexers, formatted like [`package.path`][package_path].
+-- Paths to lexers, formatted like [`package.path`][].
-- * `_RELEASE` [string]
-- The Textadept release version.
-- * `_USERHOME` [string]
-- Path to the user's `~/.textadept/`.
-- * `_CHARSET` [string]
-- The character set encoding of the filesystem.
--- This is used in [File I/O](../modules/io.html).
+-- This is used in [File I/O][].
-- * `RESETTING` [bool]
--- If [`reset()`](../modules/_G.html#reset) has been called, this flag is
--- `true` while the Lua state is being re-initialized.
+-- If [`reset()`](#reset) has been called, this flag is `true` while the Lua
+-- state is being re-initialized.
-- * `WIN32` [bool]
-- If Textadept is running on Windows, this flag is `true`.
-- * `OSX` [bool]
-- If Textadept is running on Mac OSX, this flag is `true`.
--
--- [package_path]: http://www.lua.org/manual/5.1/manual.html#pdf-package.path
+-- [`package.path`]: http://www.lua.org/manual/5.2/manual.html#pdf-package.path
+-- [File I/O]: io.html
---
-- Calls `dofile()` on the given filename in the user's Textadept directory.
diff --git a/core/keys.lua b/core/keys.lua
index 90d677ab..6418b612 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -34,17 +34,20 @@ module('keys')]]
-- ADD = '+'
-- -- pressing control, alt, shift, and 'a' yields: 'Ctrl+Alt+Shift+A'
--
--- For key values less than 255, Lua's [`string.char()`][string_char] is used to
--- determine the key's string representation. Otherwise, the
--- [`KEYSYMS`](../modules/_M.textadept.keys.html#KEYSYMS) lookup table is used.
+-- For key values less than 255, Lua's [`string.char()`][] is used to determine
+-- the key's string representation. Otherwise, the [`KEYSYMS`](#KEYSYMS) lookup
+-- table is used.
--
--- [string_char]: http://www.lua.org/manual/5.1/manual.html#pdf-string.char
+-- [`string.char()`]: http://www.lua.org/manual/5.2/manual.html#pdf-string.char
--
-- Normally, Lua functions are assigned to key commands, but those functions are
-- called without any arguments. In order to pass arguments to a function,
-- assign a table to the key command. This table contains the function followed
--- by its arguments in order. Any [buffer](../modules/buffer.html) or
--- [view](../modules/view.html) references are handled correctly at runtime.
+-- by its arguments in order. Any [buffer][] or [view][] references are handled
+-- correctly at runtime.
+--
+-- [buffer]: buffer.html
+-- [view]: view.html
--
-- Key commands can be chained like in Emacs using keychain sequences. By
-- default, the `Esc` key (`Apple+Esc` on Mac OSX) cancels the current keychain,
@@ -77,12 +80,12 @@ module('keys')]]
-- modules.
-- The default value is Ctrl/Cmd+L.
--
--- ## Key Command Precedence
+-- ## Precedence
--
-- When searching for a key command to execute in the `keys` table, key commands
-- in the current lexer have priority, followed by the ones in the global table.
--
--- #### Propagation
+-- ### Propagation
--
-- Normally when the same key command is assigned to two separate functions of
-- different precedence, the higher priority key command is run and the lower
diff --git a/core/locale.lua b/core/locale.lua
index 5448cdc4..a89685ed 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -8,7 +8,7 @@ local M = {}
module('_L')]]
-- Markdown:
--- # Settings
+-- ## Settings
--
-- * `_NIL` [string]
-- String returned when no localization for a given message exists.
@@ -26,10 +26,4 @@ for line in f:lines() do
end
f:close()
----
--- This table contains no functions.
--- @class function
--- @name no_functions
-local no_functions
-
return setmetatable(M, { __index = function() return M._NIL end })
diff --git a/doc/manual/10_Advanced.md b/doc/manual/10_Advanced.md
index db5cc5a3..d81687aa 100644
--- a/doc/manual/10_Advanced.md
+++ b/doc/manual/10_Advanced.md
@@ -6,16 +6,18 @@ Access to the Lua state is available through the command entry. Press `Ctrl+E`
(`⌘E` on Mac OSX) to access it. It is useful for debugging, inspecting, and
entering buffer or view commands. If you try to cause instability in Textadept's
Lua state, you might very well succeed so be careful. For more information, see
-the [scripting](11_Scripting.html) page.
+the [scripting][] page.
Abbreviated commands for the `buffer`, `view` and `gui` are available. So
`buffer:append_text('foo')` can be shortened to `append_text('foo')`. `print()`
-redirects to [`gui.print()`](../modules/gui.html#print). Use `_G.print()` for
-Lua's `print()`.
+redirects to [`gui.print()`][]. Use `_G.print()` for Lua's `print()`.

-#### Tab Completion
+[scripting]: 11_Scripting.html
+[`gui.print()`]: ../api/gui.html#print
+
+### Tab Completion
Tab-completion for functions, variables, tables, etc. is available. Press the
`Tab` (`⇥`) key to display a list of available completions. Use the arrow keys
@@ -23,21 +25,24 @@ to make a selection and press `Enter` (`↩`) to insert it.

-#### Extending
+### Extending
You can extend the command entry to do more than enter Lua commands. An
-example of this is [incremental
-search](../modules/gui.find.html#find_incremental). See
-`modules/textadept/find.lua` for the implementation.
+example of this is [incremental search][]. See `modules/textadept/find.lua` for
+the implementation.
+
+[incremental search]: ../api/gui.find.html#find_incremental
## Command Selection
-If you did not disable the menu in your [preferences](9_Preferences.html), then
-pressing `Ctrl+Shift+E` (`⌘⇧E` on Mac OSX) brings up the command selection
-dialog. Typing part of any command filters the list with spaces being wildcards.
-This is an easy way to run commands without navigating the menus, using the
-mouse, or remembering key commands. It is also useful for looking up particular
-key commands quickly.
+If you did not disable the menu in your [preferences][], then pressing
+`Ctrl+Shift+E` (`⌘⇧E` on Mac OSX) brings up the command selection dialog. Typing
+part of any command filters the list with spaces being wildcards. This is an
+easy way to run commands without navigating the menus, using the mouse, or
+remembering key commands. It is also useful for looking up particular key
+commands quickly.
+
+[preferences]: 9_Preferences.html#User.Init
## Shell Commands and Filtering Text
@@ -69,10 +74,11 @@ not notice any difference for working with files containing ASCII text since
UTF-8 is compatible with it. Textadept can also detect ISO-8859-1 and MacRoman,
the primary encodings used on Windows and Mac OSX respectively. Files with more
exotic encodings may not be detected properly, if at all. You can change the
-list of encodings Textadept tries to detect via
-[`io.try_encodings`](../modules/io.html#try_encodings).
+list of encodings Textadept tries to detect via [`io.try_encodings`][].
It is recommended to use UTF-8 encoded files because UTF-8 is very well
supported by other text editors and operating systems. You can change the file's
encoding via the `Buffer -> Encoding` menu. Textadept saves new files as UTF-8
by default.
+
+[`io.try_encodings`]: ../api/io.html#try_encodings
diff --git a/doc/manual/11_Scripting.md b/doc/manual/11_Scripting.md
index 6fbf2cba..463d01bc 100644
--- a/doc/manual/11_Scripting.md
+++ b/doc/manual/11_Scripting.md
@@ -2,23 +2,26 @@
Textadept has superb support for editing Lua code. Syntax autocomplete and
LuaDoc is available for many Textadept objects as well as Lua's standard
-libraries. See the [lua module documentation](../modules/_M.lua.commands.html)
-for more information.
+libraries. See the [`lua` module documentation][] for more information.


+[`lua` module documentation]: ../api/_M.lua.html
+
## LuaDoc and Examples
-Textadept's API is heavily documented. The [LuaDoc](../index.html) is the
-ultimate resource on scripting Textadept. There are of course abundant scripting
-examples since Textadept is mostly written in Lua.
+Textadept's API is heavily documented. The [LuaDoc][] is the ultimate resource
+on scripting Textadept. There are of course abundant scripting examples since
+Textadept is mostly written in Lua.
+
+[LuaDoc]: ../api/index.html
## Lua Configuration
-[Lua 5.2](http://www.lua.org/manual/5.2/) is built into Textadept. It has the
-same configuration (`luaconf.h`) as vanilla Lua with the following exceptions:
+[Lua 5.2][] is built into Textadept. It has the same configuration (`luaconf.h`)
+as vanilla Lua with the following exceptions:
* `TA_LUA_PATH` and `TA_LUA_CPATH` are the environment variable used in place of
the usual `LUA_PATH` and `LUA_CPATH`.
@@ -27,47 +30,52 @@ same configuration (`luaconf.h`) as vanilla Lua with the following exceptions:
`LUA_COMPAT_LOADERS`, `LUA_COMPAT_LOG10`, `LUA_COMPAT_LOADSTRING`,
`LUA_COMPAT_MAXN`, and `LUA_COMPAT_MODULE`.)
+[Lua 5.2]: http://www.lua.org/manual/5.2/
+
## Scintilla
-The editing component used by Textadept is [Scintilla](http://scintilla.org).
-The [buffer](../modules/buffer.html) part of Textadept's API is derived from the
-[Scintilla API](http://scintilla.org/ScintillaDoc.html) so any C/C++ code using
+The editing component used by Textadept is [Scintilla][]. The [buffer][] part of
+Textadept's API is derived from the [Scintilla API][] so any C/C++ code using
Scintilla calls can be ported to Lua without too much trouble.
-## Textadept Folder Structure
+[Scintilla]: http://scintilla.org
+[buffer]: ../api/buffer.html
+[Scintilla API]: http://scintilla.org/ScintillaDoc.html
+
+## Textadept Structure
Because Textadept is mostly written in Lua, its Lua scripts have to be stored in
an organized folder structure.
-#### Core
+### Core
Textadept's core Lua modules are contained in `core/`. These are absolutely
necessary in order for the application to run. They are responsible for
Textadept's Lua to C interface, event structure, file input/output, and
localization.
-#### Lexers
+### Lexers
Lexer Lua modules are responsible for the syntax highlighting of source code.
They are located in `lexers/`.
-#### Modules
+### Modules
Editor Lua modules are contained in `modules/`. These provide advanced text
editing capabilities and can be available for all programming languages or
targeted at specific ones.
-#### Themes
+### Themes
Built-in themes to customize the look and behavior of Textadept are located in
`themes/`.
-#### User
+### User
User Lua modules are contained in the `~/.textadept/` folder. This folder may
contain `lexers/`, `modules/`, and `themes/` subdirectories.
-#### GTK
+### GTK
The `etc/`, `lib/`, and `share/` directories are used by GTK and only appear in
the Win32 and Mac OSX packages.
diff --git a/doc/manual/12_Compiling.md b/doc/manual/12_Compiling.md
index f52c3b0f..aa7b2303 100644
--- a/doc/manual/12_Compiling.md
+++ b/doc/manual/12_Compiling.md
@@ -5,43 +5,49 @@
Unfortunately, the requirements for building Textadept are not quite as minimal
as running it.
-#### Linux and BSD
+### Linux and BSD
Linux systems need the GTK+ development libraries. Your package manager should
allow you to install them. For Debian-based distributions like Ubuntu, the
package is typically called `libgtk2.0-dev`. Otherwise, compile and install GTK
-from the [GTK+ website](http://www.gtk.org/download/linux.html). Additionally
-you will need the [GNU C compiler](http://gcc.gnu.org) (`gcc`) and
-[GNU Make](http://www.gnu.org/software/make/) (`make`). Both should be available
-for your Linux distribution through its package manager. For example, Ubuntu
-includes these tools in the `build-essential` package.
+from the [GTK+ website][]. Additionally you will need the [GNU C compiler][]
+(`gcc`) and [GNU Make][] (`make`). Both should be available for your Linux
+distribution through its package manager. For example, Ubuntu includes these
+tools in the `build-essential` package.
-#### Windows
+[GTK+ website]: http://www.gtk.org/download/linux.html
+[GNU C compiler]: http://gcc.gnu.org
+[GNU Make]: http://www.gnu.org/software/make/
+
+### Windows
Compiling Textadept on Windows is no longer supported. If you wish to do so
however, you need a C compiler that supports the C99 standard (Microsoft's does
-not) and the [GTK+ for Windows bundle](http://www.gtk.org/download/win32.html)
-(2.22 is recommended).
+not) and the [GTK+ for Windows bundle][] (2.22 is recommended).
The preferred way to compile for Windows is cross-compiling from Linux. To do
-so, in addition to the GTK bundle mentioned above, you need
-[MinGW](http://mingw.org) with the Windows header files. They should be
-available from your package manager.
+so, in addition to the GTK bundle mentioned above, you need [MinGW][] with the
+Windows header files. They should be available from your package manager.
+
+[GTK+ for Windows bundle]: http://www.gtk.org/download/win32.html
+[MinGW]: http://mingw.org
-#### Mac OSX
+### Mac OSX
-[XCode](http://developer.apple.com/TOOLS/xcode/) is needed for Mac OSX as well
-as [jhbuild](http://sourceforge.net/apps/trac/gtk-osx/wiki/Build). After
-building `meta-gtk-osx-bootstrap` and `meta-gtk-osx-core`, you need to build
+[XCode][] is needed for Mac OSX as well as [jhbuild][]. After building
+`meta-gtk-osx-bootstrap` and `meta-gtk-osx-core`, you need to build
`meta-gtk-osx-themes`. Note that the entire compiling process can easily take
30 minutes or more and ultimately consume nearly 1GB of disk space.
+[XCode]: http://developer.apple.com/TOOLS/xcode/
+[jhbuild]: http://sourceforge.net/apps/trac/gtk-osx/wiki/Build
+
## Compiling
Make sure you downloaded the `textadept_x.x.src.zip` (regardless of what
platform you are on) and not a platform-specific binary package.
-#### Linux and BSD
+### Linux and BSD
For Linux systems, simply run `make` in the `src/` directory. The `textadept`
executable is created in the root directory. Make a symlink from it to
@@ -49,14 +55,14 @@ executable is created in the root directory. Make a symlink from it to
BSD users please run `make BSD=1`.
-#### Cross Compiling for Windows from Linux
+### Cross Compiling for Windows
When cross-compiling from within Linux, first unzip the GTK+ for Windows bundle
into a new `src/win32gtk` directory. Then modify the `CC`, `CPP`, and `WINDRES`
variables in the `WIN32` block of `src/Makefile` to match your MinGW
installation and run `make WIN32=1` to build `../textadept.exe`.
-#### Mac OSX
+### Mac OSX
After using `jhbuild`, GTK is in `~/gtk` so make a symlink from `~/gtk/inst` to
`src/gtkosx` in Textadept. Then run `make OSX=1` to build `../textadept.osx`. At
@@ -67,7 +73,7 @@ all `.dylib` files in `Contents/Resources/lib`, and all `.so` files in
own versions in `src/gtkosx/lib`. If you wish, you may also replace the files
in `Contents/Resources/{etc,share}`, but these rarely change.
-##### Problems
+#### Problems
If the build fails because of a
@@ -80,16 +86,16 @@ lines (put `//` at the start of the line):
#define TextRange Sci_TextRange
#define TextToFind Sci_TextToFind
-#### Compiling with LuaJIT
+### Compiling with LuaJIT
-[LuaJIT](http://luajit.org) is a Just-In-Time Compiler for Lua and can boost the
-speed of Lua programs. I have noticed that syntax highlighting can be up to 2
-times faster with LuaJIT than with vanilla Lua. This difference is largely
-unnoticable on modern computers and usually only discernable when initially
-loading large files. Other than syntax highlighting, LuaJIT offers no real
-benefit performance-wise to justify it being Textadept's default runtime.
-LuaJIT's [ffi library](http://luajit.org/ext_ffi.html), however, appears to be
-useful for interfacing with external, non-Lua, libraries.
+[LuaJIT][] is a Just-In-Time Compiler for Lua and can boost the speed of Lua
+programs. I have noticed that syntax highlighting can be up to 2 times faster
+with LuaJIT than with vanilla Lua. This difference is largely unnoticable on
+modern computers and usually only discernable when initially loading large
+files. Other than syntax highlighting, LuaJIT offers no real benefit
+performance-wise to justify it being Textadept's default runtime. LuaJIT's
+[ffi library][], however, appears to be useful for interfacing with external,
+non-Lua, libraries.
You can compile Textadept with LuaJIT by running `make LUAJIT=1` for Linux
systems, `make OSX=1 LUAJIT=1` for Mac OSX, and `make WIN32=1 LUAJIT=1` for
@@ -98,3 +104,6 @@ Windows systems.
Please note that a `lua51.dll` is produced for Windows platforms because
limitations on external Lua library loading do not allow statically linking
LuaJIT to Textadept. Static linking occurs on all other platforms.
+
+[LuaJIT]: http://luajit.org
+[ffi library]: http://luajit.org/ext_ffi.html
diff --git a/doc/manual/13_Help.md b/doc/manual/13_Help.md
index 8116b125..800a18cb 100644
--- a/doc/manual/13_Help.md
+++ b/doc/manual/13_Help.md
@@ -7,9 +7,9 @@ parameters.
## Online Help
-Textadept has a [mailing list](http://groups.google.com/group/textadept) and a
-[wiki](http://caladbolg.net/textadeptwiki). You can also join us on IRC via
-[freenode.net](http://freenode.net) in `#textadept`.
+Textadept has a [mailing list][] and a [wiki][]. You can also join us on IRC via
+[freenode.net][] in `#textadept`.
-
-
+[mailing list]: http://foicica.com/lists
+[wiki]: http://caladbolg.net/textadeptwiki
+[freenode.net]: http://freenode.net
diff --git a/doc/manual/14_Appendix.md b/doc/manual/14_Appendix.md
index cdff8db7..426ab35f 100644
--- a/doc/manual/14_Appendix.md
+++ b/doc/manual/14_Appendix.md
@@ -16,7 +16,6 @@ Ctrl+Shift+W|⌘⇧W |Close all files
None |None|Load session...
None |None|Load session...
Alt+Q |⌘Q |Quit
-
**Edit** |||
Ctrl+Z
Alt+Backspace|⌘Z |Undo
Ctrl+Y
Ctrl+Shift+Z |⌘⇧Z |Redo
@@ -58,7 +57,6 @@ Ctrl++ |⌘+ |Grow selection by 1 on either side
Ctrl+\_ |⌘\_ |Shrink selection by 1 on either side
Ctrl+Shift+Up |^⇧⇡ |Move selected lines up
Ctrl+Shift+Down |^⇧⇣ |Move selected lines down
-
**Search** |||
Ctrl+F |⌘F |Find
Ctrl+G
F3 |⌘G |Find next
@@ -70,7 +68,6 @@ Ctrl+Shift+F |⌘⇧F |Find in files
Ctrl+Alt+G |^⌘G |Goto next file found
Ctrl+Alt+Shift+G |^⌘⇧G|Goto previous file found
Ctrl+J |⌘J |Jump to line
-
**Tools** |||
Ctrl+E |⌘E |Command entry
Ctrl+Shift+E |⌘⇧E |Select command
@@ -92,7 +89,6 @@ Ctrl+U |⌘U |Snapopen `_USERHOME`
None |None |Snapopen `_HOME`
Ctrl+Alt+Shift+O|^⌘⇧O |Snapopen current directory
Ctrl+I |⌘I |Show style
-
**Buffer** |||
Ctrl+Tab |^⇥ |Next buffer
Ctrl+Shift+Tab |^⇧⇥ |Previous buffer
@@ -112,7 +108,6 @@ None |None |`ISO-8859-1` encoding
None |None |`UTF-16` encoding
Ctrl+Shift+L |⌘⇧L |Select lexer...
F5 |F5 |Refresh syntax highlighting
-
**View** |||
Ctrl+Alt+N |^⌥⇥ |Next view
Ctrl+Alt+P |^⌥⇧⇥ |Previous view
@@ -132,12 +127,10 @@ Ctrl+= |⌘= |Zoom in
Ctrl+- |⌘- |Zoom out
Ctrl+0 |⌘0 |Reset zoom
Ctrl+Shift+T |⌘⇧T |Select theme...
-
**Help** |||
F1 |F1 |Open manual
Shift+F1|⇧F1 |Open LuaDoc
None |None|About
-
**Movement** |||
Down |⇣
^N |Line down
Shift+Down |⇧⇣
^⇧N |Line down extend selection
@@ -183,15 +176,12 @@ Tab |⇥ |Insert tab or indent
Shift+Tab |⇧⇥ |Dedent
None |^K |Cut to line end
None |^L |Center line vertically
-
**Other** |||
Ctrl+Shift+U, xxxx, Enter|None|Input Unicode character U-xxxx.
-
## Lua Patterns
-The following is taken from the
-[Lua 5.2 Reference Manual](http://www.lua.org/manual/5.2/manual.html#6.4.1).
+The following is taken from the [Lua 5.2 Reference Manual][].
_Character Class:_
@@ -285,3 +275,412 @@ is captured with number 2, and the part matching "`%s*`" has number 3.
As a special case, the empty capture `()` captures the current string position
(a number). For instance, if we apply the pattern `"()aa()"` on the string
`"flaaap"`, there will be two captures: 3 and 5.
+
+[Lua 5.2 Reference Manual]: http://www.lua.org/manual/5.2/manual.html#6.4.1
+
+## Migration Guides
+
+### Textadept 4 to 5
+
+Lua has been upgraded from [5.1 to 5.2][], so many scripts written for Textadept
+4 are not compatible with Textadept 5. Since incompatible scripts may cause
+crashes on startup, the following guide will help you migrate your scripts from
+Textadept 4 to Textadept 5. While this guide is not exhaustive, it covers the
+changes I had to Textadept's internals.
+
+[5.1 to 5.2]: http://www.lua.org/manual/5.2/manual.html#8
+
+#### Module Changes
+
+##### Syntax Changes
+
+Although Lua 5.2 only deprecates Lua 5.1's `module` syntax, Textadept 5 removes
+it. Therefore, replace
+
+ -- File ~/.textadept/modules/foo.lua
+ module('_m.foo', package.seeall)
+
+ function bar()
+ ...
+ end
+
+ ...
+
+and
+
+ -- File ~/.textadept/init.lua
+ require 'textadept'
+ require 'foo'
+
+with
+
+ -- File ~/.textadept/modules/foo.lua
+ local M = {}
+
+ function M.bar()
+ ...
+ end
+
+ ...
+
+ return M
+
+or
+
+ local M = {}
+ local _ENV = M
+ if setfenv then setfenv(1, _ENV) end -- LuaJIT support
+
+ function bar()
+ ...
+ end
+
+ function baz()
+ bar()
+ end
+
+ return M
+
+and
+
+ -- File ~/.textadept/init.lua
+ require 'textadept'
+ _M.foo = require 'foo'
+
+Please remember that, as stated in the documentation, `require 'textadept'` is a
+special case and `_M.textadept = require 'textadept'` is not necessary because
+of internal dependencies. All other modules need the
+`_M.module = require 'module'` construct.
+
+Notice that `_M` is the new module table instead of `_m`. More on this
+[later](#Global.Module.Table).
+
+##### Module References
+
+Replace all instances of `_M` (a reference created by `module()` that holds the
+current module table) with `M` (the local module table you created).
+
+Also, prefix all instances of internal module function calls with `M` if you are
+not using `_ENV`. For example, change
+
+ module('foo', package.seeall)
+
+ function bar()
+ ...
+ end
+
+ function baz()
+ bar()
+ end
+
+to
+
+ local M = {}
+
+ function M.bar()
+ ...
+ end
+
+ function M.baz()
+ M.bar()
+ end
+
+ return M
+
+##### LuaDoc
+
+If you use LuaDoc for your modules, you can still document them like this:
+
+ local M = {}
+
+ --[[ This comment is for LuaDoc
+ ---
+ -- This is the documentation for module foo.
+ module('foo')]]
+
+ ---
+ -- Documentation for bar.
+ -- ...
+ -- @name bar
+ function M.bar()
+ ...
+ end
+
+ return M
+
+##### Global Module Table
+
+Originally, I wanted to use `_M` as the global table that contains modules, but
+Lua 5.1's modules used `_M` silently, so I had to settle with `_m`. Now that
+modules have been removed, `_M` is available again and is used. Therefore,
+replace all instances of `_m` with `_M`. In Textadept, you can easily do a
+search and replace with "Match Case" and "Whole Words" checked -- this is what I
+did when upgrading Textadept's internals.
+
+#### Function Changes
+
+##### `unpack`
+
+`unpack()` has been renamed to `table.unpack()`. Replace all instances of
+`unpack` with `table.unpack`.
+
+##### `xpcall`
+
+`xpcall()` accepts error function parameters so you can change code from
+
+ local args = {...}
+ xpcall(function() return f(unpack(args)) end, error_function)
+
+to
+
+ xpcall(f, error_function, ...)
+
+However, this is not required.
+
+##### `loadstring`
+
+`loadstring()` has been replaced by `load()` since the latter now recognizes a
+string chunk. Replace all instances of `loadstring` with `load`.
+
+##### `setfenv`
+
+`setfenv()` has been removed. In some cases, use `load()` with an environment
+instead. For example, change
+
+ local f, err = loadstring(command)
+ if err then error(err) end
+ setfenv(f, env)()
+
+to
+
+ local f, err = load(command, nil, 'bt', env)
+ if err then error(err) end
+ f()
+
+(The `'bt'` is necessary for loading both binary and text chunks.)
+
+If instead you want to set a function's environment, change
+
+ setfenv(f, env)
+
+to
+
+ debug.setupvalue(f, 1, env)
+
+##### `getfenv`
+
+`getfenv()` has been removed. Change
+
+ local env = getfenv(f)
+
+to
+
+ local debug = require 'debug'
+ local env = debug.getupvalue(f, 1)
+
+##### `os.execute`
+
+`os.execute()`s function parameters have changed. If you are only interested in
+the return code, change
+
+ local code = os.execute(cmd)
+
+to
+
+ local _, _, code = os.execute(cmd)
+
+##### `localize`
+
+Localization is done using a global table [`_L`][] instead of calling
+`locale.localize()`. Replace all instances of `locale.localize('message')` with
+`_L['message']`. This allows messages to be modified via scripts if desirable.
+
+[`_L`]: ../api/_L.html
+
+##### `current_word`
+
+`_M.textadept.editing.current_word()` has been renamed to `select_word()` and
+does not take any parameters. There is a `_M.textadept.keys.utils.delete_word()`
+function that replaces `current_word('delete')`. You can use it or create a new
+function:
+
+ local function delete_word()
+ _M.textadept.editing.select_word()
+ buffer:delete_back()
+ end
+
+#### Theme Changes
+
+Any custom themes need to be changed to remove the `module` syntax. Usually this
+involves changing
+
+ module('lexer', package.seeall)
+
+ colors = {
+ ...
+ }
+
+ style_nothing = style { ... }
+ style_class = style { fore = colors.light_yellow }
+ ...
+ style_identifier = style_nothing
+
+ ...
+
+ style_default = style {
+ ...
+ }
+ style_line_number = { fore = colors.dark_grey, back = colors.black }
+ ...
+
+to
+
+ local l, color, style = lexer, lexer.color, lexer.style
+
+ l.colors = {
+ ...
+ }
+
+ l.style_nothing = style { ... }
+ l.style_class = style { fore = l.colors.light_yellow }
+ ...
+ l.style_identifier = l.style_nothing
+
+ ...
+
+ l.style_default = style {
+ ...
+ }
+ l.style_line_number = { fore = l.colors.dark_grey, back = l.colors.black }
+ ...
+
+Notice the `l.` prefix before most identifiers.
+
+### Textadept 3 to 4
+
+#### Key and Menu Changes
+
+Textadept 4 allow key shortcuts to appear in menus, but only simple ones, not
+keychains. Therefore, Textadept's key commands have changed radically, as has
+the menu structure and menu mnemonics. In order for key shortcuts to appear in
+menus, `_m.textadept.menu` needs to know which commands are assigned to which
+keys. Therefore, the menu module needs to be `require`d *after*
+`_m.textadept.keys`. If your `~/.textadept/init.lua` is calling
+`require 'textadept'`, you do not have to make any changes. If you are loading
+individual modules from `_m.textadept`, ensure `_m.textadept.menu` is loaded
+after `_m.textadept.keys`.
+
+On Mac OSX, key command definition has changed. `m` is now ⌘ (command) and `a`
+is now ⌥ (alt/option). `c` remains ^ (control). Previously `a` was ⌘ and ⌥ was
+undefined. Please note, however, that not all ⌥ combinations by themselves will
+work since that key is typically used to compose locale-dependent characters.
+
+#### Function Changes
+
+##### `select_scope`
+
+`_m.textadept.editing.select_scope()` was renamed to `select_style()`.
+Therefore, replace all instances of `_m.textadept.editing.select_scope` with
+`_m.textadept.editing.select_style`.
+
+##### `SAVE_STRIPS_WS`
+
+`_m.textadept.editing.SAVE_STRIPS_WS` was renamed to `STRIP_WHITESPACE_ON_SAVE`.
+Replace all instances of `_m.textadept.editing.SAVE_STRIPS_WS` with
+`_m.textadept.editing.STRIP_WHITESPACE_ON_SAVE`.
+
+### Textadept 2 to 3
+
+#### Module Changes
+
+##### Core Extensions
+
+There are no more core extention modules (previously in `core/ext/`). They have
+been relocated to `modules/textadept/` so putting
+
+ require 'textadept'
+
+in your `~/.textadept/init.lua` will load all the modules you would expect.
+Please see the [preferences][] page for instructions on how to load specific
+modules.
+
+[preferences]: 9_Preferences.html#User.Init
+
+##### Autoloading
+
+Key commands in `~/.textadept/key_commands.lua` and snippets in
+`~/.textadept/snippets.lua` are no longer auto-loaded. Instead, modify
+[`keys`][] and/or [`snippets`][] from within your `~/.textadept/init.lua` or a
+file loaded by `~/.textadept/init.lua`.
+
+[`keys`]: ../api/keys.html
+[`snippets`]: ../api/_M.textadept.snippets.html
+
+#### Function Changes
+
+Textadept has a brand new Lua [API][]. It is likely that any external scripts,
+including themes, need to be rewritten.
+
+Here is a summary of API changes:
+
+* `_m.textadept.lsnippets` renamed to [`_m.textadept.snippets`][].
+* `textadept.events` renamed to [`_G.events`][].
+ * `events.handle()` renamed to [`events.emit()`][].
+ * `events.add_handler()` renamed to [`events.connect()`][].
+* `textadept.constants` renamed to [`_SCINTILLA.constants`][].
+* `textadept.buffer_functions` renamed to [`_SCINTILLA.functions`][].
+* `textadept.buffer_properties` renamed to [`_SCINTILLA.properties`][].
+* `textadept.buffers` renamed to [`_BUFFERS`][].
+* `textadept.views` renamed to [`_VIEWS`][].
+* New [`gui`][] module.
+ * Renamed `textadept._print()` to [`gui._print()`][].
+ * Renamed `textadept.check_focused_buffer()` to `gui.check_focused_buffer()`.
+ * Renamed `textadept.clipboard_text` to `gui.clipboard_text`.
+ * Renamed `textadept.context_menu` to `gui.context_menu`.
+ * Renamed `textadept.command_entry` to [`gui.command_entry`][].
+ * Renamed `textadept.dialog` to [`gui.dialog()`][].
+ * Renamed `textadept.docstatusbar_text` to `gui.docstatusbar_text`.
+ * Renamed `textadept.find` to [`gui.find`][].
+ * Renamed `textadept.focused_doc_pointer` to `gui.focused_doc_pointer`.
+ * Renamed `textadept.get_split_table()` to [`gui.get_split_table()`][].
+ * Renamed `textadept.gtkmenu()` to [`gui.gtkmenu()`][].
+ * Renamed `textadept.goto_view()` to [`gui.goto_view()`][].
+ * Renamed `textadept.menubar` to `gui.menubar`.
+ * Renamed `textadept.print()` to [`gui.print()`][].
+ * Renamed `textadept.size` to `gui.size`.
+ * Renamed `textadept.statusbar_text` to `gui.statusbar_text`.
+ * Renamed `textadept.switch_buffer()` to [`gui.switch_buffer()`][].
+ * Renamed `textadept.title` to `gui.title`.
+ * Renamed `textadept.new_buffer()` to [`new_buffer()`][].
+ * Renamed `textadept.quit()` to [`quit()`][].
+ * Renamed `textadept.reset()` to [`reset()`][].
+ * Renamed `textadept.user_dofile()` to [`user_dofile()`][].
+ * Renamed `textadept.iconv()` to [`string.iconv()`][].
+ * Renamed `textadept.session_file` to `_SESSIONFILE`.
+* Removed global `textadept` module.
+
+[API]: ../api
+[`_m.textadept.snippets`]: ../api/_M.textadept.snippets.html
+[`_G.events`]: ../api/events.html
+[`events.emit()`]: ../api/events.html#emit
+[`events.connect()`]: ../api/events.html#connect
+[`_SCINTILLA.constants`]: ../api/_SCINTILLA.html#constants
+[`_SCINTILLA.functions`]: ../api/_SCINTILLA.html#functions
+[`_SCINTILLA.properties`]: ../api/_SCINTILLA.html#properties
+[`_BUFFERS`]: ../api/_G.html#_BUFFERS
+[`_VIEWS`]: ../api/_G.html#_VIEWS
+[`gui`]: ../api/gui.html
+[`gui._print()`]: ../api/gui.html#_print
+[`gui.command_entry`]: ../api/gui.command_entry.html
+[`gui.dialog()`]: ../api/gui.html#dialog
+[`gui.find`]: ../api/gui.find.html
+[`gui.get_split_table()`]: ../api/gui.html#get_split_table
+[`gui.gtkmenu()`]: ../api/gui.html#gtkmenu
+[`gui.goto_view()`]: ../api/gui.html#goto_view
+[`gui.print()`]: ../api/gui.html#print
+[`gui.switch_buffer()`]: ../api/gui.html#switch_buffer
+[`new_buffer()`]: ../api/_G.html#new_buffer
+[`quit()`]: ../api/_G.html#quit
+[`reset()`]:../api/_G.html#reset
+[`user_dofile()`]: ../api/_G.html#user_dofile
+[`string.iconv()`]: ../api/string.html#iconv
diff --git a/doc/manual/1_Introduction.md b/doc/manual/1_Introduction.md
index 4653d5db..0bdf97e2 100644
--- a/doc/manual/1_Introduction.md
+++ b/doc/manual/1_Introduction.md
@@ -2,24 +2,26 @@
## Overview
-