Skip to content

fix ftplugin var and clean indent #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion after/ftplugin/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@

setlocal iskeyword+=$ suffixesadd+=.js

let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= ' | setlocal iskeyword< suffixesadd<'
else
let b:undo_ftplugin = 'setlocal iskeyword< suffixesadd<'
endif
4 changes: 2 additions & 2 deletions indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
" Acknowledgement: Based off of vim-ruby maintained by Nikolai Weibull http://vim-ruby.rubyforge.org
" Last Change: July 29, 2016

" Only load this indent file when no other was loaded.
if exists("b:did_indent")
Expand Down Expand Up @@ -56,7 +57,7 @@ func s:lookForParens(start,end,flags,time)
endtry
endfunc

let s:line_term = '\s*\%(\%(:\@<!\/\/.*\)\=\|\%(\/\*.*\*\/\s*\)*\)$'
let s:line_term = '\s*\%(\/\*.*\*\/\s*\)*\%(:\@<!\/\/.*\)\=$'

" configurable regexes that define continuation lines, not including (, {, or [.
if !exists('g:javascript_opfirst')
Expand Down Expand Up @@ -131,7 +132,6 @@ function GetJavascriptIndent()
let line = getline(v:lnum)
" previous nonblank line number
let prevline = prevnonblank(v:lnum - 1)
" previous line of code

" start with strings,comments,etc.{{{2
if (line !~ '^[''"`]' && s:IsSyn(v:lnum,1,'string\|template')) ||
Expand Down