You are not logged in.

#21 2024-11-30 00:18:35

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,547
Website

Re: Do Any Text Editors/IDEs Have Automatic Formatting?

MarkW wrote:

Would an improperly formatted script still work?

No, at least with shell scripts, because the line breaks have meaning.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#22 2024-11-30 00:24:40

marens
Member
From: World without M$
Registered: 2023-02-02
Posts: 827

Re: Do Any Text Editors/IDEs Have Automatic Formatting?

MarkW wrote:

I tried with a local file.  It's the copy/pasting

Would an improperly formatted script still work?

You didn't tell us what browser you're using.

You can try xclip.
Xclip is the perfect tool for accessing the contents of the clipboard from the command line, or for placing text on the clipboard.

It needs to be installed first:

sudo apt install xclip

Select some text or code (script) here (BL-forums).

Open a terminal and type (don't use copy/paste):

xclip -out -selection primary > test_file.txt

In your HOME folder you will get test_file.txt.
Open it with a text editor.
Is the content the same as the one that was selected?

EDIT

This is the page you are interested in:
https://forums.bunsenlabs.org/viewtopic.php?id=8984

I selected a few lines at the beginning of the script:

selected.png

Terminal:

xclip -out -selection primary > test_file.txt

Then I opened test_file.txt with a text editor:

gedit.png

Everything looks right.

Last edited by marens (2024-11-30 15:10:20)


If people would know how little brain is ruling the world, they would die of fear.

Offline

#23 2025-01-22 19:21:20

greenjeans
Member
Registered: 2025-01-18
Posts: 227
Website

Re: Do Any Text Editors/IDEs Have Automatic Formatting?

Late to the party here, but I can report that copy/pasting the referenced script works perfectly for me in Pluma. Been using it ever since they forked it from Gedit, my favorite text editor, it even does a pretty good job of preventing me from screwing up when trying to write new stuff. You can even embed a terminal in the bottom panel and enable it, and use that to run shellcheck which further helps a novice like me to write some useable scripts.

ETA: Also helpful if you're writing something that needs a lot of yad boxes and you need to test them repeatedly to get it just right.

Last edited by greenjeans (2025-01-22 19:25:16)

Offline

Board footer

Powered by FluxBB