wwwjfy / emacs-fish

fish-mode for emacs
99 stars 15 forks source link

wrong indentation for switch/case #5

Closed fjl closed 10 years ago

fjl commented 10 years ago

The current indent logic treats case as a block that needs to be closed with end. This isn't how fish works. While case should increase the indent level of the following lines, the next case statement acts as an implicit end. An end terminates the surrounding switch.

Here's the example from the fish manual:

switch $animal
    case cat
        echo evil
    case wolf dog human moose dolphin whale
        echo mammal
    case duck goose albatross
        echo bird
    case shark trout stingray
        echo fish
    # Note that the next case has a wildcard which is quoted
    case '*'
        echo I have no idea what a $animal is
end
wwwjfy commented 10 years ago

Thanks for reporting