aboutsummaryrefslogtreecommitdiff
path: root/doc/manual.md
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2019-07-30 17:09:21 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2019-07-30 17:09:21 -0400
commite1c41c53c4bb7bf6ef5770dce93e4cda21fb1a8e (patch)
treebdb0aecf8f6641c3f2f052972bfb8913ece1b4e7 /doc/manual.md
parented91aa74ec7dacf3d4f7f794ac571bd7ffcc8cc0 (diff)
downloadtextadept-e1c41c53c4bb7bf6ef5770dce93e4cda21fb1a8e.tar.gz
textadept-e1c41c53c4bb7bf6ef5770dce93e4cda21fb1a8e.zip
Document the inability to create buffers during initialization.
Diffstat (limited to 'doc/manual.md')
-rw-r--r--doc/manual.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/manual.md b/doc/manual.md
index 64e9608f..c1c6fec4 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -940,9 +940,15 @@ mind:
* Be aware of the programming languages Textadept supports and do not use any
module names that match the name of a lexer in the *lexers/* directory unless
you are creating a language module.
+* Do not call any functions that create buffers and views (e.g. `ui.print()`,
+ `io.open_file()`, and `buffer.new()`) at file-level scope. This will result in
+ hard errors as Textadept initializes. Those types of function calls must occur
+ within functions (e.g. in a key binding, menu item, or
+ [`events.INITIALIZED`][] event handler).
* Additional documentation on creating language modules can be found in the
the [language module API documentation][].
+[`events.INITIALIZED`]: api.html#events.INITIALIZED
[language module API documentation]: api.html#_M
- - -
@@ -971,6 +977,14 @@ items, and changing the theme. This manual discusses these specific
customizations, minus theming, in the sections below. Theming is covered in a
later section.
+Note: Do not call any functions that create buffers and views (e.g.
+`ui.print()`, `io.open_file()`, and `buffer.new()`) at the file-level scope of
+*~/.textadept/init.lua*. This will result in hard errors as Textadept
+initializes. Those types of function calls must occur within functions (e.g. in
+a key binding, menu item, or [`events.INITIALIZED`][] event handler).
+
+[`events.INITIALIZED`]: api.html#events.INITIALIZED
+
### Editor Preferences
Editor preferences are stored in a [`buffer`][] object. Normally, each buffer