ok, attached the patch. On Thu, Jul 21, 2011 at 9:09 PM, mattn <mattn...@gmail.com> wrote: > Hi list. > when type '.' at following code, pythoncomplete does not work. > ---------- > from httplib import HTTPConnection > def autocomplete_in_function(): > h = HTTPConnection > h. > ---------- > pythoncomplete does not check "from XXX import YYY" as "import". > Below is a patch. Please check and include. > BTW) I guess that it have better to check it as "^from\s+" or "^import\s+". > diff -r 1d1065c2e7fa runtime/autoload/python3complete.vim > --- a/runtime/autoload/python3complete.vim Wed Jul 20 18:29:39 2011 +0200 > +++ b/runtime/autoload/python3complete.vim Thu Jul 21 21:04:26 2011 +0900 > @@ -297,12 +297,12 @@ > str = "" > if len(self.docstr) > 0: str += '"""'+self.docstr+'"""\n' > for l in self.locals: > - if l.startswith('import'): str += l+'\n' > + if l.startswith('import') or l.startswith('from'): str += > l+'\n' > str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n > return None\n' > for sub in self.subscopes: > str += sub.get_code() > for l in self.locals: > - if not l.startswith('import'): str += l+'\n' > + if not l.startswith('import') and not l.startswith('from'): str > += l+'\n' > > return str > > diff -r 1d1065c2e7fa runtime/autoload/pythoncomplete.vim > --- a/runtime/autoload/pythoncomplete.vim Wed Jul 20 18:29:39 2011 +0200 > +++ b/runtime/autoload/pythoncomplete.vim Thu Jul 21 21:04:26 2011 +0900 > @@ -315,12 +315,12 @@ > str = "" > if len(self.docstr) > 0: str += '"""'+self.docstr+'"""\n' > for l in self.locals: > - if l.startswith('import'): str += l+'\n' > + if l.startswith('import') or l.startswith('from'): str += > l+'\n' > str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n > return None\n' > for sub in self.subscopes: > str += sub.get_code() > for l in self.locals: > - if not l.startswith('import'): str += l+'\n' > + if not l.startswith('import') and not l.startswith('from'): str > += l+'\n' > > return str > > > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php >
-- - Yasuhiro Matsumoto -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
pythoncomplete-fix.diff
Description: Binary data