I added macro {SelectionAsTemp}. plugin is updated.
please test it, my test with "echo {SelectionAsTemp}" (echo is program on linux) works ok.
Reflow Line Breaks by External Tool
-
- Posts: 22
- Joined: 13.07.2024 21:19
Re: Reflow Line Breaks by External Tool
Python's subprocess module can feed an external process stdin. This tutorial uses a dummy process that prints stdin. Could this technique somehow use {SelectedText} without making a temp file?
Code: Select all
import subprocess
import sys
result = subprocess.run(
[sys.executable, "-c", "import sys; print(sys.stdin.read())"], input=b"underwater"
)
-
- Posts: 2265
- Joined: 25.08.2021 18:15
Re: Reflow Line Breaks by External Tool
the python sample for selected-text is:
how can I help more?
Code: Select all
import cudatext as app
sel = app.ed.get_text_sel()
print(sel)
-
- Posts: 22
- Joined: 13.07.2024 21:19
Re: Reflow Line Breaks by External Tool
Yes it works, thank you. I often work with unsaved documents, so the function text2temp in py/cuda_exttools/cd_exttools.py created a file called "_sel." for lack of naming tags. I will post separately about temp files in general.main Alexey wrote: ↑27.08.2024 09:42 I added macro {SelectionAsTemp}. plugin is updated.
please test it, my test with "echo {SelectionAsTemp}" (echo is program on linux) works ok.
I will play around with these ideas, thanks again for your quick feedback and tool updates.