Recommended Posts

Is it only me, or the code indentation never works the way I want it to and code-copy doesn't function as intended?

 

function fnc()
	if()
  		code()
  		if()
    		code()
    	end
  	end
end

-> The code in "preview" mode looks like this:

function fnc()
 if()
    code()
    if()
      code()
     end
   end
end

 

I see there's like a bag icon (looks like a bag to me, might be something else), which in theory should only copy the code without line numbers right? Well for me, it copies the code like this:

1.function giveBombToRandomPlayer1()

2.	   local players = getPlayersInTeam ( T )

3.          for playerKey, playerValue in ipairs ( players ) do

4.            local randomPlayer = getRandomPlayer ()

5.		         setTimer(function()

6.		           outputChatBox("You have the bomb!", randomPlayer, 255, 0, 0)

7.		            outputChatBox("Remember when you enter site.. switch to the C4 to plant!", randomPlayer, 255, 0, 0)

8.		               giveWeapon ( randomPlayer, 14,1,true)

9.		         end,6000,1)	

10.	    end

11.end

 

Share this post


Link to post

That's strange.  Everything works here - including the copy function.

 

function fnc()
 if()
    code()
    if()
      code()
     end
   end
end

What browser are you using?

Share this post


Link to post

Sorry, I didn't see your reply. Looks like the problem happens when I do a manual tab in the code editor. If you look at the code editor below and the code I will insert, you will see what I mean. I'm using Google Chrome Version 56.0.2924.87 (from work, not able to update) but I sometimes use IE as well, that is when I have the problem with copying code, but that never happens in Chrome (don't blame me for using IE, needed for production development). But strangely enough it can be fixed by removing the 'tabs' completely, clicking on insert, editing the code again and adding the exact same tabs.

function() -> manual tabs
  	if true then
    	if true then
  			myFunction()
      		myFunction()
    	end
  	end
end

function() -> auto tabs
  if true then
    if true then
      myFunction()
      myFunction()
    end
  end
end

 function() -> manual tabs
      if true then
        if true then
              myFunction()
              myFunction()
        end
      end
end

Edited by pa3ck

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.