     match = regex.exec leftOfCursor
     if match
       column = match.index
+
+    # If there are no matches left of the cursor, go to the last word on the
+    # previous line.  Vim skips lines that are have only whitespace on them, but
+    # not completely empty lines.
     else
-      # there are no matches left of the cursor
-      # go to the last word on the previous line
       row--
-      # Vim skips lines that are only whitespace
-      # (but not completely empty lines)
       row-- while /^\s+$/.test(line = jim.adaptor.lineText row)
       match = regex.exec line
       column = match?.index or 0

lastWORDRegex = ///#{WORDRegex().source}\s*$///
lastWordRegex = ///(#{wordRegex().source})\s*$///

# move to the last beginning of a word
map 'b', class MoveBackWord extends Motion
  exclusive: yes
  exec: repeatCountTimes (jim) ->

# Jump motions
# ------------

# Go to `{count}` line number or the first line.
map 'gg', class GoToLine extends Motion
  linewise: yes
  exec: (jim) ->
