StyLua icon indicating copy to clipboard operation
StyLua copied to clipboard

If function arguments get multi lined, still fill up until column_width

Open Stanzilla opened this issue 3 years ago • 2 comments

Hey there, I'm currently trying to find a way to let StyLua still use the available space left before breaking up function arguments.

The current version turns this

local function UpdateMatchData(time, matchDataChanged, unit, index, filter, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, isBossDebuff, isCastByPlayer, spellId, modRate)

into this

local function UpdateMatchData(
  time,
  matchDataChanged,
  unit,
  index,
  filter,
  name,
  icon,
  stacks,
  debuffClass,
  duration,
  expirationTime,
  unitCaster,
  isStealable,
  isBossDebuff,
  isCastByPlayer,
  spellId,
  modRate
)

And what I want is basically

local function UpdateMatchData(time, matchDataChanged, unit, index,  filter,  name,  icon, -- Until column_width
  stacks,  debuffClass,  duration,  expirationTime,  unitCaster,  isStealable,  isBossDebuff, -- Until column_width
  isCastByPlayer,  spellId,  modRate -- Until column_width
)

Stanzilla avatar Aug 24 '22 21:08 Stanzilla

This is not something StyLua currently supports, and unfortunately its unlikely it ever will.

I can see how in this case it could potentially benefit, but I'm hesitant to add it in. I'll give it a bit of a think

JohnnyMorganz avatar Aug 27 '22 09:08 JohnnyMorganz

This is not something StyLua currently supports, and unfortunately its unlikely it ever will.

I can see how in this case it could potentially benefit, but I'm hesitant to add it in. I'll give it a bit of a think

Awesome, thank you! Alternatively, maybe an option to turn off the breaking up feature?

Stanzilla avatar Aug 29 '22 08:08 Stanzilla