Cursor Placement after "Introduce Variable"

I haven't tried the latest builds yet (I will very soon), but I've noticed a
quirk that has proven to become almost annoying in much of my recent coding.
I'm doing a lot of "Introduce Variable" refactorings, where I type an
expression, and then Introduce Variable. This completes the statement, even
adding the semicolon (nice!) ... and then places the cursor in a position
that is just never what I want.

Right now, the cursor is positioned at the very beginning of the NEXT line
with text. Even if there's a blank line below the line I was on. No new
line is opened, or anything. I'd rather the cursor be placed at the END of
the current line, so I can just press enter and keep on going. As it is
now, I have to move my hands out of home row position to either use the
arrows or the mouse to reposition the cursor and then open a new line for
typing, etc.

Is there a reason for the current cursor placement, and would it be possible
to have the cursor stay on the same line, just move to the very end instead?
That would seem to handle both cases... one where I want to open a new line
under the current one to type more code (I just press enter like I normally
would), as well as the case where I'm modifying existing code and DON'T want
to add a new line.

I'm curious what others' thoughts are on this?


7 comments
Comment actions Permalink

I could not reproduce this bug. For me the caret is always positioned at
the end of the line with introduced variable. Is this bug always reproducable
for you?

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I haven't tried the latest builds yet (I will very soon), but I've
noticed a quirk that has proven to become almost annoying in much of
my recent coding. I'm doing a lot of "Introduce Variable"
refactorings, where I type an expression, and then Introduce Variable.
This completes the statement, even adding the semicolon (nice!) ...
and then places the cursor in a position that is just never what I
want.

Right now, the cursor is positioned at the very beginning of the NEXT
line with text. Even if there's a blank line below the line I was on.
No new line is opened, or anything. I'd rather the cursor be placed
at the END of the current line, so I can just press enter and keep on
going. As it is now, I have to move my hands out of home row position
to either use the arrows or the mouse to reposition the cursor and
then open a new line for typing, etc.

Is there a reason for the current cursor placement, and would it be
possible to have the cursor stay on the same line, just move to the
very end instead? That would seem to handle both cases... one where I
want to open a new line under the current one to type more code (I
just press enter like I normally would), as well as the case where I'm
modifying existing code and DON'T want to add a new line.

I'm curious what others' thoughts are on this?



0
Comment actions Permalink

It never behaves any differently for me. But like I said, I'm not using the
latest build right now. It ALWAYS puts the cursor at the very beginning of
the next line with text in it.

"Valentin Kipiatkov (JetBrains)" <valentin@jetbrains.com> wrote in message
news:396495632425251132698321@news.intellij.net...
>I could not reproduce this bug. For me the caret is always positioned at
>the end of the line with introduced variable. Is this bug always
>reproducable for you?
>

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> I haven't tried the latest builds yet (I will very soon), but I've
>> noticed a quirk that has proven to become almost annoying in much of
>> my recent coding. I'm doing a lot of "Introduce Variable"
>> refactorings, where I type an expression, and then Introduce Variable.
>> This completes the statement, even adding the semicolon (nice!) ...
>> and then places the cursor in a position that is just never what I
>> want.
>>
>> Right now, the cursor is positioned at the very beginning of the NEXT
>> line with text. Even if there's a blank line below the line I was on.
>> No new line is opened, or anything. I'd rather the cursor be placed
>> at the END of the current line, so I can just press enter and keep on
>> going. As it is now, I have to move my hands out of home row position
>> to either use the arrows or the mouse to reposition the cursor and
>> then open a new line for typing, etc.
>>
>> Is there a reason for the current cursor placement, and would it be
>> possible to have the cursor stay on the same line, just move to the
>> very end instead? That would seem to handle both cases... one where I
>> want to open a new line under the current one to type more code (I
>> just press enter like I normally would), as well as the case where I'm
>> modifying existing code and DON'T want to add a new line.
>>
>> I'm curious what others' thoughts are on this?
>>
>



0
Comment actions Permalink

Does it behave this way for anybody else here?

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

It never behaves any differently for me. But like I said, I'm not
using the latest build right now. It ALWAYS puts the cursor at the
very beginning of the next line with text in it.

