Page MenuHome

Py Console: Indent and unindent independent of cursor (aligned) [Tab / Shift + Tab / Ctrl + Tab]
Closed, ResolvedPublic


this patch adds improved (un)indentation to the python console

hitting Tab increases indentation no matter where cursor is (inserted at the beginning of the line), aligns to multiple of 4
Example: if there are 5 spaces already, Tab will insert 3 for total of 8, which is a multiple of 4

Shift + Tab decreases indentation, aligned to multiple of 4 (at line start, no matter where cursor is)

Ctrl + Tab inserts a tab (4 spaces) at cursor location similar to what Tab does in trunk, but removed alignment

Added Indent and Unindent operators to Console menu

tested and seems to work :)



Event Timeline

applied r47391.

with one correction, for unindent memmove needed to have +1 added to the length to include the NULL terminator