Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » newline after single line comment returns cursor to column 1
newline after single line comment returns cursor to column 1 [message #36364] Tue, 17 July 2007 13:51 Go to next message
Phil Moorhouse is currently offline Phil MoorhouseFriend
Messages: 3
Registered: July 2009
Junior Member
I'm using Eclipse 3.3.0 and the latest stable release of PDT.

When you enter a single line comment and then press return/enter, the
cursor returns to the beginning of the next line, and not the column
position the text on the previous line started at, as it does with
non-comments.

i.e.
......$foo = 'bar';
......|
^ cursor here on return / enter

......// this is a comment
|
^ cursor here on return / enter


Is this by design or is it a bug? I don't recall this behaviour before I
upgraded from eclipse 3.2 but maybe I'm mistaken. Is there a way to force
it to behave?
Re: newline after single line comment returns cursor to column 1 [message #36929 is a reply to message #36364] Wed, 18 July 2007 16:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nobody.spamcop.net

Phil Moorhouse (lazymanc@gmail.com) wrote in
news:183c83b2241da21faa85541036e1e888$1@www.eclipse.org:

> I'm using Eclipse 3.3.0 and the latest stable release of PDT.
>
> When you enter a single line comment and then press return/enter, the
> cursor returns to the beginning of the next line, and not the column
> position the text on the previous line started at, as it does with
> non-comments.
>
> i.e.
> .....$foo = 'bar';
> .....|
> ^ cursor here on return / enter
>
> .....// this is a comment
>|
> ^ cursor here on return / enter
>
>
> Is this by design or is it a bug? I don't recall this behaviour before
> I upgraded from eclipse 3.2 but maybe I'm mistaken. Is there a way to
> force it to behave?

Unfortunately, that's only one small part of the story. I found a lot of
really weird indenting/outdenting behavior in PDT's PHP editor (using
TABs for indenting, as is our coding standard):

- select a block of code below/inside an opening bracket and hit TAB
(once) and it will result in an extra indent of *three* tabs
- select a block of code that's indented too far and hit Shift+Tab
(once) to outdent it: the result is a block of code that loses ALL its
indenting instead of outdenting by one tab; if there were several indent
levels, restoring those can be a lot of work
- copy a line from one PHPdoc block to another: the result is an extra
space + * + space at the start of the next line which then have to be
removed to end up with a normal PHPdoc(umentor) block
- there does not seem to be *any* sense of "auto-indent" maintaining the
indent level of the previous line (as your case above illustrates - but
this happens in more circumstances)

An other issue is that I have been unable to find a setting to remove
EOL whitespace when saving a file; removing that manually or in an
external editor again is a lot of extra time-wasting work.

These add up to a lot of time lost (and irritation) when doing just
simple edits - it's actually easier to edit a file in Aptana's PHP
editor, or even using the simple Crimson Editor as an external editor
(which has the extra advantage that it supports column mode as well).

--
Marjolein Katsma
* Travel blog: http://blog.iamback.com/
* Spam reporting addresses: http://banspam.javawoman.com/report3.html
Re: newline after single line comment returns cursor to column 1 [message #37300 is a reply to message #36929] Thu, 19 July 2007 15:07 Go to previous message
Eclipse UserFriend
Originally posted by: nobody.spamcop.net

Marjolein Katsma (nobody@spamcop.net) wrote in
news:Xns9971BB22DC953iambackeclipse@206.191.52.34:

> Phil Moorhouse (lazymanc@gmail.com) wrote in
> news:183c83b2241da21faa85541036e1e888$1@www.eclipse.org:
>
>> I'm using Eclipse 3.3.0 and the latest stable release of PDT.
>>
>> When you enter a single line comment and then press return/enter, the
>> cursor returns to the beginning of the next line, and not the column
>> position the text on the previous line started at, as it does with
>> non-comments.
[snip]
>
> Unfortunately, that's only one small part of the story. I found a lot
> of really weird indenting/outdenting behavior in PDT's PHP editor
> (using TABs for indenting, as is our coding standard):
>
> - select a block of code below/inside an opening bracket and hit TAB
> (once) and it will result in an extra indent of *three* tabs

I found the cause of this was 'just' a confusing interface (what I call a
UI bug ;)):

> - select a block of code that's indented too far and hit Shift+Tab
> (once) to outdent it: the result is a block of code that loses ALL its
> indenting instead of outdenting by one tab; if there were several
> indent levels, restoring those can be a lot of work

This *may* be caused by the same setting as above but I've not confirmed
this yet.

> - copy a line from one PHPdoc block to another: the result is an extra
> space + * + space at the start of the next line which then have to be
> removed to end up with a normal PHPdoc(umentor) block

Added note: pasting is NOT typing. Adding an extra space and * when
hitting enter at the end of a line to start a new one is desired (and
expected) behavior when inside a PHPdoc block. It is *not* expected or
even desirable behavior when pasting a whole line.

> - there does not seem to be *any* sense of "auto-indent" maintaining
> the indent level of the previous line (as your case above illustrates
> - but this happens in more circumstances)
>
> An other issue is that I have been unable to find a setting to remove
> EOL whitespace when saving a file; removing that manually or in an
> external editor again is a lot of extra time-wasting work.

More:

- when selecting one or more spaces and hitting TAB I'm expecting the
selected text (spaces) to be *replaced* by the TAB character (or spaces if
you've set tabs to be translated to spaces); but often this does not
happen, and instead the selected text is only *removed* and you need an
extra TAB to actually get one.
- the behavior of the HOME and END keys is confusing (and time-wasting) as
well - and does not seem to be configurable either:
- HOME normally jumps to the first non-blank character on the line,
or to the start of the line (and this is normally configurable);
here it jumps to the first non-blank character of the line *unless*
the line is a comment, in which case it jumps to the first non-blank
character after the character(s) that start the comment: to reach
the start of the line you now have to hit HOME three times!
- END likewise does not jump to the actual end of the line, but to
just after the last non-blank character of the line: if you don't
have 'show whitespace characters' turned on, this makes it even
harder to remove EOL whitespace since this doesn't happen
automatically either.

- line splitting behavior is also weird: when I hit Enter just after a
space, the space is left at the end of the line (see above), but when I do
so *before* a space in a comment, intending to add a single-line comment
starter to the new line, that starting space _is_ removed so I have to add
it all over again.

Indenting and whitespace handling still has a ways to go... :(

--
Marjolein Katsma
* Travel blog: http://blog.iamback.com/
* Spam reporting addresses: http://banspam.javawoman.com/report3.html
Previous Topic:turn off php syntax checker
Next Topic:Cannot open file in PHP editor
Goto Forum:
  


Current Time: Thu Apr 25 04:32:50 GMT 2024

Powered by FUDForum. Page generated in 0.02635 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top