Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

latest nerdtree and syntastic

  • Loading branch information...
commit 52b9810195dc571a87eb8ef6af5ae821184b1baa 1 parent 846d5b4
Martin Grenfell scrooloose authored
2  ftplugin/nerdtree_git_menu.vim
@@ -24,7 +24,7 @@ let g:loaded_nerdtree_git_menu = 1
24 24 call NERDTreeAddMenuItem({
25 25 \ 'text': '(g)it menu',
26 26 \ 'shortcut': 'g',
27   - \ 'check_to_enable_callback': 'NERDTreeGitMenuEnabled',
  27 + \ 'isActiveCallback': 'NERDTreeGitMenuEnabled',
28 28 \ 'callback': 'NERDTreeGitMenu' })
29 29
30 30 function! NERDTreeGitMenuEnabled()
74 plugin/NERD_tree.vim
@@ -426,21 +426,21 @@ function! s:Bookmark.Write()
426 426 endfor
427 427 call writefile(bookmarkStrings, g:NERDTreeBookmarksFile)
428 428 endfunction
429   -"CLASS: MenuCallback {{{2
  429 +"CLASS: MenuItem {{{2
430 430 "============================================================
431   -let s:MenuCallback = {}
432   -"FUNCTION: MenuCallback.All() {{{3
433   -function! s:MenuCallback.All()
434   - if !exists("s:menuCallbacks")
435   - let s:menuCallbacks = []
  431 +let s:MenuItem = {}
  432 +"FUNCTION: MenuItem.All() {{{3
  433 +function! s:MenuItem.All()
  434 + if !exists("s:menuItems")
  435 + let s:menuItems = []
436 436 endif
437   - return s:menuCallbacks
  437 + return s:menuItems
438 438 endfunction
439 439
440   -"FUNCTION: MenuCallback.AllEnabledCallbacks() {{{3
441   -function! s:MenuCallback.AllEnabledCallbacks()
  440 +"FUNCTION: MenuItem.AllEnabled() {{{3
  441 +function! s:MenuItem.AllEnabled()
442 442 let toReturn = []
443   - for i in s:MenuCallback.All()
  443 + for i in s:MenuItem.All()
444 444 if i.enabled()
445 445 call add(toReturn, i)
446 446 endif
@@ -448,9 +448,9 @@ function! s:MenuCallback.AllEnabledCallbacks()
448 448 return toReturn
449 449 endfunction
450 450
451   -"FUNCTION: MenuCallback.FindByShortcut(shortcut) {{{3
452   -function! s:MenuCallback.FindByShortcut(shortcut)
453   - for i in s:MenuCallback.All()
  451 +"FUNCTION: MenuItem.FindByShortcut(shortcut) {{{3
  452 +function! s:MenuItem.FindByShortcut(shortcut)
  453 + for i in s:MenuItem.All()
454 454 if i.shortcut ==# a:shortcut
455 455 return i
456 456 endif
@@ -458,39 +458,39 @@ function! s:MenuCallback.FindByShortcut(shortcut)
458 458 return {}
459 459 endfunction
460 460
461   -"FUNCTION: MenuCallback.Create(options) {{{3
462   -function! s:MenuCallback.Create(options)
463   - let newCallback = {}
464   - let newCallback = copy(self)
  461 +"FUNCTION: MenuItem.Create(options) {{{3
  462 +function! s:MenuItem.Create(options)
  463 + let newMenuItem = {}
  464 + let newMenuItem = copy(self)
465 465
466 466 let shortcut = a:options['shortcut']
467 467 let callback = a:options['callback']
468 468
469 469
470   - let newCallback.text = a:options['text']
471   - let newCallback.shortcut = a:options['shortcut']
472   - let newCallback.callback = a:options['callback']
473   - if has_key(a:options, 'check_to_enable_callback')
474   - let newCallback.check_to_enable_callback = a:options['check_to_enable_callback']
  470 + let newMenuItem.text = a:options['text']
  471 + let newMenuItem.shortcut = a:options['shortcut']
  472 + let newMenuItem.callback = a:options['callback']
  473 + if has_key(a:options, 'isActiveCallback')
  474 + let newMenuItem.isActiveCallback = a:options['isActiveCallback']
