Dyalog / ride

Cross-platform IDE for Dyalog APL
https://dyalog.github.io/ride
MIT License
204 stars 31 forks source link

dfns newly created in the editor are not formatted correctly - no indentation #216

Closed dyaandys closed 7 years ago

dyaandys commented 7 years ago

New session )ed foo set the contents of the editor to (note no leading spaces)

foo←{ ⍵ 1} EP foo 123 TC note how the function is still not correctly indented. EP )ed foo now the function is correctly indented, and appears so in subsequent trace sessions.

This may be an interpreter issue; if it is, let me know

IDE: Version: 4.0.2855 Platform: Win32 Date: 2017-07-28 17:23:16 +0200 Git commit: 1b2a4abc7a820e23282398c8d85942fd3d588f14 Preferences:{ "favs":"[{\"type\":\"connect\",\"ssh_auth_type\":\"pass\",\"ssh_tnl_auth_type\":\"pass\",\"name\":\"debian7dev\",\"host\":\"debian7dev.dyalog.bramley\",\"port\":\"4502\"},{\"type\":\"connect\",\"ssh_auth_type\":\"pass\",\"ssh_tnl_auth_type\":\"pass\",\"name\":\"dfsaix\",\"host\":\"10.0.61.100\",\"port\":\"9003\"},{\"ssh_auth_type\":\"pass\",\"ssh_tnl_auth_type\":\"pass\",\"name\":\"mac0\",\"host\":\"mac0\"},{\"ssh_auth_type\":\"pass\",\"ssh_tnl_auth_type\":\"pass\",\"name\":\"local\",\"host\":\"127.0.0.1\",\"port\":\"9999\",\"type\":\"start\",\"exe\":\"C:\\Program Files\\Dyalog\\Dyalog APL-64 16.0 Unicode\\dyalog.exe\"},{\"ssh_auth_type\":\"pass\",\"ssh_tnl_auth_type\":\"pass\",\"name\":\"p7-61qa\",\"host\":\"p7-61qa\",\"port\":\"4503\"}]", "indent":"0", "kbdLocale":"en_GB", "lbarOrder":"← +-×÷*⍟⌹○!? |⌈⌊⊥⊤⊣⊢ =≠≤<>≥≡≢ ∨∧⍲⍱ ↑↓⊂⊃⊆⌷⍋⍒ ⍳⍸∊⍷∪∩~ /\⌿⍀ ,⍪⍴⌽⊖⍉ ¨⍨⍣.∘⍤@ ⍞⎕⍠⌸⌺⌶⍎⍕ ⋄⍝→⍵⍺∇& ¯⍬", "lineNums":"0", "pfkeys":"[\"\",\"\",\"{⍺ ⍵} \",\"FOO \",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]", "selectedExe":"C:\Program Files\Dyalog\Dyalog APL-64 16.0 Unicode\dyalog.exe", "title":"{WSID} {PID}", "wse":"1", "zoom":"-2" }

Interpreter: Version: 16.0.30448 Platform: Windows-64 Edition: Unicode/64 Date: Jul 21 2017 at 20:18:55

jayfoad commented 7 years ago

I think this is behaving as expected. You have got the "Indent content when an editor is opened" option enabled, so we do an automatic reformat (RD) when the editor is opened on foo.

dyaandys commented 7 years ago

Hmm .. the reason I raised this is because until you edited the function for the second time, it's not possible to have the cursor on foo[1] and edit the function .. perhaps that's what we should then fix.

It's also a shame that the only way I can reformat the function in the editor is to hit Numpad-/ - a toolbar or menubar option for reformat would be nice as that keystroke isn't obvious, and its a long way down the shortcut list in the preferences dialog.

Sort of ok to have this closed then ..

jayfoad commented 7 years ago

Hmm .. the reason I raised this is because until you edited the function for the second time, it's not possible to have the cursor on foo[1] and edit the function .. perhaps that's what we should then fix.

There's a command EMD that does exactly this. It's on Shift-F3 by default.

dyaandys commented 7 years ago

Have asked that the documentation makes a more obvious reference to the functionality that EMD offers the RIDE user guide. At the moment its functionality only appears in the list of shortcuts ..