diff --git a/mode/lua/lua.js b/mode/lua/lua.js
index <HASH>..<HASH> 100644
--- a/mode/lua/lua.js
+++ b/mode/lua/lua.js
@@ -50,7 +50,7 @@ CodeMirror.defineMode("lua", function(config, parserConfig) {
 			 "true","function", "end", "if", "then", "else", "do", 
 			 "while", "repeat", "until", "for", "in", "local" ]);
 
-  var indentTokens = wordRE(["function", "if","repeat","for","while", "\\(", "{"]);
+  var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]);
   var dedentTokens = wordRE(["end", "until", "\\)", "}"]);
   var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]);
Replaced "for" and "while" in indent tokens with "do".  This is not only simpler, but allows for correct indentation when "do ... end" blocks are used (these are valid; see the complete syntax of Lua: <URL>).