tests/bundled/lh-vim-lib/macros/menu-map.vim @ 7e3c84cb5eb4
Fix TypeError when using Python 3
The error shows up on :Gundo and looks like this:
Error detected while processing function gundo#GundoShow[1]..<SNR>116_GundoShow[4]..<SNR>116_GundoOpen[31]..<SNR>116_GundoRenderPreview:
line 2:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/mg/.vim/bundle/Gundo/autoload/gundo.py", line 474, in GundoRenderPreview
_output_preview_text(_generate_preview_diff(current, node_before, node_after))
File "/home/mg/.vim/bundle/Gundo/autoload/gundo.py", line 382, in _generate_preview_diff
before_time, after_time))
File "/usr/lib/python3.5/difflib.py", line 1177, in unified_diff
_check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
File "/usr/lib/python3.5/difflib.py", line 1312, in _check_types
raise TypeError('all arguments must be str, not: %r' % (arg,))
TypeError: all arguments must be str, not: 46
author |
Marius Gedminas <marius@gedmin.as> |
date |
Thu, 24 Nov 2016 14:21:55 +0200 |
parents |
2b3d5ee5c4a4 |
children |
(none) |
"===========================================================================
" $Id: menu-map.vim 246 2010-09-19 22:40:58Z luc.hermitte $
" File: macros/menu-map.vim
" Author: Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
" <URL:http://code.google.com/p/lh-vim/>
"
" Purpose: Define functions to build mappings and menus at the same time
"
" Version: 2.2.1
" Last Update: $Date: 2010-09-19 18:40:58 -0400 (Sun, 19 Sep 2010) $ (02nd Dec 2006)
"
" Last Changes: {{{
" Version 2.0.0:
" Moved to vim7,
" Functions moved to {rtp}/autoload/
" Version 1.6.2:
" (*) Silent mappings and menus
" Version 1.6. :
" (*) Uses has('gui_running') instead of has('gui') to check if
" we can generate the menu.
" Version 1.5. :
" (*) visual mappings launched from select-mode don't end with
" text still selected -- applied to :VCalls
" Version 1.4. :
" (*) address obfuscated for spammers
" (*) support the local option
" b:want_buffermenu_or_global_disable if we don't want
" buffermenu to be used systematically.
" 0 -> buffer menu not used
" 1 -> buffer menu used
" 2 -> the VimL developper will use a global disable.
" cf.: tex-maps.vim:: s:SimpleMenu()
" and texmenus.vim
" Version 1.3. :
" (*) add continuation lines support ; cf 'cpoptions'
" Version 1.2. :
" (*) Code folded.
" (*) Take advantage of buffermenu.vim if present for local
" menus.
" (*) If non gui is available, the menus won't be defined
" Version 1.1. :
" (*) Bug corrected :
" vnore(map\|menu) does not imply v+n(map\|menu) any more
" }}}
"
" Inspired By: A function from Benji Fisher
"
" TODO: (*) no menu if no gui.
"
"===========================================================================
if exists("g:loaded_menu_map") | finish | endif
let g:loaded_menu_map = 1
"" line continuation used here ??
let s:cpo_save = &cpo
set cpo&vim
"=========================================================================
" Commands {{{
command! -nargs=+ -bang MAP map<bang> <args>
command! -nargs=+ IMAP imap <args>
command! -nargs=+ NMAP nmap <args>
command! -nargs=+ CMAP cmap <args>
command! -nargs=+ VMAP vmap <args>
command! -nargs=+ AMAP
\ call lh#menu#map_all('amap', <f-args>)
command! -nargs=+ -bang NOREMAP noremap<bang> <args>
command! -nargs=+ INOREMAP inoremap <args>
command! -nargs=+ NNOREMAP nnoremap <args>
command! -nargs=+ CNOREMAP cnoremap <args>
command! -nargs=+ VNOREMAP vnoremap <args>
command! -nargs=+ ANOREMAP
\ call lh#menu#map_all('anoremap', <f-args>)
" }}}
" End !
let &cpo = s:cpo_save
finish
"=========================================================================
" vim600: set fdm=marker: