kvichans / cuda_find_in_files Goto Github PK
View Code? Open in Web Editor NEWCudaText plugin to find/replace in multiple files
CudaText plugin to find/replace in multiple files
Хорошо бы плагин- указал Урл Гитхаба-
I have a .txt in UTF-8 format (see attachment below). It contains the word "schönsten". (Note the umlaut.) I enter the word "schönsten" into the Find field And press the Find button.
Homeoffice - Arbeitsgericht stärkt Recht auf Telearbeit - SPIEGEL ONLINE.txt
When the Encoding field is set to "cp1252, UTF-8, ", nothing is found.
When the Encoding field is set to "", nothing is found.
When the Encoding field is set to "UTF-8, cp1252, ", the word is correctly found.
Encodings for reading files:
The first suitable from series will be applyed.
My def encoding is "cp1251". For other it may be different.
If def encoding is "UTF-8" then list shrinks to
This def encoding can be set in user.json
// Exact encoding to read files
"fif_locale_encoding":"cp1252",
It can be usefull for Linux users as def encoding is "UTF-8".
NB! "detected" is slow on large list of files.
// Copy find-options ".*", "aA", "w" from editor find to dialog on start
"fif_use_edfind_opt_on_start":false,
// ESC will stop all stages
"fif_use_edfind_opt_on_start":false,
Nav to src. для стр. 888 прыгает в файл -
выделяется строка 888 (ОК) до начала след. строки 889, каретка уже на стр 889
[18.42"]parse_line:627 mtSPR gdct={'S': '\t', 'R': '888', 'L': None, 'C': None, 'P': '/home/user/lazarus/examples/cleandir/dircleaner.pp'}
[18.44"]Command._nav_to_src:646 full= </home/user/lazarus/examples/cleandir/dircleaner.pp(888)>
[18.45"]Command._nav_to_src:647 shft, path, rw, cl, ln=('\t', '/home/user/lazarus/examples/cleandir/dircleaner.pp', 887, -1, -1)
I would like to be able to not only Find in Files, but also to Replace in Files.
make it with checkboxes.
Ie, dlg_custom.
что это за модуль?Вы его знаете уже?
текст не фолдится. при выводе. причина - лексер ищет блок от поз. посл. изменения. Делайте изменение 1й строки. Или делайте ed.insert('\n'.join(lines))
Wish
Value 0 of "skip files" must be "Don't skip"
Запутался с Гитом. Поэтому два одинаковых коммита в двух ветках.
Download the attached file and place it in a folder that will be searched later.
Homeoffice - Arbeitsgericht stärkt Recht auf Telearbeit - SPIEGEL ONLINE.txt
In the Find field, enter "schönsten" (without the quotes).
In the Replace with field, enter "äää" (without the quotes).
Set the Encoding field to "UTF-8, cp1252, ".
Press the Replace button.
As a result, "schönsten" will be replaced with "\ä\ä\ä". The 3 backslash characters should not be there.
Python 3.4.3 (default, Oct 14 2015, 20:31:36)
[GCC 4.8.4]
Setting icons: AwOken_24x24
[ 0.02"]collect_files:1633 >>1(:)how_walk={'file_incl': '*', 'depth': -1, 'root': '', 'only_frst': 0, 'sort_type': '', 'enco': ['cp1252', 'UTF-8', '"detected"'], 'skip_binr': True, 'file_excl': '', 'skip_hidn': True}
[ 0.40"] 1(:)=[ 0.00"]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/user/.cudatext/py/cuda_find_in_files/__init__.py", line 4, in show_dlg
def show_dlg(self, what='', opts={}): return RLS.show_dlg(what, opts)
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 112, in show_dlg
return dlg_fif(what, opts)
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 807, in dlg_fif
,progressor = progressor
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 1373, in find_in_files
collect_files(how_walk, progressor)
ValueError: need more than 0 values to unpack
I suggest an opt
Fold results (results root nodes): Fold last only (def)/ Fold all/ Unfold all
to be able to fold all
It would be great if special chars (\n \r \t...) were supported for searching and replacing. SynWrite has a checkbox for that option in the dialog.
News:
// ESC will stop all stages
"fif_esc_full_stop":false,
// Style to mark found fragment in source line
// Full form
// "fif_mark_style":{"bg_c":"", "font_c":"", "font_b":false, "font_i":false, "border_c":"", "border":{"l":"","r":"","b":"","t":""}},
// Color values: "" - skip, "RRGGBB" - hex-digits
// Values for border sides: "solid", "dash", "2px", "dotted", "rounded", "wave"
"fif_mark_style":{"border":{"b":"dotted"}},
// Close dialog if searching was success
"fif_hide_if_success":false,
// List of lexer names. First available will be applyed.
"fif_lexers":["Search results"],
Main dlg layout is updated.
Max shown fields (all switch on in Adjust, -Less+More)
Min shown fields (all switch off in Adjust, +Less-More)
Replace-in-files (#41) and Replace-in-tabs.
NB! Version is BETA - try to replace at your own risk.
Report shows all found old lines/fragments and marks its with "!" before line numbers.
Report shows all new lines and marks its with "=" before line numbers.
Navigation works only for new lines.
Preset can be configured for all fields (except Find and Replace with)
В Лин скрытый== имя начинается с точки
учтите это по os.name,
хочу пропутить фолдер .svn
Нужно тестировать
Проверьте, что плагин "живой" не только у меня
Кроме того в консоли можно увидеть сколько времени занимали этапы "Сбор файлов" и "Поиск фрагментов"
(:)=[ 1.45"]
- это про сбор файлов
ok files ==)[ 2.68"]
- это про фрагменты
path··(··r:··c:··l):line
for compact and aligned report.All path/row/col/len (if its are) are shown into same columns. Thus source lines are shown aligned too.
// "fif_mark_style":{{
// "bg_c":"",
// "font_c":"", "font_b":false, "font_i":false,
// "border_c":"",
// "border":{{"l":"","r":"","b":"","t":""}}
// }},
// Color values: "" - skip, "#RRGGBB" - hex-digits
// Values for border sides: "solid", "dash", "2px", "dotted", "rounded", "wave"
"fif_mark_style":{{"border":{{"b":"dotted"}}}},
Nearest plans
btn to make big/small dialog. caption: "More >>", "Less <<" (two > or < like Win apps)
что делают все 5 опций в combobox?
первый запуск.
[ 0.01"]collect_files:687 >>1(:)how_walk={'root': '/home/user/lazarus/examples', 'skip_binr': False, 'file_excl': '', 'depth': -1, 'skip_hidn': False, 'sort_type': '', 'only_frst': 0, 'file_incl': '*.pp'}
[ 0.03"] collect_files:714 incls=['*.pp']
[ 0.04"] collect_files:715 excls=[]
[ 0.23"] 1(:)=[ 0.20"]
[ 0.24"]find_in_files:569 #files=35
[ 0.25"]find_in_files:591 ?? files (==[ 0.00"]
[ 0.29"]find_in_files:671 ok files ==)[ 0.05"] #rsp_l=3
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/user/cuda/cuda/app/py/cuda_find_in_files/cd_fi_in_fi.py", line 431, in show_dlg
if '1'==vals['toed']:
KeyError: 'toed'
html color "#rrggbb", must be as option.
Now int value.
+Search for "dd" in "<Open Files>" (4 matches in 1 files)
<{CudaText}/Untitled1>: #4
<(1:3:2)>: dfdd
<(2:1:2)>: ddd
<(5:1:2)>: dddd
Nav dont work to 2:1
dir has r/o attr (Linux: access is +r-w)
Repl must SKIP fls here
"fif_mark_style":{
"color_back":"",
"color_font":"",
"font_bold":false,
"font_italic":false,
"color_border":"",
"borders":{"left":"","right":"","bottom":"","top":""}
},
<Open Files>
for In folder
field. Ready preset helps u.Find
, In files
, Not in files
, all Adv.report
(not all tree types)In subfolders
, all Adv.search
In files
.Known problem: jump from results for "Untitled2" doesnt work.
# Find in Files
CudaText plugin. Gives dialog to find/replace string in multiple files.
Main target is dialog like in SynWrite. Or with more features.
Outputs found lines to "Search Results" panel in bottom-panel.
Updating CudaText is mandatory.
Count of tree types is returned to six. Now any of the type can be aligned: [x]Align
Any tab (temp or file) with Results will have target of search (dlg field Find
) in title :
Results (abc)
or file.ext (abc)
.
NB: not full target, only 10 chars.
@Alexey-T #36, @Andreas123456 #34 Navigation is fixed.
Known plroblems
regex,words=on
тут есть обработка words? нет вроде.
накрайняк- искать \bтекст\b
[24.83"]find_in_files:589 ?? files (==[ 0.00"]
Cannot open "/home/user/lazarus/lcl/interfaces/qt/qtwsdialogs.pp": 'utf-8' codec can't decode byte 0xb4 in position 4597: invalid start byte
Cannot open "/home/user/lazarus/lcl/interfaces/carbon/carboncanvas.pp": 'utf-8' codec can't decode byte 0xe9 in position 7752: invalid continuation byte
Cannot open "/home/user/lazarus/lcl/interfaces/wince/wincewsforms.pp": 'utf-8' codec can't decode byte 0xb4 in position 5974: invalid start byte
Cannot open "/home/user/lazarus/components/mpaslex/mpaslex.pp": 'utf-8' codec can't decode byte 0x96 in position 7340: invalid start byte
Files
_.zip
Got err in console.
[57.59"]collect_files:1661 >>3(:)how_walk={'root': '/', 'sort_type': '', 'only_frst': 0, 'depth': -1, 'skip_binr': True, 'skip_hidn': True, 'file_excl': '', 'enco': ['cp1252', 'UTF-8', '<detected>'], 'file_incl': '*'}
[ 1'33.55"] collect_files:1732 |rsp|, stoped=(328, True)
[ 1'33.57"] 3(:)=[35.62"]
[ 1'33.60"]find_in_files:1525 ?? files (==[ 0.00"]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/user/.cudatext/py/cuda_find_in_files/__init__.py", line 4, in show_dlg
def show_dlg(self, what='', opts={}): return RLS.show_dlg(what, opts)
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 113, in show_dlg
return dlg_fif(what, opts)
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 803, in dlg_fif
,progressor = progressor
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 1567, in find_in_files
enco_s = detect_encoding(path, detector)
File "/home/user/.cudatext/py/cuda_find_in_files/cd_fi_in_fi.py", line 1410, in detect_encoding
with open(path, 'rb') as h_path:
PermissionError: [Errno 13] Permission denied: '/dev/hidraw1'
Запись </home/user/lazarus/lcl/dbctrls.pp(1750)>
Report /undo/es by NN steps. bad
After replace, column and length of the new lines in the report are always 0. Example: (=77: 0:0)
The real (new) column and length values should be shown here.
лучше не показ. это.
Cannot read "/home/user/lazarus/test/manual/png/testsuite/s40i3p04.png" (encoding=None/['cp1252', 'UTF-8', None]): 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
Cannot read "/home/user/lazarus/test/manual/png/testsuite/f01n2c08.png" (encoding=None/['cp1252', 'UTF-8', None]): 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.