mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

commit cbd64d8318decac12f472da63f6880d9edc6bb8e
parent f4b4088fc23fe391837a5bd699fc82d75fe6f51d
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Tue,  5 May 2020 20:38:12 +0300

Whitespace fixes

Diffstat:
Msrc/lua/alias.lua | 4++--
Msrc/lua/gag.lua | 2+-
Msrc/lua/handlers.lua | 4+++-
Msrc/lua/intercept.lua | 2+-
Msrc/lua/macro.lua | 1-
Msrc/lua/mud.lua | 2+-
6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/lua/alias.lua b/src/lua/alias.lua @@ -94,9 +94,9 @@ function mud.alias( command, handler, ... ) end local alias = type( handler ) == "function" - and simpleAlias( handler, ... ) + and simpleAlias( handler, ... ) or patternAlias( handler, ... ) - + Aliases[ command ] = alias return alias diff --git a/src/lua/gag.lua b/src/lua/gag.lua @@ -15,7 +15,7 @@ local function genericGags( gags ) function( pattern, disabled ) local gag = { pattern = pattern, - + enabled = not disabled, enable = function( self ) diff --git a/src/lua/handlers.lua b/src/lua/handlers.lua @@ -152,6 +152,8 @@ local function handleData( data ) dataBuffer = dataBuffer .. data + -- TODO: this sucks! + -- can insert newlines in random places if we receive a GA followed by partial data if data:match( GA ) then dataBuffer = dataBuffer:gsub( "\r", "" ) @@ -250,7 +252,7 @@ local function handleCommand( input, hide ) end mud.send( input .. "\n" ) - end + end end local function handleInput( input, display ) diff --git a/src/lua/intercept.lua b/src/lua/intercept.lua @@ -32,7 +32,7 @@ function mud.intercept( pattern, callback, disabled ) self.enabled = false end, } - + table.insert( Intercepts, intercept ) return intercept diff --git a/src/lua/macro.lua b/src/lua/macro.lua @@ -25,7 +25,6 @@ function mud.macro( key, callback, disabled ) assert( not Macros[ key ], "macro `%s' already registered" % key ) - Macros[ key ] = callback end diff --git a/src/lua/mud.lua b/src/lua/mud.lua @@ -26,7 +26,7 @@ function mud.connect( address, port ) if not address then if not LastAddress then mud.print( "\n#s> I need an address..." ) - + return end