Eclipse adds extra lines at the bottom of the code

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Forum rules
Post Reply
steam
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Mar 24, 2006 2:44 am

Eclipse adds extra lines at the bottom of the code

Post by steam » Mon Jan 28, 2008 3:26 pm

I didn't know where to post this question so i'll try to post it here. I hope it's right forum.

My probelm is related to Eclipse IDE.
I've installed Eclipse PDT All-in-one edition on my Windows Vista desktop computer.
Every time I save my file it adds last lines of the code that already exists. I can first see the problem when i close the file and reopen it again.

For exammple if i edit the file containing these lines at the bottom:

Code: Select all

<div id="footer"></div>
</body>
</html>
<?php
 some_function();
?>


Now when I save file above it results in the following problem:

Code: Select all

<div id="footer"></div>
</body>
</html>
<?php
 some_function();
?>
html>
<?php
 some_function();
?>



What it does is that Eclipse copies several lines at the bottom of my code and pastes it.

Please help if anyone knows what this trouble depends on. I have googled several hours without result.

Thank you in forward.

User avatar
CirTap
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Mon Dec 12, 2005 5:34 pm
Contact:

Re: Eclipse adds extra lines at the bottom of the code

Post by CirTap » Mon Jan 28, 2008 6:57 pm

Hi,

I've never seen such a strange behaviour. Does it happen with all files or just a specific "type" (extension)?
Have you already run an update from "Help > Software updates" ?
Did this error happen aftern a recent update?
What "brand" or distribution of Eclipse do you use? Native Eclipse IDE with any PHP plugin, PDT, Aptana, JCode, phpEclipse ...

You may try the following (I'm really guessing here)
Select the project properties and check "New text file line delimiter". It should be empty (inherit from container).
Close the file if it's open, then select the file in the navigator pane and choose "File > Convert line Delimiters to > Unix"; reopen the file, make your edits, save and check if it's ok.

What editor component did you use to edit the file? html, text, php,..?
Eclipse ships with several editors and you can use a different editor per individual file.
Right-click the bogus file, select "Open with": which editor has a bullet? That's the current editor for*this* file. It shoud read "PHP Editor", if it does not, select "Default editor" and check again. Is "PHP Editor" now the default? If not, which one?

CirTap
You can have programs written fast, well, and cheap, but you only get to pick 2 ...

"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams

steam
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Mar 24, 2006 2:44 am

Re: Eclipse adds extra lines at the bottom of the code

Post by steam » Tue Jan 29, 2008 9:52 pm

Hello,

Thank you alot for your answer.

I've tried to do what you've written above but without success.

Yes, this is very strange problem. I have exactly the same problem with Zend Neon which is build upon Eclipse.
I've even done uninstall of Java JRE and reinstalled the JRE version 5 because it's what Eclipse requires. It does not help anyway.

I run stable eclipse version. See below:
Version: 3.3.1.1
Build id: M20071023-1652

This occurs on all files does not metter what file extension it is.  >:(

Well I'll try to install some nightly build and see if it helps. Otherwise I'll remove Vista crap from my computer.

Regards

User avatar
CirTap
Joomla! Intern
Joomla! Intern
Posts: 73
Joined: Mon Dec 12, 2005 5:34 pm
Contact:

Re: Eclipse adds extra lines at the bottom of the code

Post by CirTap » Wed Jan 30, 2008 2:05 pm

Hi,

too bad it wasn't that simple to solve :-)

It sounds like you have both IDEs installed ??? Do they share the same workspaces, or projects? If so, avoid that! Might be inconvenient, but avoid it.
Please create a brand new plain workspace at some different location (File > Switch Workspace) and create a new project inside so it does not interfere with any previous projects or folders. Don't have it point to any subfolder that may contain previous workspace or project files.

CirTap
You can have programs written fast, well, and cheap, but you only get to pick 2 ...

"I love deadlines. I like the whooshing sound they make as they fly by." Douglas Adams

steam
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Mar 24, 2006 2:44 am

Re: Eclipse adds extra lines at the bottom of the code

Post by steam » Thu Jan 31, 2008 9:28 am

Thanks again for your reply.

I already had different workspaces for Neon and Eclipse.

Will see what happens when I return from my job today if I manage to solve this problem.

/Steam


Post Reply