Replies: 2 comments 1 reply
|
I like this idea, because this is really a pain. We have documentation in the rightmost columns and have to use space bar, to get there. I guess an easy approach could be adding white space at opening the source and trim them away during close. Saving should inherit a open and close, to prevent saving to let all the added whitespace gone with the wind. Thank you for this great idea, hope someone feeling also this pain. |
|
I agree that editing at fixed column positions is important for IBM i source members, especially RPG and DDS. I tried to implement similar behavior in a VS Code extension before. Unfortunately, VS Code does not support placing the cursor beyond the actual end of a line. Simulating it would require inserting trailing spaces as the user moves the cursor or clicks, then trying to remove them later. That approach is risky because trailing spaces can be meaningful, and it could create unintended edits, noisy diffs, or conflicts simply from opening and navigating a source member. A more viable approach might be explicit commands such as “pad line to column 45/81/101”, combined with editor rulers for fixed-format languages. This would preserve user control and avoid modifying the document during normal cursor navigation. |
Uh oh!
There was an error while loading. Please reload this page.
I think, it should be possible, to move the cursor in an open source file "behind the physical end-of-line" by using cursor keys and mouse clicks.
Think about typical IBM i source code like this (ruler-like comment added):
or:
But if you want to quickly "jump" e.g. to position 81 in RPG to write your comment, you have to add spaces until you are there. The same applies to DDS source where you write keywords starting in position 45.
I think it would be good, if the editor would add spaces automatically if the cursor moves from a longer line to a shorter line.
Imagine you are at line 10 in position 81 and move the cursor up one line and line 9 has actually empty. Now the editor should place the cursor also in position 81 on line 9. Therefor it should add 80 spaces.
If you leave the line, the editor could trim trailing spaces in the line automatically.
The editor should also add spaces if the cursor is moved to the right at the end-of-line. Simply add one space at a time.
A nice option would be to have "special" cursor positions where e.g.
CTRL+->would jump to and therefor add more spaces at once. Maybe 11, 21, 31, ... or specified positions like 45 (in DDS) and 81 (in RPG, RPGLE) and 101 (in RPGLE). This would speed up editing of one has to add comments to the right of the code.And should also happen, if you position the cursor with a mouse click on position X in a line that is shorter than X characters. Add the correct amount of spaces and place the cursor where the mouse click happend. Remove the trailing spaces, if the cursor leaves the line.
This function should IMHO be optional - probably only for specified file types like RPG, SQLRPG, RPGLE, SQLRPGLE, DDS, SQL, etc. - best would be, to have the option to specify the file types as a list.
What do you think about that?
This would make the VS Code editor more conformant with the LPEX editor in RDi and the way that SEU works - and it possibly can raise acceptance and adoption of Code for IBM i.
All reactions