implemented delete key

This commit is contained in:
Felix Angell 2018-04-13 15:10:33 +01:00
parent cecb529cc4
commit f4e6cb3d87
2 changed files with 10 additions and 1 deletions

View File

@ -202,6 +202,11 @@ func remove(slice []*rope.Rope, s int) []*rope.Rope {
return append(slice[:s], slice[s+1:]...)
}
func (b *Buffer) deleteNext() {
b.moveRight()
b.deletePrev()
}
func (b *Buffer) deletePrev() {
if b.curs.x > 0 {
offs := -1
@ -466,6 +471,10 @@ func (b *Buffer) processActionKey(key int) bool {
}
return true
case sdl.K_DELETE:
b.deleteNext()
return true
case sdl.K_LGUI:
fallthrough
case sdl.K_RGUI:

View File

@ -24,7 +24,7 @@ type PhiEditor struct {
func (n *PhiEditor) init(cfg *cfg.TomlConfig) {
n.AddComponent(gui.NewView(1280/2, 720, cfg))
font, err := strife.LoadFont("./res/firacode.ttf", 14)
font, err := strife.LoadFont("./res/firacode.ttf", 20)
if err != nil {
panic(err)
}