Automatic block selection - cpmcgrath/codealignment GitHub Wiki

In all the examples we have selected the lines we want to perform the alignment on. Explicitly selecting the lines is powerful, but there’s a simpler way – Let the extension figure out the block to align by itself. And it does a pretty good job at it.

The extension starts at your caret position; it then expands up and down until it finds a line which, when trimmed is empty or equals one of the follow strings

  • {
  • }
  • };
  • (
  • )

Examples

Example1

Example2

Tip: The characters defining the start/end of a block can be customised in the Options. See ____