From 9c40b6e33237b137c46530a25a3560f4b56bc682 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 21 Jun 2013 15:00:56 -0400 Subject: Remove theme selection since it does not persist. Encourage calling `gui.set_theme()` from *~/.textadept/init.lua* instead. --- core/gui.lua | 36 +++++++++--------------------------- core/locale.conf | 2 -- core/locales/locale.de.conf | 2 -- core/locales/locale.es.conf | 2 -- core/locales/locale.fr.conf | 2 -- core/locales/locale.ru.conf | 2 -- 6 files changed, 9 insertions(+), 37 deletions(-) (limited to 'core') diff --git a/core/gui.lua b/core/gui.lua index bee5c567..59ad72d5 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -162,39 +162,21 @@ function gui.goto_file(filename, split, preferred_view, sloppy) end --- --- Sets the editor theme name to *name* or prompts the user to select one from a --- list of themes found in the *`_USERHOME`/themes/* and *`_HOME`/themes/* --- directories and optionally sets key-value pair argument properties. +-- Sets the editor theme name to *name* and optionally sets key-value pair +-- argument properties. -- User themes override Textadept's default themes when they have the same name. -- If *name* contains slashes, it is assumed to be an absolute path to a theme -- instead of a theme name. --- @param name Optional name or absolute path of a theme to set. If `nil`, the --- user is prompted for one. --- @param ... key-value argument pairs for theme properties to set. These --- override the theme's defaults. +-- @param name The name or absolute path of a theme to set. +-- @param ... Optional key-value argument pairs for theme properties to set. +-- These override the theme's defaults. -- @usage gui.set_theme('light', 'font', 'Monospace', 'fontsize', 12) -- @name set_theme function gui.set_theme(name, ...) - if not name then - local themes, themes_found = {}, {} - for theme in lfs.dir(_HOME..'/themes') do - theme = theme:match('^(.-)%.lua$') - if theme then themes_found[theme] = true end - end - if lfs.attributes(_USERHOME..'/themes') then - for theme in lfs.dir(_USERHOME..'/themes/') do - theme = theme:match('^(.-)%.lua$') - if theme then themes_found[theme] = true end - end - end - for theme in pairs(themes_found) do themes[#themes + 1] = theme end - table.sort(themes) - name = gui.filteredlist(_L['Select Theme'], _L['Name'], themes) - end - if name and not name:find('[/\\]') then - name = package.searchpath(name, _USERHOME..'/themes/?.lua;'.. - _HOME..'/themes/?.lua') - end + if not name then return end + name = name:find('[/\\]') and name or + package.searchpath(name, _USERHOME..'/themes/?.lua;'.. + _HOME..'/themes/?.lua') if not name or not lfs.attributes(name) then return end local buffer, props = buffer, {...} local current_buffer, current_view = _BUFFERS[buffer], _VIEWS[view] diff --git a/core/locale.conf b/core/locale.conf index 40bd6945..4878377e 100644 --- a/core/locale.conf +++ b/core/locale.conf @@ -42,7 +42,6 @@ Name = Name %Untitled = Untitled Switch Buffers = Switch Buffers theme not found. = theme not found. -Select Theme = Select Theme CRLF = CRLF CR = CR LF = LF @@ -239,7 +238,6 @@ Toggle _Virtual Space = Toggle _Virtual Space Zoom _In = Zoom _In Zoom _Out = Zoom _Out _Reset Zoom = _Reset Zoom -Select _Theme... = Select _Theme... _Help = _Help Show _Manual = Show _Manual Show _LuaDoc = Show _LuaDoc diff --git a/core/locales/locale.de.conf b/core/locales/locale.de.conf index 2508a656..183d1f1f 100644 --- a/core/locales/locale.de.conf +++ b/core/locales/locale.de.conf @@ -43,7 +43,6 @@ Name = Name %Untitled = Unbenannt Switch Buffers = Wechsle Buffer theme not found = -Theme nicht gefunden -Select Theme = Theme auswählen CRLF = CRLF CR = CR LF = LF @@ -229,7 +228,6 @@ Toggle _Virtual Space = Virtuelle Leerzeichen umschalten Zoom _In = Zoom vergrößern Zoom _Out = Zoom verkleinern _Reset Zoom = Zoom zurücksetzen -Select _Theme... = Theme auswählen _Help = _Hilfe Show _Manual = Handbuch anzeigen Show _LuaDoc = LuaDoc anzeigen diff --git a/core/locales/locale.es.conf b/core/locales/locale.es.conf index a8a1c628..102401e4 100644 --- a/core/locales/locale.es.conf +++ b/core/locales/locale.es.conf @@ -43,7 +43,6 @@ Name = Nombre %Untitled = Sin Nombre Switch Buffers = Cambiar Buffer theme not found. = tema no encontrado. -Select Theme = Seleccionar tema CRLF = CRLF CR = CR LF = LF @@ -240,7 +239,6 @@ Toggle _Virtual Space = Activa_r/Desactivar modo espacio virtual Zoom _In = _Zoom: Acercar Zoom _Out = Zoom: Ale_jar _Reset Zoom = Zoom: R_estaurar -Select _Theme... = Se_leccionar tema... _Help = A_yuda Show _Manual = Mostrar _manual Show _LuaDoc = Mostrar _LuaDoc diff --git a/core/locales/locale.fr.conf b/core/locales/locale.fr.conf index ad2be4d8..60279918 100644 --- a/core/locales/locale.fr.conf +++ b/core/locales/locale.fr.conf @@ -43,7 +43,6 @@ Name = Nom %Untitled = Sans titre Switch Buffers = Changer de buffer theme not found. = thème non trouvé. -Select Theme = Sélectionner un thème CRLF = CRLF CR = CR LF = LF @@ -240,7 +239,6 @@ Toggle _Virtual Space = Permuter _espace virtuel Zoom _In = _Zoomer Zoom _Out = Déz_oomer _Reset Zoom = _Réinitialiser zoom -Select _Theme... = Sélectionner _Thème... _Help = _Aide Show _Manual = Voir _manuel Show _LuaDoc = Voir _LuaDoc diff --git a/core/locales/locale.ru.conf b/core/locales/locale.ru.conf index e4b48db6..c1fde42c 100644 --- a/core/locales/locale.ru.conf +++ b/core/locales/locale.ru.conf @@ -43,7 +43,6 @@ Name = Название %Untitled = Безымянный Switch Buffers = Переключение между буферами theme not found. = тема не найдена. -Select Theme = Выбрать тему CRLF = CRLF CR = CR LF = LF @@ -229,7 +228,6 @@ Toggle _Virtual Space = Переключить режим _виртульных Zoom _In = _Приблизить Zoom _Out = _Отдалить _Reset Zoom = _Сбросить масштаб -Select _Theme... = Выбрать тему... _Help = _Справка Show _Manual = Показать _руководство Show _LuaDoc = Показать документацию по _lua -- cgit v1.2.3