jonsmithers / vim-html-template-literals

Syntax highlighting for html template literals in javascript (as in lit-html and polymer 3)
MIT License
71 stars 10 forks source link

Indention Regression found from experimental to v1 #9

Closed dman777 closed 5 years ago

dman777 commented 6 years ago

I noticed on the latest version indention is broken where

              <paper-input
                name="zipcode" 
hitting enter returns
 HERE

Where a old version of experimental

              <paper-input
                name="zipcode" 
               hitting enter returns 
               HERE

Here is the current after/indent/javascript.vim with broken indention Here is a old version where indention is working

NOTE: Also found indention breakage in CSS that did not exist in old version

jonsmithers commented 6 years ago

I tried reproducing the html issue you described but it seems to work fine for me.

terminal animation which demonstrates of working indentation

acarapetis commented 5 years ago

I'm experiencing this too, but I also observe it when editing a .html file; so I don't think it's an issue with vim-html-template-literals. Using a very minimal vimrc (only filetype plugin indent on), I have this problem in both nvim and vim8, but not in vim7.4. Edit: the problem goes away when I enable expandtab. Looks like the stock vim indentation plugin was broken for a long while when using tab indentation. I upgraded to neovim 0.3.2 and it's fixed.

jonsmithers commented 5 years ago

Interesting... If this is a vim html indent bug, it would be inherited by this plugin, so that makes a lot of sense.

I too can replicate this with vim 8 in an html file when I set noexpandtab.

jonsmithers commented 5 years ago

I noticed that this bug disappears for me on vim 8.1 when I uninstall the othree/html5.vim plugin. This suggests to me that vim 8's built-in html indentation has been fixed.

voondo commented 4 years ago

I also have this bug on vim 8.1. But no problem with an html file. Any idea ?

Vim version 8.1.2402

.vimrc:

execute pathogen#infect()
syntax on
filetype plugin indent on
let g:html_indent_style1 = "inc"
~/.vim/bundle $ ls 
vim-html-template-literals  vim-javascript
jonsmithers commented 4 years ago

Hm. I tried compiling and installing that vim version, but could not reproduce the issue with/without noexpand. Also, $VIMRUNTIME/indent/html.vim hasn't been updated since March. I'm not sure what variable is preventing me from replicating the issue.