r/divi • u/DisasterBeautiful444 • 10d ago
Discussion Search Bar within a Code
Hi!
I would like to report a usability problem in the code editor of the Code module (Divi Builder).
When I press Ctrl+F, type a word and press Enter, the editor jumps to each match. For example, if the word appears twice in my code, Enter shows the first match and then the second one. But when I press Enter a third time, and there are no more matches, the editor gives no message such as "No more results". The cursor is simply placed inside the code. The same happens when I search for a word that does not exist in the code at all.
If I do not notice this, I start typing, and I change the code by accident. In my case I could not undo these changes, and the code was damaged. This is very risky when the Code module holds a whole page.
I know the editor is based on CodeMirror, but the Divi team chose it and its search behavior, so I am asking for considering a safer default. Editors like VS Code keep the search bar open until Esc is pressed, show "No results" when nothing is found, and never move the cursor into the text on Enter. CodeMirror supports a persistent search mode, so it should be possible to make Ctrl+F behave that way. Please also check that Ctrl+Z works reliably in this editor.
Thank you for considering it. It would make working with custom code in Divi much safer.