示例#1
0
func moveDotDown(ed *Editor) {
	eol := strutil.FindFirstEOL(ed.line[ed.dot:]) + ed.dot
	if eol == len(ed.line) {
		ed.flash()
	}
	nextSOL := eol + 1
	nextEOL := strutil.FindFirstEOL(ed.line[nextSOL:]) + nextSOL
	sol := strutil.FindLastSOL(ed.line[:ed.dot])
	width := WcWidths(ed.line[sol:ed.dot])
	ed.dot = nextSOL + len(TrimWcWidth(ed.line[nextSOL:nextEOL], width))
}
示例#2
0
func moveDotDown(ed *Editor, k Key) *leReturn {
	eol := strutil.FindFirstEOL(ed.line[ed.dot:]) + ed.dot
	if eol == len(ed.line) {
		ed.beep()
		return nil
	}
	nextSOL := eol + 1
	nextEOL := strutil.FindFirstEOL(ed.line[nextSOL:]) + nextSOL
	sol := strutil.FindLastSOL(ed.line[:ed.dot])
	width := WcWidths(ed.line[sol:ed.dot])
	ed.dot = nextSOL + len(TrimWcWidth(ed.line[nextSOL:nextEOL], width))
	return nil
}
示例#3
0
func killLineRight(ed *Editor) {
	eol := strutil.FindFirstEOL(ed.line[ed.dot:]) + ed.dot
	ed.line = ed.line[:ed.dot] + ed.line[eol:]
}
示例#4
0
func moveDotEOL(ed *Editor) {
	eol := strutil.FindFirstEOL(ed.line[ed.dot:]) + ed.dot
	ed.dot = eol
}
示例#5
0
func killLineRight(ed *Editor, k Key) *leReturn {
	eol := strutil.FindFirstEOL(ed.line[ed.dot:]) + ed.dot
	ed.line = ed.line[:ed.dot] + ed.line[eol:]
	return nil
}