Parameter Name Hints and cursor position

Answered

When I enable the Parameter Name Hints the cursor position is in wrong place when I need to edit the first symbol of a parameter.

Above you see that to edit the x1 I needed to put the cursor before the hint. That is supposed to work like that by design???

Thank you so much.

 

1
8 comments

Thanks for the information. You can follow https://youtrack.jetbrains.com/issue/VIM-1229 for updates.

1

I just upgraded to 2017.1 and it was the first thing I noticed what I started working. I all of a sudden had these hints showing up. I've set them to toggle on and off using a hot key, so I think I'll leave them off and only enable them when I need the hint. But what is really odd is when I move the cursor left and right using the cursor keys, the cursor is never on the first character of the actual parameter. When the cursor is moved from the 2nd character of a parameter to the 1st character of the parameter, the cursor jumps to the left onto an empty space that is to the left of the hint. That's very confusing. Much better would be if the cursor is never on any of the hint. It is not the hint itself that is editable, so logically, the cursor should never be able to be *on* the hint.

1

This behavior is intentional. We tested different variants when this feature was implemented and the majority of the users preferred the current behavior. It was also approved by our UX team.

There is a related ticket, please feel free to vote/comment: https://youtrack.jetbrains.com/issue/IDEA-163255.

1

Not sure I understand the problem. What happens if you place it after the hint? Do you mean that you can't edit the value by clicking on it?

0

Lets say that I want modify the first parameter (the one that contains 0), to edit the parameter I have to put the cursor before "x1:" (the hint), otherwise it doesn't work.

Thank you @Serge, I hope you understand. Sorry, english is not my native language! :)

Now another example trying to change one parameter from 1 to 2:

0

With Insert mode enabled I can edit the value in both cases: when the caret is before the hint and if the caret is on the parameter itself. Do you mean that second case doesn't work for you and when you are in Insert mode you can change the parameter only when the caret is before the hint?

0

Yes, second case doesn't work for me. I can't put the cursor above the "1" (first parameter), the closest I can move is before the hint or one character after the "1" (what would be the parenthesis).

I discovered the problem, it is with ideavim moving the cursor in the normal mode. Thank you @Serge.

I'll disable hints till they fix it.

0

Sorry for coming back 4 years later but I'm trying to understand why there is an extra cursor position before the hint's label at all. I expect the cursor positions to be the same regardless of if I have parameter name hints enabled or disabled (or any other Inlay hints).
It doesn't make sense to me to have to press an extra time the cursor keys to go over the label's hint and find it very annoying when I know by heart where the cursor should be.
My point is that the label's hint is not part of my code and just a visual aid so it shouldn't create additional places for the cursor to be placed in.
Does anybody know if there is a place to configure this?
I'm trying to understand if this is intentional behaviour because thinking on raising a bug. Thanks.
(I'm using IntelliJ 2020.3.2)

0

Please sign in to leave a comment.