* Update editor.rs
* Makes sure indent_required is calculated according to the selection type
removed the redundant check for required_indent == 0,
introduced a slightly different path for when no selection = None, and calculated the required tab width and indent position accordingly.
* Undo typo
undid an accidental move of a redraw call outside of a loop
* Corrected indenting with rustfmt
formatted the code with rustfmt to pass the failing CI checks