-
Notifications
You must be signed in to change notification settings - Fork 8
LUA_API_REFERENCE
Ilia Maslakov edited this page Aug 22, 2026
·
3 revisions
This file is generated from annotations in src/lua/mc-lua.c.
Do not edit it manually; run python3 maint/generate-lua-api.py.
| Lua method | Capability | Mutation |
|---|---|---|
mc.panel_provider.register(spec) -> registration|nil, error? |
panel_provider |
yes |
panel:chdir(path) -> boolean|nil, error? |
panel |
yes |
panel:current() -> table|nil, error? |
panel |
no |
panel:cwd() -> string|nil, error? |
panel |
no |
panel:refresh() -> boolean|nil, error? |
panel |
yes |
panel:selected() -> table[]|nil, error? |
panel |
no |
| Lua method | Capability | Mutation |
|---|---|---|
editor:cursor() -> Position|nil, error? |
editor |
no |
editor:edit(spec) -> EditResult|nil, error? |
editor |
yes |
editor:get_text() -> string|nil, error? |
editor |
no |
editor:info() -> DocumentInfo|nil, error? |
editor |
no |
editor:insert(text) -> boolean|nil, error? |
editor |
yes |
editor:is_readonly() -> boolean|nil, error? |
editor |
no |
editor:path() -> string|nil, error? |
editor |
no |
editor:replace(range, text) -> EditResult|nil, error? |
editor |
yes |
editor:replace_selection(text, options?) -> EditResult|nil, error? |
editor |
yes |
editor:save() -> boolean|nil, error? |
editor |
yes |
editor:selected_text() -> string|nil, error? |
editor |
no |
editor:selection() -> Selection|nil, error? |
editor |
no |
editor:set_cursor(position) -> boolean|nil, error? |
editor |
yes |
editor:tab_width() -> integer|nil, error? |
editor |
no |
editor:text(range?) -> string|nil, error? |
editor |
no |
mc.editor.current() -> editor|nil, error? |
editor |
no |
mc.macro(spec) -> boolean|nil, error? |
events |
yes |
| Lua method | Capability | Mutation |
|---|---|---|
mc.viewer.current() -> viewer|nil, error? |
viewer |
no |
viewer:goto(offset) -> boolean|nil, error? |
viewer |
yes |
viewer:mode() -> string|nil, error? |
viewer |
no |
viewer:path() -> string|nil, error? |
viewer |
no |
viewer:position() -> integer|nil, error? |
viewer |
no |
| Lua method | Capability | Mutation |
|---|---|---|
definition:create(argument, params?) -> controller |
viewer_source |
yes |
mc.log.debug(message) -> nil |
— |
no |
mc.log.error(message) -> nil |
— |
no |
mc.log.info(message) -> nil |
— |
no |
mc.log.warn(message) -> nil |
— |
no |
mc.off(subscription) -> boolean |
events |
yes |
mc.on(event, callback, options?) -> integer|nil, error? |
events |
yes |
mc.panel.active() -> panel|nil, error? |
panel |
no |
mc.panel.passive() -> panel|nil, error? |
panel |
no |
mc.process.run(spec) -> ProcessResult|nil, error? |
process |
yes |
mc.source.bytes(spec) -> Source |
— |
no |
mc.source.file(spec) -> Source |
— |
no |
mc.source.pipeline(stages) -> Source |
— |
no |
mc.source.process(spec) -> Source |
— |
no |
mc.ui.dialog(spec) -> DialogResult|nil, error? |
ui |
yes |
mc.ui.indicator(spec) -> boolean|nil, error? |
ui |
yes |
mc.ui.indicator_clear(id, area?) -> boolean|nil, error? |
ui |
yes |
mc.ui.message(title, text) -> boolean|nil, error? |
ui |
yes |
mc.ui.open_diff(spec) -> boolean|nil, error? |
diff |
yes |
mc.ui.open_viewer(spec) -> boolean|nil, error? |
viewer_source |
yes |
mc.ui.status(text) -> boolean|nil, error? |
ui |
yes |
mc.ui.text_width(text) -> integer|nil, error? |
ui |
no |
mc.viewer_source.define(spec) -> definition|nil, error? |
viewer_source |
yes |
| Callback | Workspace | Capability |
|---|---|---|
action(event) -> mc.PASS|mc.CONSUME |
mcedit |
events |
close(instance) |
mc |
panel_provider |
close(session) |
any |
viewer_source |
copy_connection(host, connection) -> Connection |
mc |
panel_provider |
delete_connection(host, connection) -> boolean |
mc |
panel_provider |
edit_connection(host, connection) -> Connection |
mc |
panel_provider |
enter(instance, entry, revision) -> OperationResult |
mc |
panel_provider |
event(snapshot) -> nil |
any |
events |
initial_params(session, params) -> params |
any |
viewer_source |
invoke_action(instance, request) -> OperationResult |
mc |
panel_provider |
list(instance) -> PanelView |
mc |
panel_provider |
navigate(instance, request) -> OperationResult |
mc |
panel_provider |
new_connection(host) -> Connection |
mc |
panel_provider |
open(argument) -> session |
any |
viewer_source |
open(host, connection?) -> instance |
mc |
panel_provider |
open_read(instance, entry) -> Source |
mc |
panel_provider |
options(session, params) -> params? |
any |
viewer_source |
prepare(session, params) -> ViewerSpec |
any |
viewer_source |
reload(instance) -> OperationResult |
mc |
panel_provider |
rename_connection(host, connection) -> Connection |
mc |
panel_provider |
view(instance, entry, request) -> ViewerSpec |
mc |
panel_provider |