     "label"
 
   viewForItem: ({label}) ->
-    "<li>#{label}</li>"
+     "<li>#{label}</li>"
 
   confirmed: ({label}) ->
     @editor.insertText label

    @editor = editor
    file = editor?.buffer?.file
    basePath = file?.path
    texRootRex = /%!TEX root = (.+)/g
    while(match = texRootRex.exec(@editor.getText()))
      absolutFilePath = FindLabels.getAbsolutePath(basePath,match[1])
      try
        text = fs.readFileSync(absolutFilePath).toString()
        labels = FindLabels.getLabelsByText(text, absolutFilePath)
      catch error
        errmsg = 'could not load content of #{absolutFilePath}'
        atom.notifications.addError(errmsg, { dismissable: true })
        console.log(error)
    if labels == undefined or labels.length == 0
      labels = FindLabels.getLabelsByText(@editor.getText(), basePath)

{$,SelectListView} = require 'atom-space-pen-views'
FindLabels = require './find-labels'
fs = require 'fs-plus'
pathModule = require 'path'

module.exports =
class LabelView extends SelectListView
