What is the difference between using tab vs return for choosing an autocomplete?

(And when should I prefer one over the other?)
In PHP, if I press tab, sometimes phpstorm doesn't just auto complete - it overrwites what is already there. If I press enter, it just inserts the autocomplete. In HTML, using tab to autocomplete can cause the line below the cursor's current line to be moved to the same line I am on, while using return does not cause this behavior.

2 comments
Comment actions Permalink

Hi there,

  • [Enter] just inserts selected entry from code completion popup as is.
  • [Tab] replaces current string with selected entry


Tab is useful when editing existing code (e.g. changing function name to another or changing file name (e.g. image/css/js)

In HTML, using tab to autocomplete can cause the line below the cursor's current line to be moved to the same line I am on, while using return does not cause this behavior.

Not sure at all -- need to see some short screencast with such effect in place.

But quite likely that you are using a Live Template (or Emmet) which triggers code reformat.

0
Comment actions Permalink

Thank you again, Andriy. I will try to get a screencast of this happening and return.

0

Please sign in to leave a comment.