   # Returns nothing.
   set: (name, {text, type}={}) ->
     return unless @isValidName(name)
-    type = @getCopyType(text) unless type
-
-    if name is '"'
-      name = settings.get('defaultRegister')
+    type ?= @getCopyType(text)
+    name = settings.get('defaultRegister') if name is '"'
 
     switch name
       when '*', '+'


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

    switch name
      when '*', '+'

    register = @globalVimState.registers[name] ?=
      type: 'character'
      text: ''
    if 'linewise' in [register.type, type]
      if register.type isnt 'linewise'
        register.text += '\n'
        register.type = 'linewise'
      text += '\n' if type isnt 'linewise'
    register.text += text

  reset: ->
    @name = null
