sublimetext-codeformatter icon indicating copy to clipboard operation
sublimetext-codeformatter copied to clipboard

Format only selection

Open PixelT opened this issue 8 years ago • 4 comments

Feature: possibility to format only selection part of code

PixelT avatar Aug 18 '16 13:08 PixelT

Has this been implemented yet?

rutgerrrrr avatar Apr 28 '17 13:04 rutgerrrrr

I've modified the code myself, this seems to work for me:

In CodeFormatter.py, change line 180 from: file_text = sublime.Region(0, view.size()) to: file_text = view.sel()[0] if view.sel()[0] else sublime.Region(0, view.size())

This will populate "file_text" with the selected text or will fall back to the default if nothing was selected.

rutgervalk avatar Jun 08 '18 07:06 rutgervalk

Cf. also issue #335.

LinuxOnTheDesktop avatar Mar 02 '22 00:03 LinuxOnTheDesktop

Is this project abandoned?

LinuxOnTheDesktop avatar Mar 02 '22 00:03 LinuxOnTheDesktop