• Jackson Ray Hamilton's avatar
    Indent expressions in JSXAttributes relative to the attribute’s name · 2b4cc702
    Jackson Ray Hamilton authored
    * lisp/progmodes/js.el (js-jsx--syntax-propertize-tag): Refer to the
    beginning of a JSXExpressionContainer’s associated JSXAttribute (so
    line numbers can be calculated later).
    (js-jsx--text-properties): Also clear the new text property
    js-jsx-expr-attribute.
    
    (js-jsx--indenting): Remove.
    (js-jsx--indent-col, js-jsx--indent-attribute-line): New variables.
    (js-jsx--indentation): Instead of alternating between two separate
    column calculations, neither necessarily correct, bind the JSX column
    such that the second call to js--proper-indentation can use it as a
    base column.
    (js--proper-indentation): Use JSX as the base column for some indents
    while indenting JSX.
    
    * test/manual/indent/jsx.jsx: Add more tests for expression indents.
    2b4cc702
jsx.jsx 5.71 KB