prettier / plugin-php

Prettier PHP Plugin

Home Page:https://loilo.github.io/prettier-php-playground/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

bdlowery opened this issue · comments

commented

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!