plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

Cursor jumps to start of file after formatting javascript inside of a php file.

Open bdlowery opened this issue 2 years ago • 3 comments

prettier version: 2.8.3 Prettier-PHP version: 0.19.3

Steps to reproduce the behavior:

open a .php file with html, php, and a script tag in it go down to the script tag save the document your cursor will jump to the start of the document.

I'm using Sublime, so I'm using the JsPrettier plugin. Here are my JsPrettier settings:

{
	"debug": true,
	"auto_format_on_save": true,
	"additional_cli_args": { "--config-precedence": "file-override" },
	"custom_file_extensions": ["php"],
	"allow_inline_formatting": true,
}

The maintainer of prettier on sublime seems to think it's because the Prettier-PHP plugin isn't following the cursor API.

Anyone else run into this issue? It's super annoying!

bdlowery avatar Feb 16 '23 20:02 bdlowery

Same. I think it's a JsPrettier issue.

ryanburnette avatar Nov 17 '24 21:11 ryanburnette

Same. I think it's a JsPrettier issue.

yeah. I gave up and moved to vscode.

bdlowery avatar Nov 17 '24 21:11 bdlowery

Ha. Same.

ryanburnette avatar Nov 18 '24 03:11 ryanburnette