"Valentin Kipiatkov (JetBrains)" <valentin@jetbrains.com> wrote in
message news:396495632425251132698321@news.intellij.net...

>> I could not reproduce this bug. For me the caret is always positioned
>> at the end of the line with introduced variable. Is this bug always
>> reproducable for you?
>>
>> Valentin Kipiatkov
>> Chief Scientist, Vice President of Product Development
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> I haven't tried the latest builds yet (I will very soon), but I've
>>> noticed a quirk that has proven to become almost annoying in much of
>>> my recent coding. I'm doing a lot of "Introduce Variable"
>>> refactorings, where I type an expression, and then Introduce
>>> Variable. This completes the statement, even adding the semicolon
>>> (nice!) ... and then places the cursor in a position that is just
>>> never what I want.
>>>
>>> Right now, the cursor is positioned at the very beginning of the
>>> NEXT line with text. Even if there's a blank line below the line I
>>> was on. No new line is opened, or anything. I'd rather the cursor
>>> be placed at the END of the current line, so I can just press enter
>>> and keep on going. As it is now, I have to move my hands out of
>>> home row position to either use the arrows or the mouse to
>>> reposition the cursor and then open a new line for typing, etc.
>>>
>>> Is there a reason for the current cursor placement, and would it be
>>> possible to have the cursor stay on the same line, just move to the
>>> very end instead? That would seem to handle both cases... one where
>>> I want to open a new line under the current one to type more code (I
>>> just press enter like I normally would), as well as the case where
>>> I'm modifying existing code and DON'T want to add a new line.
>>>
>>> I'm curious what others' thoughts are on this?
>>>


0
Comment actions Permalink

Hello Valentin,

VK> Does it behave this way for anybody else here?
I didn't see such problems with introduce variable.


0
Comment actions Permalink

This makes me curious. I do Ctrl-Alt-V, type in the new name of the
variable, hit enter, and the cursor is ALWAYS positioned on the next line
(the line I was on is 'completed' and a semi-colon added to the end).

You're telling me this isn't what you see??

"Ilya Ryzhenkov" <orangy@netix.ru> wrote in message
news:174140632428122109218750@news.jetbrains.com...

Hello Valentin,

>

VK> Does it behave this way for anybody else here?
I didn't see such problems with introduce variable.



0
Comment actions Permalink

Hello Paul,

could you please post a screenshot illustrating the issue? The source file
on the screenshot is better to be small so
that it fits into the editor window without scrollbars.

Thanks in advance.

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

This makes me curious. I do Ctrl-Alt-V, type in the new name of the
variable, hit enter, and the cursor is ALWAYS positioned on the next
line (the line I was on is 'completed' and a semi-colon added to the
end).

You're telling me this isn't what you see??

"Ilya Ryzhenkov" <orangy@netix.ru> wrote in message
news:174140632428122109218750@news.jetbrains.com...

>> Hello Valentin,
>>
>> VK> Does it behave this way for anybody else here? I didn't see such
>> problems with introduce variable.
>>


0
Comment actions Permalink

No need. I updated with the latest build (RC3) and now the behavior is as I
would expect.

Interesting :)

But at least the issue is resolved!

"Dmitry Shaporenkov" <dsha@jetbrains.com> wrote in message
news:9413632428852867042106@news.intellij.net...

Hello Paul,

>

could you please post a screenshot illustrating the issue? The source file
on the screenshot is better to be small so that it fits into the editor
window without scrollbars.

>

Thanks in advance.

>

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> This makes me curious. I do Ctrl-Alt-V, type in the new name of the
>> variable, hit enter, and the cursor is ALWAYS positioned on the next
>> line (the line I was on is 'completed' and a semi-colon added to the
>> end).
>>
>> You're telling me this isn't what you see??
>>
>> "Ilya Ryzhenkov" <orangy@netix.ru> wrote in message
>> news:174140632428122109218750@news.jetbrains.com...
>>
>>> Hello Valentin,
>>>
>>> VK> Does it behave this way for anybody else here? I didn't see such
>>> problems with introduce variable.
>>>
>



0

Please sign in to leave a comment.