This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
remiX's profile picture

Google Chrome doesn't keep indentation upon copy / pasting

Started by remiX, 11 January 2013 - 10:31 AM
remiX #1
Posted 11 January 2013 - 11:31 AM
I recently changed to Google Chrome from FireFox and ever since, my copy and pasting into threads never keeps it's indentation.

I just tested it with firefox now and the indentation kept right.

Anyway to fix this?
theoriginalbit #2
Posted 11 January 2013 - 11:36 AM
well Firefox is the only one i know of that does keep it! :o/> Safari doesn't, neither does Opera
crazyguymgd #3
Posted 11 January 2013 - 11:50 AM
I use Sublime and Chrome. Indentation works every time :)/>
remiX #4
Posted 11 January 2013 - 02:50 PM


test
test
test

Yeah, I copied that from Sublime Text 2 and it still doesn't keep the indentation. How does yours keep it crazyguymgd? :blink:/>
PixelToast #5
Posted 11 January 2013 - 02:59 PM
.-. it works for me
win 7 / XP with firefox and np++
remiX #6
Posted 11 January 2013 - 03:16 PM
.-. it works for me
win 7 / XP with firefox and np++

I know firefox works, I'm talking about chrome :P/>

I use Sublime and Chrome. Indentation works every time :)/>

Btw, what OS do you have?
crazyguymgd #7
Posted 11 January 2013 - 03:28 PM
I took a look at my settings, and did some test copy and pastes which resulted in a solution!
Under view - indentation select convert indentation to spaces.
Then problem solved

example:


function foo1 do
	print("I wish I was food")
	if food == chicken then
		eatTheChicken()
	end
end

-- After I changed more settings (Tab Width: 2, Indent using spaces)

function foo1 do
  print("I wish I was food")
  if food == chicken then
	eatTheChicken()
  end
end

crazyguymgd #8
Posted 11 January 2013 - 03:29 PM
although now I have to go back and fix all the settings I just changed. As you can see, way too many spaces there.
remiX #9
Posted 12 January 2013 - 03:27 AM
Yeah but I use Notepad++.

Hmm, I'll take a look at the settings and see If i find anything…

I use sublime for html/css coding, but not lua :P/>
BigSHinyToys #10
Posted 12 January 2013 - 03:51 AM
I use Notepad++ and opera tab as space and it always looses indention. I use the replace function to swap out tabs for four spaces.
not a prefect solution but works well enough. I always provide a pastebin as well with tabs my original source.
remiX #11
Posted 12 January 2013 - 04:45 AM
How do you search for a tab? Clicking tab in the box goes into the next box xD
BigSHinyToys #12
Posted 12 January 2013 - 04:50 AM
You can select the tab. then open the replace menu. or select it right click copy and paste it into the replace menu.
Spoiler
remiX #13
Posted 12 January 2013 - 07:27 AM
Oh yeah, forgot about that hmm….

I tried it and then it says "Cannot find text: " " " :/

Nice code there btw :P/>
KaoS #14
Posted 12 January 2013 - 10:00 AM
I use Chrome and had the same issue as you, there is a way around it though. it does not remove all indentation, it only removes the first tab at the beginning of each line (if there is one) so to get it correctly you open your file, press
CTRL+A
TAB
CTRL+C
SHIFT+TAB

then open the code tags and paste it in, the code tags auto change each tab into 2 spaces however you lose all of your double line breaks so you have to re-space your code :(/> give that a try and let me know how it works
remiX #15
Posted 12 January 2013 - 11:05 AM
function test()
print("hi")
term.setCursorPos(12, 3)
end

Still doesn't work :


function test()
	print("hi")
	term.setCursorPos(12, 3)
end

edit: The pasting works if I have 'editing mode' enabled within the post. Guess I'll be doing that from now on :P/>
Kingdaro #16
Posted 12 January 2013 - 04:42 PM


EDIT: that's what you did, didn't you?

meh.
remiX #17
Posted 12 January 2013 - 11:37 PM


EDIT: that's what you did, didn't you?

meh.

Yes, if you hover over it, it's known as the editing mode (atleast what I think it is :P/>) and that is what I did xD

But as you can see the indentation is like massive ._.

ps: your paint skills are amazing, the arrow is just perfect ;)/>