tweekmonster / braceless.vim

:snake: Text objects, folding, and more for Python and other indented languages.
395 stars 13 forks source link

Found a pathological case for indenting #45

Closed beaugunderson closed 7 years ago

beaugunderson commented 7 years ago
class NewRx(ScriptMessageToSurescripts):
    """
    The NewRx messages to be transmitted have been developed using the NCPDP SCRIPT standard. A
    Status, Error, or Verify response is always sent after a NewRx message.
    """

    def surescripts_medication(self, med_id, quantity_value, directions, days_supply,
                               written_date, refills, substitutions_allowed):
        # 38 = Original Qty
        # QS = Quantity Sufficient (The service level for the pharmacy must be enabled for LTC for
        #      all QS orders.
        #
        # For NewRx:
        # - If Value = "0" (zero), then DRU- 020-03 value must be "QS" and the receiver must be
        #   setup as LTC.
        # - If Value is greater than "0" (zero), then CodeListQualifier value must be "38".
        quantity.CodeListQualifier = '38'

        # Where possible, quantities should reflect the actual metric quantity to be dispensed.
        # Example: Use "Amoxicillin 250mg/5ml, 150 ml" instead of "Amoxicillin 250mg/5ml, 1
        # bottle".  The use of "C38046-Unspecified" should be limited to instances in which none of
        # the available qualifiers in the Units of Measure table can be applied. Examples of
        # improper use: Drug description— Amoxicillin 500 mg Oral Capsule, Quantity 30 and Potency
        # Unit Code sent "C38046-Unspecified, "instead of "C48480 - Capsule Dosage Form".
        #
        # For a list of FMT codes, go to: http://evs.nci.nih.gov/ftp1/NCPDP/About.html. This list
        # should be updated on a monthly basis. Use the NCPDP QuantityUnitOfMeasure Terminology
        # rows from the downloaded data.
        #
        # Example rows:
        #
        # C48473  Ampule   Ampule Dosing Unit   A dosing unit equal to the amount of active ingredient(s) contained in an ampule.
        # C48474  Bag      Bag Dosing Unit      A dosing unit equal to the amount of active ingredient(s) contained in a bag.
        # C48477  Bottle   Bottle Dosing Unit   A dosing unit equal to the amount of active ingredient(s) contained in a bottle.
        # C48478  Box      Box Dosing Unit      A dosing unit equal to the amount of active ingredient(s) contained in a box.
        # C48480  Capsule  Capsule Dosing Unit  A dosing unit equal to the amount of active ingredient(s) contained in a capsule.
        quantity.PotencyUnitCode = ''

For some reason every line including and after the comment line containing "C48478" will be indented to column 37 (can you test this by saving the code above to a file, then executing ggVG= ).

beaugunderson commented 7 years ago

(we use a 99 column limit; not sure if that's relevant, and those lines are longer because there's no good way to break them and they're from the database...)

tweekmonster commented 7 years ago

Yeah I've been noticing issues every now and then with the indentation of nested blocks. I'll need to investigate when I find some time.

tweekmonster commented 7 years ago

@beaugunderson Sorry for the delay. This was a little tough to track down on a spotty schedule.