Skip to content

Indenting line labelsΒ #141

Open
Open
@blaylockbk

Description

@blaylockbk

I'm using this example from Milan Curcic's book
https://github.com/modern-fortran/stock-prices/blob/master/src/mod_io.f90

integer function num_records(filename)
  ! Return the number of records (lines) of a text file.
  character(len=*), intent(in) :: filename
  integer :: fileunit
  open(newunit=fileunit, file=filename)
  num_records = 0
  do
    read(unit=fileunit, fmt=*, end=1)
    num_records = num_records + 1
  end do
  1 continue
  close(unit=fileunit)
end function num_records

When fprettify formats this, the line label is pushed all the way left.

integer function num_records(filepath)
   ! Return the number of records (lines) of a text file.
   character(len=*), intent(in) :: filepath
   integer :: fileunit
   open (newunit=fileunit, file=filepath)
   num_records = 0
   do
      read (unit=fileunit, fmt=*, end=1)
      num_records = num_records + 1
   end do
1  continue                           ! <----- Note this line is dedented
   close (unit=fileunit)
end function num_records

I realize there are legacy reasons for putting the line label in the first column, but this interferes with code folding (VS Code). Is there any possibility of turning this off and letting the line label to be aligned with the rest of the content?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement to existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions