Skip to content

Provide variable for current selection #1

@rchl

Description

@rchl

I was checking your code to see if I could use it to replace my clang-format plugin [1] and found that my plugin also supports formatting just the selection. Or at least passing the current selection to clang-format [2].

Maybe you could provide variables that would expand to selection_start, selection_end offsets, and also selection_length?

(Although, I've just realized while writing this, that we wouldn't want to pass -offset and -length when the selection is empty so that could be another thing that would make supporting this tricky...)

[1] https://github.com/rchl/SublimeClangFormat
[2] https://github.com/rchl/SublimeClangFormat/blob/9d4f804e82b471928fab0c347ccabefccaf9240c/ClangFormat.py#L128-L132

(Also, I would really want to run formatting on a separate thread so that the UI doesn't block when formatting MB-big files).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions