def erase_marker(self): 'At start of line, replace marker with saved character' if self.dot_i0: ch = self.marker_ch0 if not self.marker_ch0 == '\n' else ' ' display.put_render(self.dot_i0, 1, ch, display.clear) elif self.dot == 0: # empty buffer, marker at window ulc display.put_render(self.win_1, 1, ' ', display.clear)
def display_marker(self): """ Display cursor-like marker at start of line to indicate dot when terminal cursor is elsewhere (at command line etc.) """ if self.dot_i: display.put_render(self.dot_i, 1, self.marker_chx, display.white_bg) elif self.dot == 0: # empty buffer, cursor at window ulc display.put_render(self.win_1, 1, ' ', display.white_bg)
def display_status(self): "Print information about window's buffer in its status line." s1 = self.status_1 # line number of status bar on display unsaved = '-----**- ' if self.buf.unsaved else '-------- ' # 13 bufname = '%-13s' % self.buf.name position = (' All ' if self.buf.S() <= self.win_hl else # S() is last line ' Top ' if self.seg_1 == 1 else ' Bot ' if self.seg_n == self.buf.S() else ' %2.0f%% ' % (100*self.dot/(len(self.buf.lines)-1))) # %% prints % linenums = '%-14s' % ('L%d/%d ' % (self.dot, self.buf.S())) timestamp = datetime.strftime(datetime.now(),' %H:%M:%S -') # 10 ch w/margin display.put_render(s1, 0, unsaved, display.white_bg) display.put_render(s1, 13, bufname, display.bold, display.white_bg) display.put_render(s1, 26, position, display.white_bg) display.put_render(s1, 31, linenums, display.white_bg) display.put_render(s1, 45, '-'*(self.ncols-(45+10)), display.white_bg) display.put_render(s1, self.ncols-10, timestamp, display.white_bg)