From: Lawrence Chan Date: Mon, 28 Oct 2019 19:51:45 +0000 (-0500) Subject: Fix fmt on/off when multiple exist in leaf prefix (#1086) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/23fec8b0f73a142d1796c8ca958230ad52d83c24?ds=inline;hp=23fec8b0f73a142d1796c8ca958230ad52d83c24 Fix fmt on/off when multiple exist in leaf prefix (#1086) The old behavior would detect the existence of a `# fmt: on` in a leaf node's comment prefix and immediately mark the node as formatting-on, even if a subsequent `# fmt: off` in the same comment prefix would turn it back off. This change modifies that logic to track the state through the entire prefix and take the final state. Note that this does not fully solve on/off behavior, since any _comment_ lines between the off/on are still formatted. We may need to add virtual leaf nodes to truly solve that. I will leave that for a separate commit/PR. Fixes #1005 ---