Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix #285

  • Loading branch information...
commit 7e807851f87701b90d993966a98b82db87f7a283 1 parent 00d39a3
@kakkyz81 kakkyz81 authored
Showing with 21 additions and 11 deletions.
  1. +10 −6 autoload/evervim.vim
  2. +11 −5 plugin/py/evervimmer.py
View
16 autoload/evervim.vim
@@ -130,12 +130,16 @@ endfunction
"}}}
function! evervim#createNote() " {{{
- python Evervimmer.getInstance().createNote()
- " clear Create autocmd
- augroup evervimCreate
- autocmd!
- augroup END
- call evervim#setBufAutocmdWhenWritePost()
+ try
+ python Evervimmer.getInstance().createNote()
+ " clear Create autocmd
+ augroup evervimCreate
+ autocmd!
+ augroup END
+ call evervim#setBufAutocmdWhenWritePost()
+ catch
+ echoerr 'createNote error! aborted.'
+ endtry
endfunction
"}}}
View
16 plugin/py/evervimmer.py
@@ -3,6 +3,8 @@
# Author: kakkyz <kakkyz81@gmail.com>
# License: MIT
import vim
+import sys
+import traceback
from evervim_editor import EvervimEditor
from evervim_editor import EvervimPref
from xml.dom import minidom
@@ -150,11 +152,15 @@ def searchByQuery(self): # {{{
#}}}
def createNote(self): # {{{
- Evervimmer.currentnote = Evervimmer.editor.api.newNote()
- self.checkNote()
- createdNote = Evervimmer.editor.api.createNote(Evervimmer.currentnote)
- Evervimmer.currentnote = createdNote
- print 'create successful.'
+ try:
+ Evervimmer.currentnote = Evervimmer.editor.api.newNote()
+ self.checkNote()
+ createdNote = Evervimmer.editor.api.createNote(Evervimmer.currentnote)
+ Evervimmer.currentnote = createdNote
+ print 'create successful.'
+ except:
+ print traceback.format_exc(sys.exc_info()[2])
+ raise StandardError("createNote error! aborted.")
#}}}
def getNote(self): # {{{
Please sign in to comment.
Something went wrong with that request. Please try again.