     vm.set_md_and_update_editor(md) if md?
     # render html
     vm.render_html($('#md_html_div'))
+    # save current note guid to local storage
+    localStorageService.set(vm.SETTINGS_KEY.CURRENT_NOTE_GUID, guid)
 
   # TODO prevent multiple duplicated requests
   vm.refresh_all_notes = ->

    # sync scroll
    scrollSyncor.syncScroll(vm.ace_editor, $('#md_html_div'))

    # make new note
    noteManager.make_new_note().then(
      (note) =>
        vm.change_current_note(guid=note.guid, title=note.title, md=note.md)
        console.log('New note made: ' + JSON.stringify(note))
      (error) =>
        alert('make_new_note() failed!')
    ).catch (error) => alert('make new note failed!')

    # get note list
    vm.refresh_all_notes()

    KEYBOARD_HANDLER: 'settings.keyboard_handler'
    SHOW_GUTTER: 'settings.show_gutter'
    ACE_THEME: 'settings.ace_theme'
    CURRENT_NOTE_GUID: 'settings.current_note.guid'

  # --------------------------------------------------------
  # Editor Keyboard Handler Settings
