     @name ? settings.get('defaultRegister')
 
   setName: ->
-    viewModel = new ViewModel(this, class: 'read-register', singleChar: true, hidden: true)
-    viewModel.onDidGetInput (@input) =>
-      @name = @input
+    viewModel = new ViewModel this,
+      class: 'read-register'
+      singleChar: true
+      hidden: true
+    viewModel.onDidGetInput (@name) =>
 
-  # Public: Determines if a string should be considered linewise or character
-  #
-  # text - The string to consider
-  #
-  # Returns 'linewise' if the string ends with a line return and 'character'
-  #  otherwise.
   getCopyType: (text) ->
     if text.lastIndexOf("\n") is text.length - 1
       'linewise'

    register = @globalVimState.registers[name] ?=
      type: 'character'
      text: ''

    if register.type is 'linewise' and type isnt 'linewise'
      register.text += "#{text}\n"
    else if register.type isnt 'linewise' and type is 'linewise'
      register.text += "\n#{text}"
      register.type = 'linewise'
    else
      register.text += text

  reset: ->
    @name = null


  get: (name) ->
    return unless @isValidName(name)
    name = settings.get('defaultRegister') if name is '"'

    switch name
      when '*', '+'
