Skip to content
This repository has been archived by the owner on May 1, 2022. It is now read-only.

indentation not working if filetype=hack #51

Open
blurrcat opened this issue Nov 10, 2021 · 1 comment
Open

indentation not working if filetype=hack #51

blurrcat opened this issue Nov 10, 2021 · 1 comment

Comments

@blurrcat
Copy link

Steps to reproduce:

  • create new file "test.hack"
  • add the following content
function test() {
$a = 1;
}

Action: gg=G to indent whole file

Expected Result: file should be indented properly

function test() {
    $a = 1;
}

Actual:

function test() {
$a = 1;
}

However it works if we place the function in a php file like

<hh
function test() {
$a = 1;
}

I see that indent expression for hack is GetHackIndent, which uses GetPhpIndent under the hood. However, according to :h php-indent, php indenting only works if PHP syntax is active. Maybe it's time to create an index expression dedicated to Hack?

@zheltikov
Copy link

zheltikov commented Feb 19, 2022

I can confirm this issue. I have the same problem whenever I create any new code block in an existing file. For example when I add a new if block, it doesn't get properly indented.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants