Forum > Editor
Indentation & auto complete after anonymous function
(1/1)
Fibonacci:
After I write anonymous function the IDE doesn't do indentations and code completing, no hints, ctrl+space doesn't work.
Is it just me or this if how it is?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$modeswitch anonymousfunctions} procedure test(p: pointer);beginend; begin test(@procedure begin end); //no auto-indent... //ctrl+space: project1.lpr(8,9) Error: unexpected keyword "procedure" end.
IDE 3.99
Martin_fr:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40371
Fibonacci:
So the workaround for code completion is to enclose procedure with parenthesis:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---test(@(procedurebeginend));
Yet indentation issue remains.
Fibonacci:
Found a fix :)
Thanks Fibonacci, you the best.
Navigation
[0] Message Index