oakmac / vscode-parinfer

Parinfer for VS Code
MIT License
167 stars 20 forks source link

When something is selected, use indent mode instead of smart mode #33

Open oakmac opened 6 years ago

oakmac commented 6 years ago

Shaun says:

screenshot_2018-08-17_14-35-17

screenshot_2018-08-17_14-43-38

screenshot_2018-08-17_14-43-52

screenshot_2018-08-17_14-44-03

screenshot_2018-08-17_14-45-12

This might be related to Issue #28

shaunlebron commented 6 years ago

This is automatically done by the library: https://github.com/shaunlebron/parinfer/blob/master/lib/parinfer.js#L1543

The API just needs to know if any text is selected or not, which it receives via the options.selectionStartLine.

The API also uses this option for tab stops, but it just needs to be non-null if any selection is made.