The patch for indent went through a lot of iterations and changes. I have summarized everything up until this point as to where I am with my latest patch:
- Selected lines are indented as well as multiple lines.
- Indentation on multiple lines is grouped into a single undo/redo event.
- Rather then replacing the entire line with <indention> + <line text> only indentations are inserted this time.
- After indenting if there is a selection, the selection is retained.
- Indentation tab size on multiple lines is now consistent
- When undoing the selection retains its expected position.
After Julian reviewed my final patch he had recommended me the following changes before he could push the patch.
1.) As of now the code is a bit complicated to read and has to be structured properly.
2.) Be smart about leading spaces to determine how many tab spaces are required to align a text. An example Julian provided:
For instance if tabstop = 4 and current line follows with cursor position at col 1 :
“space|spaceHello”
After hitting “tab” it would add 3 spaces since we’re using cursor position to determine how many spaces are needed.
“spacespacespacespace|spaceHello”
Now we have 5 spaces in front of Hello. Instead there should be only 4 because we need to take the leading spaces into accountability and therefore only 2 spaces are required to align “Hello”:
“spacespacespace|spaceHello”
It is clear to me as to what needs to be done and how to do it. I will have my final patch before the end of this week.
Cheers!











