Editor blues
Mixing different languages like Spin(2), Pasm(2) and C is a great feature of FlexProp. But I don't like the editor. My favorite editor for P2 development is the Propeller Tool because it has the best syntax highlighting and tab/indent handling. Especially the align/insert mode is handy when typing assembler because instructions and comments to the right stay in position while I edit the "if_XY" condition, for example. But unfortunatelly, it only supports Spin and assembler. For C I need to use a different editor. Things get complicated if that C source has inline ASM in it.
Notepad++ is quite nice but it tries to be more intelligent than me and replaces all my (whitespace) indentations with tabs which results in a total mess if I load that code into Flexprop later. Notepad++ has a "replace tabs with spaces" function but I have to repeat that over and over again before saving.
Is there an editor which supports both C and Spin2/Pasm2 highlighting and uses spaces for formatting only? I mean, when I hit the tab key th ecursor jumps to the next indent position but it doesn't insert a tab (ASCII $09) but multiple spaces (ASCII $20) instead.
I hate using tricks like changing the file name extension or cut/paste parts of my source into different files.
Comments
I use Notepad++ too (mainly for flexbasic) and have enabled the "Replace by space" option in the "Tab Settings". If you check that and press Tab you get the number of spaces specified there instead of a tab character. Works fine imho
VIM will do it if you setup for this with
:set expandtab
and also use the SPIN2/Pasm format highlighting plug in that is available. But it's hard to learn if you've not used it before.Ah OK. There is a "replace tabs with spaces" command in the Edit->Nonprintable characters menu. I've only found that but not the tabulator "replace with spaces" option in the options dialog. It's hidden inside the language settings. I haven't looked there.
Thanks!
BTW, the "auto reload files if changed externally" editor option of FlexProp doesn't work. If I save the file in Notepad++ then Flexprop doesn't reload it and doesn't display any message. I have to close the editor tab and reload the file manually. Could this be because the file is on a network drive? However, Notepad++ warns if I change the file with Flexprop and then re-activate the Notepad window.
Ok, as old Emacser I can't resist mentioning that it deals with whitespace configure-ably, and I can ask it to never use tabs amongst a lot of other things. But my home-grown propeller mode for syntax highlighting etc. is not really stellar.
However if I was in the market for an editor these days, there is the new 800 pound gorilla to look at in earnest - VSCode. My understanding is that it comes with good P2 support thanks to Stephen, and it takes the world of software engineers by storm. I'm just the proverbial old dog here with 20 years + of investment in Emacs..
I'd switch to VSCode with pleasure. I've tried it but I still have that problem that prevents me to write to flash (F11). I have no idea why it doesn't work and nobody responded to my post either.
When I google that error-message, I get this: https://stackoverflow.com/questions/48438231/get-parsererror-parentcontainserrorrecordexception-when-executing-pyt
I can't be of more help here as I'm a Linux user.
I guess it happens when you have PowerShell set as your default shell. Try changing your default shell to bash (I think you get it when installing git).
All of a sudden I don't feel like such a loser for not getting VS Code to work.
Craig
Org/Babel.
I'd use every editor that gives me Org/Babel, even if it were
ed
.Oh I love me my org-mode. And thanks to the lsp protocol from VScode and lsp-mode/eglot, that old horse of an editor is learning some nice tricks fast. But I wouldn't recommend switching to it on Windows especially. That's always a pain for me to work under, even though things got better.
Err, what is Powershell? That's mentioned in the stackoverflow topic but I think that has nothing to do with my problem. I don't use powershell, I don't even know what it is.
The option may be a bit misleading. FlexProp only actually tries to reload the file at points when it needs to know what's on disk, e.g. if you recompile. As long as you do all editing in Notepad++ this should work fine. It may be a problem if you are trying to edit in both windows.
Powershell is a windows shell by microsoft. It might not be something you are using consciously, but the error message indicates it is in fact used. Can you share the full task configuration json file?
The new(tm) shell on windows (as opposed to old cmd.exe). I'm pretty sure VSC asks you what your default shell is on first startup. What shell do you get by default in VSC's terminal box?
Spent hours on this class of problem at work one day. Finally figured out that I needed to run the script I was attempting to execute at a regular command prompt. The escaping is different, if I remember correctly.
I've checked a change into github so that now FlexProp also checks for file changes whenever it regains focus. This should make the "auto reload files" option act in a more intuitive way (the changes will show up right away, instead of waiting for a compile).
Very good, thank you. Some days ago, I've lost some changes because I accidentally typed them in the wrong window and saved in the other... My fault, but it's always good to prevent as many careless mistakes as possible.