I have been using Emacs for some time but I am quite new for PHP and Web development. I want to use Emacs as a PHP editor.
I have searched a lot of pages and I have found that many people recommend
web-mode for editing mixed PHP and HTML code.
I installed it from MELPA and started using it but I have a problem with curly brackets indentation. As you can see on the attached screenshot I have two blocks of PHP code separated by a small piece of HTML.
It seems that
web-mode cannot recognize that the second block is a continuation of the first one so the curly braces and the else clause are automatically aligned to the left side. This looks very ugly.
I tried to find a solution by reading documentation and searching in Google but I could not find anything helpful.
How can I get this working correctly? Is it something that should be added to the configuration file?
--- WEB-MODE DEBUG BEG --- versions: emacs(26.3) web-mode("17.0.0") vars: engine("php") minor("php") content-type("html") file("x:/www/delete.php") system: window(w32) config("x86_64-w64-mingw32") colors: fg(nil) bg(nil) minor modes: (global-eldoc-mode) vars: web-mode-enable-current-column-highlight=t web-mode-enable-current-element-highlight=nil indent-tabs-mode=t --- WEB-MODE DEBUG END --- You can run the command ‘web-mode-debug’ with M-x w-deb RET --- WEB-MODE DEBUG END ---