Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto-convert character case for functions and allow private functions.
Private functions are available in the current script only: they use Vim's <SID> prefix. This fixes both issues #1 and #3.
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
python << eop | ||
import os | ||
import vim | ||
from vim_bridge import bridged | ||
|
||
@bridged | ||
def public(): | ||
return "I am public." | ||
|
||
@bridged | ||
def _private(): | ||
return "I am private (available in the current script only)." | ||
|
||
@bridged | ||
def my_name_is_auto_converted(): | ||
return "In Python, I'm called my_name_is_auto_converted, but in Vim, I'm called MyNameIsAutoConverted :)" | ||
|
||
@bridged | ||
def _long_private_name(): | ||
return "I'm private, and my case is converted automatically." | ||
eop | ||
|
||
echo Public() | ||
echo s:Private() | ||
echo MyNameIsAutoConverted() | ||
echo s:LongPrivateName() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters