From 47396a24c8b4b4891f42ccdfb31ae8e033c79bc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Mon, 20 Jan 2014 22:49:37 +0100 Subject: [PATCH] taught edit to insert two spaces when tab is pressed. finally. --- assets/opencomputers/lua/rom/bin/edit.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/opencomputers/lua/rom/bin/edit.lua b/assets/opencomputers/lua/rom/bin/edit.lua index 76e43e369..2cc0aca8d 100644 --- a/assets/opencomputers/lua/rom/bin/edit.lua +++ b/assets/opencomputers/lua/rom/bin/edit.lua @@ -299,8 +299,12 @@ local function onKeyDown(char, code) end elseif readonly and code == keyboard.keys.q then running = false - elseif not keyboard.isControl(char) and not readonly then - insert(unicode.char(char)) + elseif not readonly then + if not keyboard.isControl(char) then + insert(unicode.char(char)) + elseif unicode.char(char) == "\t" then + insert(" ") + end end end