The inputs with the ​inline​ argument ​"X"​ might not align correctly in the “Settings/Inputs” tab

This warning occurs if two or more inputs with the same inline and group arguments also specify title arguments. Placing multiple inputs with titles on the same line can cause inconsistent input alignment in the “Settings/Inputs” tab.

Historically in Pine Script®, all input*() function calls with non-empty inline arguments did not horizontally align with other inputs in the “Settings/Inputs” tab. Non-inline inputs applied a consistent amount of horizontal spacing between the title and the input field, while inline inputs applied more minimal spacing. This misalignment often negatively affected input readability and aesthetics. Programmers typically attempted to work around this issue by inserting combinations of Unicode spaces into input titles. While that solution helped reduce misalignment, it did not usually produce precise and consistent alignment behavior.

Pine Script now uses an improved model to align all script inputs. With this model, programmers can achieve consistent horizontal alignment for inline inputs without using workarounds such as padding titles with invisible characters. However, the updated alignment rules apply only if all inputs except for the first one on each line have an empty title. If multiple inputs on a line include non-empty titles, those inputs might not align as intended.

The image below demonstrates the differences in old and current input alignment behaviors. The left side shows the old behaviors, and the right shows the current behaviors. On the left side, the inline inputs align their fields differently from other inputs in the tab, and they do not align with any of the non-inline inputs. By contrast, most inline inputs on the right side do align the with the non-inline inputs. However, the inputs on the line with the “Pivot Stats” checkbox still follow the same alignment as before, because each of those inputs includes a separate title:

image

To ensure consistent horizontal input alignment in the “Settings/Inputs” tab, follow these steps:

  1. Use a non-empty string as the title argument for only the first input*() call that uses specific inline and group arguments.
  2. For all other input*() calls that use the same inline and group arguments, include an empty string ("") as the title argument.

The following example script demonstrates how inline input fields align differently if multiple inputs on the same line have titles. In the first group of inline input.int() calls, each call includes a non-empty title argument. In the second group of inline inputs, only the first call specifies a non-empty title, while the others use an empty title. The inputs in the second group align as intended in the “Settings/Inputs” tab. The inputs in the first group do not, and they cause this compiler warning:

//@version=6 indicator("Inline input alignment demo") string TT = "Set the MACD calculation's slow MA length, fast MA length, and signal length, respectively." //@variable The source series for the MACDs. float sourceInput = input.source(close, "Source", "Source series for MACD calculations.") // Group of inputs for the first MACD. Each input on the line has a title, causing incorrect alignment. int fastInput1 = input.int(12, "Slow", inline = "0", group = "First MACD") int slowInput1 = input.int(26, "Fast", inline = "0", group = "First MACD") int sigInput1 = input.int(9, "Signal", inline = "0", group = "First MACD", tooltip = TT) // Group of inputs for the second MACD. Only the first input on the line has a title, resulting in consistent alignment. // The tooltip on the line already clarifies the meaning of the inputs, so specifying multiple titles is unnecessary. int fastInput2 = input.int(24, "Lengths", inline = "0", group = "Second MACD") int slowInput2 = input.int(52, "", inline = "0", group = "Second MACD") int sigInput2 = input.int(18, "", inline = "0", group = "Second MACD", tooltip = TT) // Calculate the two MACDs and plot their difference. [macd1, _, _] = ta.macd(sourceInput, fastInput1, slowInput1, sigInput1) [macd2, _, _] = ta.macd(sourceInput, fastInput2, slowInput2, sigInput2) plot(macd1 - macd2)

Note that:

  • The last input for each group includes a tooltip argument to clarify the meaning of all inputs on the line. We can move the argument to the other input.int() calls for the same line, and the tooltip still appears at the end of the line. However, if multiple inputs on the same line have a specified tooltip, only the last one appears in the script’s settings. See the Input function parameters section of the Inputs page to learn more about tooltip, inline, and other parameters for inputs.
  • Although all the integer inputs use the same inline argument, both sets of three inputs use different group arguments, so they appear on separate lines in the “Settings/Inputs” tab.