You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
integerfunctionnum_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 =0doread(unit=fileunit, fmt=*, end=1)
num_records = num_records +1end do1continueclose(unit=fileunit)
endfunction num_records
When fprettify formats this, the line label is pushed all the way left.
integerfunctionnum_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 =0doread (unit=fileunit, fmt=*, end=1)
num_records = num_records +1end do1continue ! <----- Note this line is dedented
close (unit=fileunit)
endfunction 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?
The text was updated successfully, but these errors were encountered:
blaylockbk
changed the title
Indenting for line labels
Indenting line labels
Oct 14, 2022
This behavior is correct. Although, I am not able to find an official documentation about the label specifier. From my experience, it is a good practice to put label at the first column of a line.
I'm using this example from Milan Curcic's book
https://github.com/modern-fortran/stock-prices/blob/master/src/mod_io.f90
When fprettify formats this, the line label is pushed all the way left.
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?
The text was updated successfully, but these errors were encountered: