Ctrl+Home/End go to the start and end of the box respectively
This commit is contained in:
parent
1c38ed2d87
commit
381f5f88bd
@ -405,12 +405,20 @@ func (this *textBox) handleKeyDown (key input.Key, numberPad bool) bool {
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case key == input.KeyHome || (modifiers.Alt && key == input.KeyLeft):
|
case key == input.KeyHome || (modifiers.Alt && key == input.KeyLeft):
|
||||||
dot.End = lineHomeSoft(this.runes, dot.End)
|
if word {
|
||||||
|
dot.End = 0
|
||||||
|
} else {
|
||||||
|
dot.End = lineHomeSoft(this.runes, dot.End)
|
||||||
|
}
|
||||||
if !sel { dot.Start = dot.End }
|
if !sel { dot.Start = dot.End }
|
||||||
this.Select(dot)
|
this.Select(dot)
|
||||||
return true
|
return true
|
||||||
case key == input.KeyEnd || (modifiers.Alt && key == input.KeyRight):
|
case key == input.KeyEnd || (modifiers.Alt && key == input.KeyRight):
|
||||||
dot.End = lineEnd(this.runes, dot.End)
|
if word {
|
||||||
|
dot.End = len(this.runes)
|
||||||
|
} else {
|
||||||
|
dot.End = lineEnd(this.runes, dot.End)
|
||||||
|
}
|
||||||
if !sel { dot.Start = dot.End }
|
if !sel { dot.Start = dot.End }
|
||||||
this.Select(dot)
|
this.Select(dot)
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user