Fix vim emulation module

This commit is contained in:
ZyX 2014-08-10 16:17:22 +04:00
parent b8049fab87
commit 9d1392fa0d
1 changed files with 11 additions and 2 deletions

View File

@ -211,8 +211,15 @@ def command(cmd):
if not aucmd.startswith(':python3 '): if not aucmd.startswith(':python3 '):
raise NotImplementedError raise NotImplementedError
_on_wipeout.append(aucmd.partition(' ')[2]) _on_wipeout.append(aucmd.partition(' ')[2])
elif cmd.startswith('set '):
if cmd.startswith('set statusline='):
options['statusline'] = cmd[len('set statusline='):]
elif cmd.startswith('set tabline='):
options['tabline'] = cmd[len('set tabline='):]
else:
raise NotImplementedError(cmd)
else: else:
raise NotImplementedError raise NotImplementedError(cmd)
@_vim @_vim
@ -481,6 +488,7 @@ class _Tabpage(object):
return win return win
def _close(self): def _close(self):
global _tabpage
while self.windows: while self.windows:
self._close_window(1, False) self._close_window(1, False)
tabpages._pop(self.number) tabpages._pop(self.number)
@ -532,7 +540,7 @@ class _Buffer(object):
import os import os
if type(name) is not bytes: if type(name) is not bytes:
name = name.encode('utf-8') name = name.encode('utf-8')
if b':/' in name: if b':/' in name:
self._name = name self._name = name
else: else:
self._name = os.path.abspath(name) self._name = os.path.abspath(name)
@ -680,6 +688,7 @@ def _edit(name=None):
@_vim @_vim
def _tabnew(name=None): def _tabnew(name=None):
global windows global windows
global _tabpage
tabpage = tabpages._new() tabpage = tabpages._new()
windows = tabpage.windows windows = tabpage.windows
_tabpage = len(tabpages) _tabpage = len(tabpages)