Caret Position Shift Issue After Switching Apps on macOS

I have just noticed, after I updated to PhpStorm 2024.1.1, there is some kind of annoying inconvenience when coding. When I leave to app and get back, the caret isn't indented anymore. 

Example:

<header>
    <div>
       [CARET]
    </div>
</header>

→ switch app and get back to PS:

<header>
    <div>
[CARET]
    </div>
</header>

That's new behaviour, I haven't noticed before. Is this a bug, intended, or can I adjust to keep the caret being indented? I am not aware of any plugin causing the issue.

- - -

PhpStorm 2024.1.1
Build #PS-241.15989.102, built on April 23, 2024
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.4.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
 

0
2 comments

Is there no official support on this forum anymore?

0

Hi there,

In general: 

  • by default, when you switching to another app, the IDE will be saving currently opened files (check "Settings/Preferences | Appearance & Behavior | System Settings" if you want to change that).
  • by default (IIRC), the IDE should be trimming all trailing spaces on Save. Based on your code sample (as I understand it), you have an empty line (with just spaces) and the caret on it. That also falls under that rule.
    - You can check what options you have for “Settings/Preferences | Editor | General | On Save →  Remove trailing spaces on
    - To keep spaces on the line with caret untouched – ensure that “Keep trailing spaces on caret line” option is checked.
  • If the 2nd option is off, it might be coming from your .editorconfig file (settings from there will overwrite what you have in the IDE GUI, the nature of such files). Check that as well.

 

0

Please sign in to leave a comment.