     @updateStylesheet primarySelector, 'background-color', color
     @updateStylesheet primarySelector, 'border-color', color
     # also apply to blink-off state if cursor blink is disabled
-    if 0 is @getConfig 'blinkInterval'
+    if 0 is @getBlinkInterval()
       @updateStylesheet secondarySelector, 'background-color', color
       @updateStylesheet secondarySelector, 'border-color', color
 
   applySecondaryColor: =>
     # use primaryColor if cursor blink is disabled
-    color = @getColor (if 0 is @getConfig 'blinkInterval' then 'primary' else 'secondary')
+    color = @getColor (if 0 is @getBlinkInterval() then 'primary' else 'secondary')
     @updateStylesheet secondarySelector, 'background-color', color
     @updateStylesheet secondarySelector, 'border-color', color
 

'use strict'
{CompositeDisposable} = require 'atom'

class BlockCursor
  cursorStyle = null
  cursorTypeMap =
    '\u25AE - Block': 'block' # ▮
    '\u25AF - Bordered box': 'bordered-box' # ▯
    '| - I-beam': 'i-beam'
    '_ - Underline': 'underline'
  primarySelector = 'atom-text-editor::shadow .cursors .cursor'
  secondarySelector = 'atom-text-editor::shadow .cursors.blink-off .cursor'

  config:
    cursorType:


  activate: ->
    @subs = new CompositeDisposable()
    @subs.add [
      atom.config.observe 'block-cursor.cursorType', @applyCursorType
      atom.config.observe 'block-cursor.primaryColor', @applyPrimaryColor
      atom.config.observe 'block-cursor.primaryColorAlpha', @applyPrimaryColor
      atom.config.observe 'block-cursor.secondaryColor', @applySecondaryColor
      atom.config.observe 'block-cursor.secondaryColorAlpha', @applySecondaryColor
      atom.config.observe 'block-cursor.blinkInterval', @applyBlinkInterval.bind @
      atom.config.observe 'block-cursor.pulseDuration', @applyPulseDuration
      atom.config.observe 'block-cursor.cursorThickness', @applyCursorThickness
      atom.config.observe 'block-cursor.cursorLineFix', @applyCursorLineFix
    ]
    # set some text in the preview field
    atom.config.set 'block-cursor.preview', 'The quick brown fox jumps over the lazy dog'
    # renamed to 'preview', so leave this here for few versions. preview was zzzpreview
    # as a hack to force it to show at the bottom of the list in the settings view
    atom.config.unset 'block-cursor.zzzpreview'

  deactivate: ->
    @subs.dispose()

  getColor: (which) ->
    color = atom.config.get "block-cursor.#{which}Color"
    color.alpha = atom.config.get "block-cursor.#{which}ColorAlpha"
    color.toRGBAString()

  getBlinkInterval: ->
    atom.config.get 'block-cursor.blinkInterval'

  applyCursorType: (cursorTypeName) ->
    cursorType = cursorTypeMap[cursorTypeName] ? cursorTypeName
