vim-nuuid icon indicating copy to clipboard operation
vim-nuuid copied to clipboard

Python 3 support

Open Grueslayer opened this issue 3 years ago • 0 comments

We can use pythonx to support support python 2 and 3, so it'll run on my Python 3 only system :)

diff --git a/plugin/nuuid.vim b/plugin/nuuid.vim
index a5ed298..7f137b9 100644
--- a/plugin/nuuid.vim
+++ b/plugin/nuuid.vim
@@ -8,7 +8,7 @@ if !exists('g:nuuid_case')
 endif

 " Make sure we have python
-if !has('python')
+if !has('pythonx')
        " finish
 endif

@@ -18,7 +18,7 @@ function! NuuidNewUuid()
     let l:new_uuid=system('uuidgen')[:-2]
     return g:nuuid_case == "lower" ? tolower(l:new_uuid) : toupper(l:new_uuid)
   else
-python << endpy
+pythonx << endpy
 import vim
 from uuid import uuid4
 vim.command("let l:new_uuid = '%s'"% str(uuid4()))

Grueslayer avatar Mar 08 '21 07:03 Grueslayer