aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/locale.conf19
-rw-r--r--core/locales/locale.ar.conf17
-rw-r--r--core/locales/locale.de.conf17
-rw-r--r--core/locales/locale.es.conf17
-rw-r--r--core/locales/locale.fr.conf17
-rw-r--r--core/locales/locale.it.conf17
-rw-r--r--core/locales/locale.pl.conf17
-rw-r--r--core/locales/locale.ru.conf17
-rw-r--r--core/locales/locale.sv.conf17
-rw-r--r--core/locales/locale.zh.conf17
-rw-r--r--modules/textadept/init.lua3
-rw-r--r--modules/textadept/keys.lua32
-rw-r--r--modules/textadept/menu.lua10
13 files changed, 215 insertions, 2 deletions
diff --git a/core/locale.conf b/core/locale.conf
index efc5b43a..c30e3430 100644
--- a/core/locale.conf
+++ b/core/locale.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = replacement(s) made
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -207,7 +217,7 @@ _Tools = _Tools
# Menu item for opening Textadept's Lua command entry.
Command _Entry = Command _Entry
# Menu item for selecting a menu command to run.
-Select Co_mmand = Select Co_mmand
+Select Co_mmand = Se_lect Command
# Menu items for running or compiling the current source file.
_Run = _Run
_Compile = _Compile
@@ -232,6 +242,13 @@ _Clear Bookmarks = _Clear Bookmarks
_Next Bookmark = _Next Bookmark
_Previous Bookmark = _Previous Bookmark
_Goto Bookmark... = _Goto Bookmark...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.ar.conf b/core/locales/locale.ar.conf
index 33e2480e..fb3b5df0 100644
--- a/core/locales/locale.ar.conf
+++ b/core/locales/locale.ar.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = وضع الاستبدال
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -232,6 +242,13 @@ _Clear Bookmarks = ا_مسح العلامات
_Next Bookmark = العلامة ال_تالية
_Previous Bookmark = العلامة ال_سابقة
_Goto Bookmark... = ا_ذهب إلى العلامة ..
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.de.conf b/core/locales/locale.de.conf
index 8dc0ffb1..11f8db3d 100644
--- a/core/locales/locale.de.conf
+++ b/core/locales/locale.de.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Suche in Dateien abgebrochen
# The statusbar text shown after performing a "Replace All".
replacement(s) made = Ersetzung(en) durchgeführt
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -233,6 +243,13 @@ _Clear Bookmarks = Lesezeichen löschen
_Next Bookmark = Nächstes Lesezeichen
_Previous Bookmark = Vorheriges Lesezeichen
_Goto Bookmark... = Gehe zu Lesezeichen...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.es.conf b/core/locales/locale.es.conf
index fe17c380..8d089290 100644
--- a/core/locales/locale.es.conf
+++ b/core/locales/locale.es.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = cambios(s) hecho(s)
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -232,6 +242,13 @@ _Clear Bookmarks = _Borrar marcadores
_Next Bookmark = Marcador _siguiente
_Previous Bookmark = Marcador _anterior
_Goto Bookmark... = _Ir a marcador...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.fr.conf b/core/locales/locale.fr.conf
index 5e2e823f..440c74f7 100644
--- a/core/locales/locale.fr.conf
+++ b/core/locales/locale.fr.conf
@@ -135,6 +135,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = remplacement(s) effectué(s)
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -233,6 +243,13 @@ _Clear Bookmarks = _Supprimer les signets
_Next Bookmark = Signet _suivant
_Previous Bookmark = Signet _précédent
_Goto Bookmark... = _Aller au signet...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.it.conf b/core/locales/locale.it.conf
index bc6f3726..b5256108 100644
--- a/core/locales/locale.it.conf
+++ b/core/locales/locale.it.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = sostituzione/i fatta/e
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -232,6 +242,13 @@ _Clear Bookmarks = _Annulla i segnalibri
_Next Bookmark = Segnalibro _seguente
_Previous Bookmark = Segnalibro _precedente
_Goto Bookmark... = _Vai al segnalibro...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.pl.conf b/core/locales/locale.pl.conf
index 42bfee0a..5a557bb6 100644
--- a/core/locales/locale.pl.conf
+++ b/core/locales/locale.pl.conf
@@ -135,6 +135,16 @@ Find in Files aborted = Szukanie w plikach przerwane
# The statusbar text shown after performing a "Replace All".
replacement(s) made = wykonanych(-e/-a) zamian(-y/-a)
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -233,6 +243,13 @@ _Clear Bookmarks = _Wyczyść zakładki
_Next Bookmark = _Następna zakładka
_Previous Bookmark = _Poprzednia zakładka
_Goto Bookmark... = Prz_ejdź do zakładki...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.ru.conf b/core/locales/locale.ru.conf
index 016dd3c2..80dd6cd1 100644
--- a/core/locales/locale.ru.conf
+++ b/core/locales/locale.ru.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = замен(а/ы) сделано
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -232,6 +242,13 @@ _Clear Bookmarks = _Очистить закладки
_Next Bookmark = _Следующая закладка
_Previous Bookmark = П_редыдущая закладка
_Goto Bookmark... = П_ерейти к закладке...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.sv.conf b/core/locales/locale.sv.conf
index a304803d..c67c4ef8 100644
--- a/core/locales/locale.sv.conf
+++ b/core/locales/locale.sv.conf
@@ -134,6 +134,16 @@ Find in Files aborted = Find in Files aborted
# The statusbar text shown after performing a "Replace All".
replacement(s) made = ersättning(ar) gjord(a)
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -232,6 +242,13 @@ _Clear Bookmarks = _Rensa bokmärken
_Next Bookmark = _Nästa bokmärke
_Previous Bookmark = _Föregående bokmärke
_Goto Bookmark... = _Gå till bokmärke...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/core/locales/locale.zh.conf b/core/locales/locale.zh.conf
index a40cc0c7..afa53327 100644
--- a/core/locales/locale.zh.conf
+++ b/core/locales/locale.zh.conf
@@ -134,6 +134,16 @@ Find in Files aborted = 在文件中查找已中止
# The statusbar text shown after performing a "Replace All".
replacement(s) made = replacement(s) made
+# [modules/textadept/macros.lua]
+# The message displayed in the statusbar while a macro is being recorded.
+Macro recording = Macro recording
+# The message displayed in the statusbar when finished recording a macro.
+Macro stopped recording = Macro stopped recording
+# The title of the dialog for selecting a file to save a recorded macro in.
+Save Macro = Save Macro
+# The title of the dialog for selecting a file to load a recorded macro from.
+Load Macro = Load Macro
+
# [modules/textadept/menu.lua]
# Typical "File" menu items for creating new files, opening, saving, and closing
# existing files, opening and saving sessions, and quitting Textadept.
@@ -232,6 +242,13 @@ _Clear Bookmarks = 清空书签(_C)
_Next Bookmark = 下一个书签(_N)
_Previous Bookmark = 上一个书签(_P)
_Goto Bookmark... = 转到书签(_G)...
+# Menu items for recording, playing back, saving, and loading macros.
+_Macros = _Macros
+_Start Recording = _Start Recording
+Sto_p Recording = Sto_p Recording
+_Play = _Play
+Sa_ve... = Sa_ve...
+_Load... = _Load...
# Menu items for launching a quick open dialog in order to open files in certain
# directories. A quick open dialog lists all files in a directory and its
# subdirectories and filters the list down as the user types.
diff --git a/modules/textadept/init.lua b/modules/textadept/init.lua
index d631de66..5f84e429 100644
--- a/modules/textadept/init.lua
+++ b/modules/textadept/init.lua
@@ -1,7 +1,7 @@
-- Copyright 2007-2018 Mitchell mitchell.att.foicica.com. See LICENSE.
local M = {}
-textadept = M
+textadept = M -- forward declaration
--[[ This comment is for LuaDoc.
---
@@ -14,6 +14,7 @@ require('textadept.command_entry')
M.editing = require('textadept.editing')
M.file_types = require('textadept.file_types')
require('textadept.find')
+M.macros = require('textadept.macros')
M.run = require('textadept.run')
M.session = require('textadept.session')
M.snippets = require('textadept.snippets')
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 917a3af7..f19cd7d9 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -90,6 +90,9 @@ local M = {}
-- F2 |F2 |F2 |Next bookmark
-- Shift+F2 |⇧F2 |F3 |Previous bookmark
-- Alt+F2 |⌥F2 |F4 |Goto bookmark...
+-- F9 |F9 |F9 |Start recording macro
+-- Shift+F9 |⇧F9 |F10 |Stop recording macro
+-- Alt+F9 |⌥F9 |F12 |Play recorded macro
-- Ctrl+U |⌘U |^U |Quickly open `_USERHOME`
-- None |None |None |Quickly open `_HOME`
-- Ctrl+Alt+Shift+O|^⌘⇧O |M-S-O |Quickly open current directory
@@ -390,6 +393,10 @@ keys[not OSX and (GUI and 'csf2' or 'f6') or 'msf2'] = textadept.bookmarks.clear
keys.f2 = m_bookmark[_L['_Next Bookmark']][2]
keys[GUI and 'sf2' or 'f3'] = m_bookmark[_L['_Previous Bookmark']][2]
keys[GUI and 'af2' or 'f4'] = textadept.bookmarks.goto_mark
+-- Macros.
+keys.f9 = textadept.macros.start_recording
+keys[GUI and 'sf9' or 'f10'] = textadept.macros.stop_recording
+keys[GUI and 'af9' or 'f12'] = textadept.macros.play
-- Quick Open.
local m_quick_open = m_tools[_L['Quick _Open']]
keys[not OSX and 'cu' or 'mu'] = m_quick_open[_L['Quickly Open _User Home']][2]
@@ -520,6 +527,31 @@ elseif CURSES then
end
end
+-- Unbound keys are handled by Scintilla, but when playing back a macro, this is
+-- not possible. Define useful default keybindings so Scintilla does not have to
+-- handle them.
+keys.left, keys.sleft = buffer.char_left, buffer.char_left_extend
+keys.cleft, keys.csleft = buffer.word_left, buffer.word_left_extend
+keys.right, keys.sright = buffer.char_right, buffer.char_right_extend
+keys.cright, keys.csright = buffer.word_right, buffer.word_right_extend
+if OSX then
+ keys.mleft, keys.msleft = buffer.vc_home, buffer.vc_home_extend
+ keys.mright, keys.msright = buffer.line_end, buffer.line_end_extend
+end
+keys.down, keys.sdown = buffer.line_down, buffer.line_down_extend
+keys.up, keys.sup = buffer.line_up, buffer.line_up_extend
+if not OSX then
+ keys.home, keys.shome = buffer.home, buffer.home_extend
+ keys['end'], keys.send = buffer.line_end, buffer.line_end_extend
+end
+keys.del, keys.sdel = buffer.clear, buffer.cut
+keys[not OSX and 'cdel' or 'mdel'] = buffer.del_word_right
+keys[not OSX and 'csdel' or 'msdel'] = buffer.del_line_right
+keys['\b'], keys['s\b'] = buffer.delete_back, buffer.delete_back
+keys[not OSX and 'c\b' or 'm\b'] = buffer.del_word_left
+keys[not OSX and 'cs\b' or 'ms\b'] = buffer.del_line_left
+keys['\t'], keys['s\t'] = buffer.tab, buffer.back_tab
+
-- Modes.
keys.filter_through = {
['\n'] = function()
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 55c97ce4..2789f0b6 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -216,6 +216,16 @@ local default_menubar = {
{_L['_Goto Bookmark...'], textadept.bookmarks.goto_mark},
},
{
+ title = _L['_Macros'],
+ {_L['_Start Recording'], textadept.macros.start_recording},
+ {_L['Sto_p Recording'], textadept.macros.stop_recording},
+ SEPARATOR,
+ {_L['_Play'], textadept.macros.play},
+ SEPARATOR,
+ {_L['Sa_ve...'], textadept.macros.save},
+ {_L['_Load...'], textadept.macros.load},
+ },
+ {
title = _L['Quick _Open'],
{_L['Quickly Open _User Home'], function() io.quick_open(_USERHOME) end},
{_L['Quickly Open _Textadept Home'], function() io.quick_open(_HOME) end},