<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Using trailing "_" with If statement breaks line positioning when debugging"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=128263">128263</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using trailing "_" with If statement breaks line positioning when debugging
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Inherited From OOo
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>BASIC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mikekaganski@hotmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>In a new Basic module, replace all boilerplate with this code:

Function Foo()
    If 0 Then print 1
    If 0 Then _
        print 1
    If 0 Then _
        print 1
End Function

Sub Bar
    print "Bar"
End Sub

Note that all If statements there are using single-line syntax without EndIf,
and last two of them are written in two lines each, with "_" to break the line
into two.

Now try to put cursor into Bar, on the line with "print 1", and press F5 to run
it. Instead of executing it, it will open LibreOffice Basic Macros dialog, as
if you had put cursor outside of any macro.
The same result would be when you put cursor to the last line of Bar (with "End
Sub"), but Bar would run if you put cursor to "Sub Bar", *or to the line just
above*, or even *if you put cursor to the last line of Foo (with "End
Function")*! This shows that IDE treats lines incorrectly, shifting by 2 lines.

If you replace any of the two-lined Ifs into a single-lined If (to look like
the first If), then the shift will become 1 line; and replacing both 2-lined
Ifs with 1-lined variant makes it all OK.

Also the same problem is with putting breakpoints.

Tested with Version: 6.3.3.1 (x64)
Build ID: f41f4c7f9507aeca13cb9df51f34d80e8ba30a99
CPU threads: 12; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded

and also with OpenOffice.org 3.2.0 OOO320m12 (Build:9483) - in that old
version, only Main is run when you press F5, so the problem is only visible as
breakpoint displacement.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>