Post AkpEBGH494UopV6A40 by aliss@outerheaven.club
 (DIR) More posts by aliss@outerheaven.club
 (DIR) Post #AkpDM7awehFF8t0lIu by aliss@outerheaven.club
       2024-08-10T13:19:15.006525Z
       
       0 likes, 1 repeats
       
       does anybody know if it's possible in code editors to completely hide lines that don't match a pattern and keep editing the lines that do?
       
 (DIR) Post #AkpDZT9boJMTlsaceO by aliss@outerheaven.club
       2024-08-10T13:21:39.711365Z
       
       0 likes, 1 repeats
       
       i don't think this is possible
       
 (DIR) Post #AkpE9E0NbwHXDGK3Yu by GNUxeava@mk.absturztau.be
       2024-08-10T13:23:13.664Z
       
       1 likes, 0 repeats
       
       @aliss@outerheaven.club put them in braces so editor can collapse themlike how they can do to functions
       
 (DIR) Post #AkpE9Jy7RG2RhzJKs4 by aliss@outerheaven.club
       2024-08-10T13:28:07.320314Z
       
       0 likes, 0 repeats
       
       @GNUxeava yea it's a different problem kinda, i have to internationalise a lot of source code strings (250K words), by hand... it'll help immensely but maybe is not a common use case...
       
 (DIR) Post #AkpEBGH494UopV6A40 by aliss@outerheaven.club
       2024-08-10T13:28:30.337402Z
       
       0 likes, 0 repeats
       
       @GNUxeava i just want to be editing certain lines that follow certain patterns, manually, i don't want to do a find/replace/sed thingie
       
 (DIR) Post #AkpEuWqXNS97G5H6vI by Paradox@raru.re
       2024-08-10T13:36:45Z
       
       1 likes, 0 repeats
       
       @aliss What might work for you is using the pattern data to append or prepend a comment pointing out which lines to fix.
       
 (DIR) Post #AkpFFxH2JePvIpt1bE by aliss@outerheaven.club
       2024-08-10T13:40:34.321083Z
       
       0 likes, 0 repeats
       
       @Paradox hmmm https://outerheaven.club/notice/AkpE8XVmQ29qB4SILYthere's like no lines to fix per se i need to go through them one by one but they're mixed with source code so i want to hide most of the source code (hide everything not matching x)
       
 (DIR) Post #AkpFocLG8Fh2WFOF2O by Paradox@raru.re
       2024-08-10T13:46:53Z
       
       0 likes, 0 repeats
       
       @aliss Oh I slightly misunderstood.Ok first question. In what world are you manually adjusting 250k words?
       
 (DIR) Post #AkpGFrqsZfYoRQAqJc by aliss@outerheaven.club
       2024-08-10T13:51:45.830537Z
       
       0 likes, 0 repeats
       
       @Paradox bc im translating them fdksjg
       
 (DIR) Post #AkpGPdZoVJz53yqlqi by Paradox@raru.re
       2024-08-10T13:53:34Z
       
       0 likes, 0 repeats
       
       @aliss By hand??? 250k?Like you need to use a tool to do that.
       
 (DIR) Post #AkpGvuHDwt4c7mXgBM by aliss@outerheaven.club
       2024-08-10T13:59:19.318320Z
       
       0 likes, 0 repeats
       
       @Paradox yea i think so, but it's inside .py source code files so not sure what other tool to apply to it
       
 (DIR) Post #AkpHYQOYyvqsk4LG9w by Paradox@raru.re
       2024-08-10T14:06:22Z
       
       1 likes, 0 repeats
       
       @aliss I mean if it's text, it's text. Py just tells python to treat it as python code. You can still treat it like text.I'd go through the file and do find/replace every time I find a word to translate. If you need to specify that it should be in a string, you can use regex for that.If you really wanna get crazy, pipe all the string data into a separate file, feed it into DeepL or whatever, create a csv of translated words (looking it over to make sure everything looks accurate) and then maybe you can use find/replace en masse like that. Honestly not sure how I'd do that last bit, but it sounds like a tool somebody would've made.
       
 (DIR) Post #AkpHxspOPGvuAF1y3k by aliss@outerheaven.club
       2024-08-10T14:10:53.997361Z
       
       0 likes, 0 repeats
       
       @Paradox i appreciate a lot u sharing ideas qtie :celredcrystalheart:im happy to do it by hand i think just find/replacing words en masse would give a very broken sounding result dfkjshgi could use a CAT or llm as u suggested to translate the bulk of it and then adjust nuance manually, but wouldn't that be a pain to then backreference / relate in the original sourcecode?if there's a way to have it in a single "cleaned up" lines/paragraphs view i think i can just wing the translation quite fast & comfortablyhave tried search tools but didn't find yet...
       
 (DIR) Post #AkpIyljsLgEmQDR7HE by Paradox@raru.re
       2024-08-10T14:22:20Z
       
       1 likes, 0 repeats
       
       @aliss It would in some cases, you're right. If we're talking whole sentences and not just single words, then find/replace doesn't work.You could create a copy of the file that prepends the line number to each line, so that you keep track of the line number your translations go to. And the translator shouldn't mess with the numbers.You could probably have a cleaned up view but that depends a little on how much cleaning up you want.I have never heard of a feature that just hides lines. It would be cool if you could collapse individual lines, instead of doing it for code blocks.
       
 (DIR) Post #AkpNRnVZFWTG7iqDbM by aliss@outerheaven.club
       2024-08-10T15:12:22.494924Z
       
       0 likes, 0 repeats
       
       @Paradox btw just yeet'd a vscode extension that kiiinda does that?
       
 (DIR) Post #AkpQtJCTpIzU61itkG by lfourrier@tooter.social
       2024-08-10T15:38:03Z
       
       1 likes, 0 repeats
       
       @aliss don’t know of an editor that does that, but what should happen if your edit make a line no longer match the pattern ?
       
 (DIR) Post #AkpQtMwJvKRPh4C372 by aliss@outerheaven.club
       2024-08-10T15:50:56.403757Z
       
       0 likes, 0 repeats
       
       @lfourrier https://outerheaven.club/notice/AkpNUL4QFrwlYA82XQ
       
 (DIR) Post #AkpaDHu5FxnzSBihiS by risc@nerdculture.de
       2024-08-10T17:15:29Z
       
       1 likes, 0 repeats
       
       @aliss Looks like https://marketplace.visualstudio.com/items?itemName=earshinov.filter-lines can do this. It may not be exactly what you want but it's close.
       
 (DIR) Post #AkpaDLn8nid1VoVDRw by aliss@outerheaven.club
       2024-08-10T17:35:25.549169Z
       
       0 likes, 0 repeats
       
       @risc no, actually it creates a new file with the results of the filter if u try it, defeating the whole goal
       
 (DIR) Post #AkpakPOuP3JqGIvoI4 by janWilejan@snug.moe
       2024-08-10T16:58:46.721Z
       
       1 likes, 0 repeats
       
       @aliss vim has this feature: :h fold-expr. i've never used it and it seems a lil unweildy.
       
 (DIR) Post #AkpakWbvb2tOci4o3U by aliss@outerheaven.club
       2024-08-10T17:41:24.488459Z
       
       0 likes, 0 repeats
       
       @janWilejan i've tried it but haven't made it to work sorry jan im a newbie
       
 (DIR) Post #AkphfDgXEYM29peHpI by capeta@ursal.zone
       2024-08-10T18:50:57Z
       
       1 likes, 0 repeats
       
       @janWilejan @aliss I don't know anything that does that out of the box, but I'm pretty sure it can be done using folds and some scripting on vim.let me test a couple things and I'll get back to you on that.
       
 (DIR) Post #Akphg1k97Ox5PVisOe by aliss@outerheaven.club
       2024-08-10T18:59:03.172066Z
       
       0 likes, 0 repeats
       
       @capeta @janWilejan thx a lot capeta! :celredcrystalheart:
       
 (DIR) Post #Akpup0mNN3BQQmNdYW by capeta@ursal.zone
       2024-08-10T19:31:42Z
       
       1 likes, 0 repeats
       
       @aliss @janWilejan Try this on vim ```function! GrepAndFold(pattern)  normal! zE  nohlsearch  normal! gg  let l:pattern = a:pattern  set foldmethod=manual  let l:fold_start = 1  while search(l:pattern, 'W')    let l:match_line = line('.')    if l:fold_start < l:match_line - 1      exe l:fold_start . "," . (l:match_line - 2) . "fold"    endif    let l:fold_start = l:match_line + 2  endwhile  if l:fold_start <= line('$')    exe l:fold_start . "," . line('$') . "fold"  endif  let @/ = l:pattern  set hlsearchendfunctioncommand! -nargs=1 GrepAndFold call GrepAndFold(<q-args>)```
       
 (DIR) Post #AkpuqKncQEtsoNamsS by aliss@outerheaven.club
       2024-08-10T21:26:35.176584Z
       
       0 likes, 0 repeats
       
       @capeta @janWilejan hey thx a lot! i might be doing something wrong with it
       
 (DIR) Post #AkpvKb0whSFNmyFv6W by aliss@outerheaven.club
       2024-08-10T21:32:03.891032Z
       
       0 likes, 0 repeats
       
       @capeta @janWilejan aaaa i was missing `:set foldmethod?`this is so hemkin cool! thank you!
       
 (DIR) Post #Akq5mhNHe3YZAHk8a8 by capeta@ursal.zone
       2024-08-10T23:23:18Z
       
       1 likes, 0 repeats
       
       @aliss @janWilejan extensible editors <3
       
 (DIR) Post #AkxEmEgqYJbJtaT2DQ by vftdan@mastodon.ml
       2024-08-13T22:57:22Z
       
       1 likes, 0 repeats
       
       @alisscould CtrlSF help by any chance?https://github.com/dyng/ctrlsf.vim