posit-dev / posit-dev/air

`Format selection` too picky about selection?

Open
#370 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
446
Forks
32
Avg merge
16h 48m
Merged PRs (30d)
1

Description

I noticed that Format selection only works when the selection includes just the code and nothing else as shown in the first image:

Image

However, I sometimes select code that I would like to reformat by repeatedly tapping Cmd+L (select line) in which case the selection will include the line end and the cursor will be in the line underneath the selection. In this case, Format selection does not do anything.

Image

I would like to suggest making Air less "picky" about the selected area if this does not lead to any conflicts I'm not thinking about.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named in the issue. First reproduce the behavior by selecting code with Cmd+L and invoking Format selection; investigate the selection handling, then confirm that selections including line ends and the following cursor position are formatted without breaking existing cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.