<p>I can reproduce this, and it's because we list <code>block</code> as a primary keyword, and the lexer folds on the <code>block</code> keyword.  I am not sure what is the right thing to do here as I have nearly zero Fortran knowledge.  And gfortran doesn't really help as it doesn't like your sample file.</p>
<p>The question is probably whether <code>block</code> is a Fortran 90 keyword, and what to do if it's not.  Or whether the Scintilla folder should be more careful in where it accepts a keyword as beginning a fold.<br>
If <code>block</code> is only a keyword in a newer version of Fortran, and it's not a sensible option to alter the folding code, we might have to have more Fortran filetypes for the various versions.</p>
<p>To go further we need more Fortran knowledge, but in the meantime you can remove the <code>block</code> keyword from the <code>primary</code> keyword list in <em>filetypes.fortran</em> and it should work alright.</p>
<hr>
<p>PS: please avoid showing different input and expect them to compare equal, I understand it's not a real factor here, but my first impression seeing your two captures being of different files (simply look at the line numbers) was to believe you overlooked your test and there was no suggestion the file not working in Geany actually worked in NotePad++.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1496#issuecomment-422909621">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ7joJ8BO02wr_JraLHcZQy8cWKf1ks5ucoyigaJpZM4NY6en">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJyoVMGyJZQhbdp_NtfJUcYNuCSZ9ks5ucoyigaJpZM4NY6en.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n in #1496: I can reproduce this, and it's because we list `block` as a primary keyword, and the lexer folds on the `block` keyword.  I am not sure what is the right thing to do here as I have nearly zero Fortran knowledge.  And gfortran doesn't really help as it doesn't like your sample file.\r\n\r\nThe question is probably whether `block` is a Fortran 90 keyword, and what to do if it's not.  Or whether the Scintilla folder should be more careful in where it accepts a keyword as beginning a fold.\r\nIf `block` is only a keyword in a newer version of Fortran, and it's not a sensible option to alter the folding code, we might have to have more Fortran filetypes for the various versions.\r\n\r\nTo go further we need more Fortran knowledge, but in the meantime you can remove the `block` keyword from the `primary` keyword list in *filetypes.fortran* and it should work alright.\r\n\r\n---\r\nPS: please avoid showing different input and expect them to compare equal, I understand it's not a real factor here, but my first impression seeing your two captures being of different files (simply look at the line numbers) was to believe you overlooked your test and there was no suggestion the file not working in Geany actually worked in NotePad++."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1496#issuecomment-422909621"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/1496#issuecomment-422909621",
"url": "https://github.com/geany/geany/issues/1496#issuecomment-422909621",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [geany/geany] Folding is not right for some f90 file (#1496)",
"sections": [
{
"text": "",
"activityTitle": "**Colomban Wendling**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@b4n",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1496,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"geany/geany\",\n\"issueId\": 1496\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/geany/geany/issues/1496#issuecomment-422909621"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 224634791\n}"
}
],
"themeColor": "26292E"
}
]</script>