Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making foo[[bar]] and foo[bar] never expand when bar is "simple" #199

Open
DavisVaughan opened this issue Jan 22, 2025 · 0 comments

Comments

@DavisVaughan
Copy link
Collaborator

See #183

i.e. with

private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] - 1

it should probably never break on the [[ and expand to

private$event_callback_counts[[domain]] <- private$event_callback_counts[[
    domain
  ]] - 
  1

instead it should probably give this, even though the first line exceeds the 80 char limit

private$event_callback_counts[[domain]] <- private$event_callback_counts[[domain]] - 
  1

Related to #163 because we would not want line breaks in $ to force line breaks here!

We will have to nail down what "simple" means, probably:

  • Keywords like TRUE or NULL
  • Identifiers
  • Numerics / integers / complexes
  • etc

Having a list of what makes something "simple" will likely be useful in other places too?

It should probably also respect persistent line breaks if you manually request the expansion? That's quite an edge case though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant