Пример #1
0
 def finalize(self):
     try:
         if self.fm.py3:
             xpos = sum(utf_char_width_(ord(c)) for c in self.line[0 : self.pos]) + len(self.prompt)
         else:
             xpos = uwid(self.line[0 : self.pos]) + len(self.prompt)
         self.fm.ui.win.move(self.y, self.x + min(self.wid - 1, xpos))
     except:
         pass
Пример #2
0
	def draw(self):
		self.win.erase()
		self.addstr(0, 0, self.prompt)
		overflow = -self.wid + len(self.prompt) + uwid(self.line) + 1
		if overflow > 0: 
			#XXX: cut uft-char-wise, consider width
			self.addstr(self.line[overflow:])
		else:
			self.addstr(self.line)
Пример #3
0
 def finalize(self):
     try:
         if self.fm.py3:
             xpos = sum(utf_char_width_(ord(c)) for c in self.line[0:self.pos]) \
              + len(self.prompt)
         else:
             xpos = uwid(self.line[0:self.pos]) + len(self.prompt)
         self.fm.ui.win.move(self.y, self.x + min(self.wid - 1, xpos))
     except:
         pass
Пример #4
0
 def draw(self):
     self.win.erase()
     self.addstr(0, 0, self.prompt)
     if self.fm.py3:
         overflow = -self.wid + len(self.prompt) + len(self.line) + 1
     else:
         overflow = -self.wid + len(self.prompt) + uwid(self.line) + 1
     if overflow > 0:
         #XXX: cut uft-char-wise, consider width
         self.addstr(self.line[overflow:])
     else:
         self.addstr(self.line)
Пример #5
0
 def __len__(self):
     return uwid(self.string)
Пример #6
0
	def __len__(self):
		return uwid(self.string)
Пример #7
0
	def finalize(self):
		try:
			xpos = uwid(self.line[0:self.pos]) + len(self.prompt)
			self.fm.ui.win.move(self.y, self.x + min(self.wid-1, xpos))
		except:
			pass