Codes automatically changed

Hi,

I know this issue is a bit silly but it happens to me several times. In PHPstorm, it move some lines of code automatically even when my computer is locked. It change the order of my lines and it shows the file as a changed file in commit list.

What can I do?

9 comments

What shortcut do you use for locking the workstation, is it Ctrl+Alt+L?

0

Ctrl+Alt+L is for reformatting on my IDE. I am working on Windows so I use Winkey+L

0

Could you please attach a screenshot of a code changed (e.g. using diff view) for us to understand how exactly the code changed?

0

When the file is changed, can you see the action in Edit > Undo? Like "Undo Move Line Down" or something else?

Are there any file watchers that could do the change?

0

Actually I do not know the exact time of change. Imagine this situation that I open the file and apply my changes. close it and go to the next file. In some cases this process takes more than one day and finally I commit all changed files. After uploading the files on server, the customer report a bug and I trace it and find that there is some unwanted changes.

0

>Actually I do not know the exact time of change.

Please use Local History and see what it has to say about such change (when it was introduced).

 

But in general: the code on screenshot -- looks like "Code | Move Statement Up" was used on it. So the questions are:

  • What shortcut it has?
  • What other actions that you use often have similar shortcuts?
  • What other languages/keyboard layouts do you use (except English)? What the shortcut to change it in your OS?

Right now I'm thinking that it could be related to language/layout switching or text selection that may somehow accidentally trigger it. It may also be some IDE bug when you do that in some dialog window/popup but that command (or shortcut) gets send to the Editor instead (obviously, the file must be opened and be currently active tab to get such unwanted input).

0

I am using default shortcut keys.

Also I have just one another keyboard layout for Persian which switches using Alt+Shift.

For line moving I use Ctrl+Shift+[Arrow down and up]. I do not have similar shortcut key.

I will monitor precisely these changes from now on to find the exact situation

0

Please sign in to leave a comment.