Limit text ripping in "rename symbol" function (F2) or "change all occurences" function (Ctrl+F2) #99651
Labels
feature-request
Request for new features or functionality
Milestone
When a symbol is renamed, or a text is changed, with a shorter or longer name, or text, this causes all the text placed to its right to be shifted either to the left if the new name, or text, is shorter than the old one, or to the right if the new name, or text, is longer than the old one.
If the text of several lines has been aligned, or if we use a programming language which requires placing the text in precise locations (we use Cobol and Assembler for a mainframe platform), these shifts no longer respect the alignments implemented, or for languages which require respecting positions this can lead to compilation errors.
We propose that an "intelligent" shift system be implemented:
In order not to create a problem with the current behavior, this function could be controlled by a new option, which should be able to be associated with a language mode. This options would specify the minimum number of spaces to keep during text shifts in the event of renaming of symbols or replacing text.
Example: limit compression of spaces to only 1 (or n) space, expand spaces as soon as more than 1 (or n) space
A value of 0 would disable the functionality.
Use case:
Starting state
Rename symbol "MIDDLE-NAME" to "AHAH"
the new symbol is shorter, the text is shifted to the left: the text is no longer aligned and the area in column 73 is shifted to the left which would trigger a compilation error.
Expected result:
Rename symbol "SHORNAME" to "A-LONGER-NAME"
the new name is longer, the text is shifted to the right: the text is no longer aligned and the area in column 73 is shifted to the right which would trigger a compilation error.
Expected result:
The text was updated successfully, but these errors were encountered: