Permalink
Browse files

open evernote in the right window

  • Loading branch information...
1 parent c0afebe commit 7b3ae3365e4b549992f2fd2e374209cfaad06b51 user committed Dec 1, 2011
Showing with 16 additions and 4 deletions.
  1. BIN evernote-api-1.19/lib/python/evernote/__init__.pyc
  2. BIN evernote-api-1.19/lib/python/evernote/edam/__init__.pyc
  3. BIN evernote-api-1.19/lib/python/evernote/edam/error/__init__.pyc
  4. BIN evernote-api-1.19/lib/python/evernote/edam/error/ttypes.pyc
  5. BIN evernote-api-1.19/lib/python/evernote/edam/limits/__init__.pyc
  6. BIN evernote-api-1.19/lib/python/evernote/edam/limits/ttypes.pyc
  7. BIN evernote-api-1.19/lib/python/evernote/edam/notestore/NoteStore.pyc
  8. BIN evernote-api-1.19/lib/python/evernote/edam/notestore/__init__.pyc
  9. BIN evernote-api-1.19/lib/python/evernote/edam/notestore/ttypes.pyc
  10. BIN evernote-api-1.19/lib/python/evernote/edam/type/__init__.pyc
  11. BIN evernote-api-1.19/lib/python/evernote/edam/type/ttypes.pyc
  12. BIN evernote-api-1.19/lib/python/evernote/edam/userstore/UserStore.pyc
  13. BIN evernote-api-1.19/lib/python/evernote/edam/userstore/__init__.pyc
  14. BIN evernote-api-1.19/lib/python/evernote/edam/userstore/constants.pyc
  15. BIN evernote-api-1.19/lib/python/evernote/edam/userstore/ttypes.pyc
  16. BIN evernote-api-1.19/lib/python/evernoteapi.pyc
  17. BIN evernote-api-1.19/lib/python/thrift/Thrift.pyc
  18. BIN evernote-api-1.19/lib/python/thrift/__init__.pyc
  19. BIN evernote-api-1.19/lib/python/thrift/protocol/TBinaryProtocol.pyc
  20. BIN evernote-api-1.19/lib/python/thrift/protocol/TProtocol.pyc
  21. BIN evernote-api-1.19/lib/python/thrift/protocol/__init__.pyc
  22. BIN evernote-api-1.19/lib/python/thrift/transport/THttpClient.pyc
  23. BIN evernote-api-1.19/lib/python/thrift/transport/TTransport.pyc
  24. BIN evernote-api-1.19/lib/python/thrift/transport/__init__.pyc
  25. +16 −4 evernote_plugin.vim
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -17,7 +17,8 @@ allNotes = {}
backRef = {}
bufIdx = -1
noteStore = None
-evernoteBufferName = '__EVERNOTE_LIST__'
+evernoteListName = '__EVERNOTE_LIST__'
+evernoteBufferName = '__EVERNOTE_NOTE__'
EOF
" The authentication function
@@ -75,8 +76,8 @@ endfunction
function! s:display_note_list()
python << EOF
-if not evernoteBufferName in vim.current.buffer.name:
- vim.command('leftabove vertical split ' + evernoteBufferName)
+if not evernoteListName in vim.current.buffer.name:
+ vim.command('leftabove vertical split ' + evernoteListName)
vim.command('set nowrap')
vim.command('vertical res 40')
vim.command('setlocal buftype=nofile')
@@ -112,7 +113,18 @@ hintLine = int(vim.eval("a:lineNum"))
if backRef.has_key(hintLine):
(notebook, note) = backRef[hintLine]
realNote = noteStore.getNote(authToken, note.guid, 1, 0, 0, 0)
- vim.command('setlocal noreadonly')
+ lastWin = vim.eval("winnr()")
+ # see if exist a right window
+ vim.command('wincmd l')
+ currWin = vim.eval("winnr()")
+ if (lastWin == currWin):
+ # no window to the right
+ vim.commmand("rightbelow vertical split " + evernoteBufferName)
+ vim.command('setlocal noreadonly')
+ vim.command('setlocal buftype=nofile')
+ vim.command('setlocal noswapfile')
+ currWin = vim.eval("winnr()")
+
del vim.current.buffer[0:len(vim.current.buffer)]
lines = realNote.content.split('\n')
content = "".join(lines)

0 comments on commit 7b3ae33

Please sign in to comment.