jeetsukumaran / vim-indentwise

A Vim plugin for indent-level based motion.
220 stars 17 forks source link

Interpreting the empty line to be on the same level as surrounding statements #16

Open moll opened 4 years ago

moll commented 4 years ago

Hey,

Thank you for taking the time to maintain IndentWise! I noticed empty lines seem to be interpreted as lacking any indentation. What do you think of instead interpreting empty lines as being on the same level as the surrounding statements? For example, given a hypothetical Haskell source file with the cursor at | (line 4):

describe "foo" $ do
  it "x" $
    return ()
|
  it "y" $
    return ()

  it "z" $
    return ()

describe "bar" $
  return ()

What about having the "jump to previous/next equal indent" functions, instead of jumping to "describe bar", jump to "it x" or "it y" respectively? I reckon for that it'd need to first look forward to identify the indent level of the next non-blank line, and then either stay there or go backwards.

Thanks!