emacs-php / php-mode

A powerful and flexible Emacs major mode for editing PHP scripts
GNU General Public License v3.0
580 stars 118 forks source link

while keyword says 'At top level' #778

Open sleetdrop opened 5 months ago

sleetdrop commented 5 months ago

When I input

<?php

while

then type space or ( the cursor doesn't move, and says 'At top level' in the echo area.

If input while in a function or method, it works. Is this related default PSR style or sth?

I am using emacs 29.1 and php-mode 20231217.1125 from melpa

zonuexe commented 5 months ago

@sleetdrop Thanks for the report.

I still don't understand the situation, so could you please explain the following points?

It may be helpful to provide the output of M-x php-mode-debug to resolve the issue.

I still haven't determined which function outputs the "At top level" message. If it is an error, it would be helpful to attach the backtrace output by M-x toggle-debug-on-error to help identify the problem.

Or, if you are able to record a video of your screen, please attach it. This will help us to quickly understand the situation.

We look forward to hearing any additional information.

sleetdrop commented 5 months ago

I expect to write a php while statement block, but the cursor hangs there. here is the screen recording

https://github.com/emacs-php/php-mode/assets/88603/4a15558a-6582-4da0-a046-548219dd3d1a

and I saw the following message in *Message* buffer Debug on Error enabled globally c-append-to-state-cache: At top level [9 times]