From a361304e73d1ffffb95b77863974bd5766c00176 Mon Sep 17 00:00:00 2001 From: cheater Date: Wed, 8 Feb 2012 08:03:23 +0100 Subject: [PATCH] Deleted non-iterator code. Refactoring complete. --- plugin/pythonhelper.vim | 65 ----------------------------------------- 1 file changed, 65 deletions(-) diff --git a/plugin/pythonhelper.vim b/plugin/pythonhelper.vim index cba805b..4325e04 100644 --- a/plugin/pythonhelper.vim +++ b/plugin/pythonhelper.vim @@ -379,71 +379,6 @@ def vimBufferIterator(vimBuffer): for line in vimBuffer: yield line + "\n" -def vimBufferIterator2(vimBuffer): - buf = VimReadlineBuffer(vimBuffer) - while True: - line = buf.readline() - if line == '': - break - yield line - -# class VimReadlineBuffer() {{{ -class VimReadlineBuffer(object): - # DOC {{{ - """A simple wrapper class around a Vim buffer that provides the readline - method. - """ - # }}} - - - # METHODS {{{ - - def __init__(self, vimBuffer): - # DOC {{{ - """Initializes instances of VimReadlineBuffer(). - - Parameters - - vimBuffer -- a Vim buffer - """ - # }}} - - # CODE {{{ - # remember the settings - self.vimBuffer = vimBuffer - - # initialize instance attributes {{{ - self.currentLine = -1 - self.bufferLines = len(vimBuffer) - # }}} - # }}} - - - def readline(self): - # DOC {{{ - """Returns the next line from the buffer. If the whole buffer has been - read, returns an empty string. - """ - # }}} - - # CODE {{{ - # increase the current line counter - self.currentLine += 1 - - # tell if we reached beyond the last line {{{ - if (self.currentLine == self.bufferLines): - return '' - # }}} - - # Vim stores the lines without the newlines, so add one - return "%s\n" % (self.vimBuffer[self.currentLine],) - # }}} - - - # }}} -# }}} - - def getNearestLineIndex(row, tagLineNumbers): # DOC {{{ """Returns the index of 'tagLineNumbers' that contains the line nearest to