475 475 endif
476   - call add(s:MenuCallback.All(), newCallback)
  476 + call add(s:MenuItem.All(), newMenuItem)
477 477 endfunction
478 478
479   -"FUNCTION: MenuCallback.enabled() {{{3
480   -function! s:MenuCallback.enabled()
481   - if has_key(self, "check_to_enable_callback")
482   - return {self.check_to_enable_callback}()
  479 +"FUNCTION: MenuItem.enabled() {{{3
  480 +function! s:MenuItem.enabled()
  481 + if has_key(self, "isActiveCallback")
  482 + return {self.isActiveCallback}()
483 483 endif
484 484 return 1
485 485 endfunction
486 486
487   -"FUNCTION: MenuCallback.execute() {{{3
488   -function! s:MenuCallback.execute()
  487 +"FUNCTION: MenuItem.execute() {{{3
  488 +function! s:MenuItem.execute()
489 489 call {self.callback}()
490 490 endfunction
491 491
492   -"FUNCTION: MenuCallback.ShowMenu() {{{3
493   -function! s:MenuCallback.ShowMenu()
  492 +"FUNCTION: MenuItem.ShowMenu() {{{3
  493 +function! s:MenuItem.ShowMenu()
494 494 let curNode = s:TreeFileNode.GetSelected()
495 495 if curNode ==# {}
496 496 call s:echo("Put the cursor on a node first" )
@@ -500,16 +500,16 @@ function! s:MenuCallback.ShowMenu()
500 500 let prompt = "NERDTree Menu\n" .
501 501 \ "==========================================================\n"
502 502
503   - for i in s:MenuCallback.AllEnabledCallbacks()
  503 + for i in s:MenuItem.AllEnabled()
504 504 let prompt .= i.text . "\n"
505 505 endfor
506 506
507 507 echo prompt
508 508
509   - let callback = s:MenuCallback.FindByShortcut(nr2char(getchar()))
510   - if !empty(callback) && callback.enabled()
  509 + let menuItem = s:MenuItem.FindByShortcut(nr2char(getchar()))
  510 + if !empty(menuItem) && menuItem.enabled()
511 511 redraw
512   - call callback.execute()
  512 + call menuItem.execute()
513 513 endif
514 514
515 515 endfunction
@@ -2427,7 +2427,7 @@ function! NERDTreeGetCurrentPath()
2427 2427 endfunction
2428 2428
2429 2429 function! NERDTreeAddMenuItem(options)
2430   - call s:MenuCallback.Create(a:options)
  2430 + call s:MenuItem.Create(a:options)
2431 2431 endfunction
2432 2432
2433 2433 function! NERDTreeRender()
@@ -3639,7 +3639,7 @@ function! s:refreshCurrent()
3639 3639 endfunction
3640 3640 " FUNCTION: s:showMenu() {{{2
3641 3641 function! s:showMenu()
3642   - call s:MenuCallback.ShowMenu()
  3642 + call s:MenuItem.ShowMenu()
3643 3643 endfunction
3644 3644
3645 3645 " FUNCTION: s:toggleIgnoreFilter() {{{2
2  syntax_checkers/haml.vim
@@ -25,7 +25,7 @@ function! SyntaxCheckers_haml_GetLocList()
25 25 "haml only outputs the first error, so parse it ourselves
26 26 let line = substitute(output, '^Syntax error on line \(\d*\):.*', '\1', '')
27 27 let msg = substitute(output, '^Syntax error on line \d*:\(.*\)', '\1', '')
28   - return [{'lnum' : line, 'text' : msg, 'bufnr': bufnr("") }]
  28 + return [{'lnum' : line, 'text' : msg, 'bufnr': bufnr(""), 'type': 'E' }]
29 29 endif
30 30 return []
31 31 endfunction

0 comments on commit 52b9810

Please sign in to comment.
Something went wrong with that request. Please try again.