From 3ba84217f2c4d439ad9cf96b5ea943bda0e59be2 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+orbitalquark@users.noreply.github.com> Date: Wed, 16 Sep 2020 21:49:16 -0400 Subject: Record directory for "find in files" searches. --- core/locale.conf | 2 ++ core/locales/locale.ar.conf | 2 ++ core/locales/locale.de.conf | 2 ++ core/locales/locale.es.conf | 2 ++ core/locales/locale.fr.conf | 2 ++ core/locales/locale.it.conf | 2 ++ core/locales/locale.pl.conf | 2 ++ core/locales/locale.ru.conf | 2 ++ core/locales/locale.sv.conf | 2 ++ core/locales/locale.zh.conf | 2 ++ modules/textadept/find.lua | 4 ++-- test/test.lua | 4 ++++ 12 files changed, 26 insertions(+), 2 deletions(-) diff --git a/core/locale.conf b/core/locale.conf index 6d067034..db217aec 100644 --- a/core/locale.conf +++ b/core/locale.conf @@ -121,6 +121,8 @@ No results found = No results found Select Directory = Select Directory # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Files Found Buffer] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Binary file matches. diff --git a/core/locales/locale.ar.conf b/core/locales/locale.ar.conf index bca60843..5ca8bbf7 100644 --- a/core/locales/locale.ar.conf +++ b/core/locales/locale.ar.conf @@ -121,6 +121,8 @@ No results found = عذرًا, لا يوجد نتائج Select Directory = ابحث في الملفات # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [مذكرة الملفات التي بحثْتُ عنها] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Binary file matches. diff --git a/core/locales/locale.de.conf b/core/locales/locale.de.conf index a349285a..b7ee623c 100644 --- a/core/locales/locale.de.conf +++ b/core/locales/locale.de.conf @@ -121,6 +121,8 @@ No results found = Keine Treffer gefunden Select Directory = In Dateien suchen # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Buffer mit gefundenen Dateien] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Übereinstimmungen in Binärdatei. diff --git a/core/locales/locale.es.conf b/core/locales/locale.es.conf index 7b96c970..401e6700 100644 --- a/core/locales/locale.es.conf +++ b/core/locales/locale.es.conf @@ -121,6 +121,8 @@ No results found = No se han encontrado coincidencias Select Directory = Buscar en ficheros # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Buffer de búsqueda en ficheros] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Coincidencia en fichero binario. diff --git a/core/locales/locale.fr.conf b/core/locales/locale.fr.conf index 8850f110..ca6363a2 100644 --- a/core/locales/locale.fr.conf +++ b/core/locales/locale.fr.conf @@ -122,6 +122,8 @@ No results found = Aucun résultat trouvé Select Directory = Rechercher dans les fichiers # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Onglet des fichiers trouvés] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Correspondances dans un fichier binaire diff --git a/core/locales/locale.it.conf b/core/locales/locale.it.conf index 0202de01..4a243e59 100644 --- a/core/locales/locale.it.conf +++ b/core/locales/locale.it.conf @@ -121,6 +121,8 @@ No results found = Nessun risultato trovato Select Directory = Trova nei file # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Scheda dei file trovati] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Corrispondenze in un file binario. diff --git a/core/locales/locale.pl.conf b/core/locales/locale.pl.conf index ecacc2e8..687f495c 100644 --- a/core/locales/locale.pl.conf +++ b/core/locales/locale.pl.conf @@ -122,6 +122,8 @@ No results found = Niczego nie znaleziono Select Directory = Znajdź w plikach # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Bufor szukania w plikach] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Znalezione w pliku binarnym. diff --git a/core/locales/locale.ru.conf b/core/locales/locale.ru.conf index 24be9914..1f4f7e4c 100644 --- a/core/locales/locale.ru.conf +++ b/core/locales/locale.ru.conf @@ -121,6 +121,8 @@ No results found = Ничего не найдено Select Directory = Найти в файлах # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Буфер поиска в файлах] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Соответствие в двоичном файле. diff --git a/core/locales/locale.sv.conf b/core/locales/locale.sv.conf index fdc8334b..c67eb83c 100644 --- a/core/locales/locale.sv.conf +++ b/core/locales/locale.sv.conf @@ -121,6 +121,8 @@ No results found = Inga resultat hittades Select Directory = Sök i filer # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Files Found Buffer] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = Binär fil matchar. diff --git a/core/locales/locale.zh.conf b/core/locales/locale.zh.conf index 489e9a23..63c51e0e 100644 --- a/core/locales/locale.zh.conf +++ b/core/locales/locale.zh.conf @@ -121,6 +121,8 @@ No results found = 未找到结果 Select Directory = 在文件中查找 # The name of the buffer Textadept prints "Find in Files" results to. [Files Found Buffer] = [Files Found Buffer] +# The "Find in Files" label for the directory searched. +Directory: = Directory: # The "Find in Files" result for text found in a binary file. This result is # shown in place of binary buffer text. Binary file matches. = 二进制文件匹配。 diff --git a/modules/textadept/find.lua b/modules/textadept/find.lua index 22458e3e..1a1b941c 100644 --- a/modules/textadept/find.lua +++ b/modules/textadept/find.lua @@ -307,8 +307,8 @@ function M.find_in_files(dir, filter) if buffer._type ~= _L['[Files Found Buffer]'] then preferred_view = view end ui.silent_print = false ui._print(_L['[Files Found Buffer]'], string.format( - '%s %s\n%s %s', _L['Find:']:gsub('_', ''), M.find_entry_text, - _L['Filter:']:gsub('_', ''), + '%s %s\n%s %s\n%s %s', _L['Find:']:gsub('_', ''), M.find_entry_text, + _L['Directory:'], dir, _L['Filter:']:gsub('_', ''), type(filter) == 'string' and filter or table.concat(filter, ','))) buffer.indicator_current = M.INDIC_FIND diff --git a/test/test.lua b/test/test.lua index 5d6ddbc5..321df0bc 100644 --- a/test/test.lua +++ b/test/test.lua @@ -2313,6 +2313,8 @@ function test_ui_find_find_in_files() end function test_ui_find_find_in_files_interactive() + local cwd = lfs.currentdir() + lfs.chdir(_HOME) local filter = ui.find.find_in_files_filters[_HOME] ui.find.find_in_files_filters[_HOME] = nil -- ensure not set ui.find.find_entry_text = 'foo' @@ -2320,6 +2322,7 @@ function test_ui_find_find_in_files_interactive() ui.find.replace_entry_text = '/test' events.emit(events.FIND, ui.find.find_entry_text, true) local results = buffer:get_text() + assert(results:find('Directory: '), 'directory not shown') assert(results:find('Filter: /test\n'), 'no filter defined') assert(results:find('src/foo.c'), 'foo.c not found') assert(results:find('include/foo.h'), 'foo.h not found') @@ -2349,6 +2352,7 @@ function test_ui_find_find_in_files_interactive() ui.goto_view(1) view:unsplit() ui.find.find_in_files_filters[_HOME] = filter + lfs.chdir(cwd) end function test_ui_find_in_files_single_char() -- cgit v1.2.3