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

# Other left/right motions
# ------------------------

# move to the first column on the line
map '0', class MoveToBeginningOfLine extends Motion
  exclusive: yes
  exec: (jim) -> jim.adaptor.moveTo jim.adaptor.row(), 0

# move to the first non-blank character on the line
map '^', class MoveToFirstNonBlank extends Motion
  exec: (jim) ->
    row = jim.adaptor.row()

    jim.adaptor.moveTo rowNumber, 0
    new MoveToFirstNonBlank().exec jim

# Go to `{count}` line number or the last line.
map 'G', class GoToLineOrEnd extends GoToLine
  constructor: (@count) ->
  exec: (jim) ->
    @count or= jim.adaptor.lastRow() + 1
    super

# Go to the first line that's visible in the viewport.
map 'H', class GoToFirstVisibleLine extends Motion
  linewise: yes
  exec: (jim) ->
    line = jim.adaptor.firstFullyVisibleRow() + @count
    new GoToLineOrEnd(line).exec jim

# Go to the middle line of the lines that exist and are visible in the viewport.
map 'M', class GoToMiddleLine extends Motion
  linewise: yes
  exec: (jim) ->
