Maniphest T67213

Add a text editor indent-or-auto-complete operator
Closed, ResolvedTO DO

Assigned To
Campbell Barton (campbellbarton)
Authored By
Campbell Barton (campbellbarton)
Jul 19 2019, 9:38 AM
Tags
  • BF Blender
  • Text Editor
Subscribers
Andrea Monzini (Andrea_Monzini)
Campbell Barton (campbellbarton)
Wilhem Barbier (wbrbr)
Tokens
"Love" token, awarded by bnzs.

Description

Currently Ctrl-Space is uses for auto-complete, which users have noticed - is also used for maximize area. T67203

While Ctrl-Alt-Space can be used as a similar fallback, it's not ideal.

To resolve this we can have an operator that indents (when there is no text before the cursor) otherwise auto-complete.

This can use the Tab key.

This can be done for the Python console as well.

Event Timeline

Campbell Barton (campbellbarton) renamed this task from Text editor indent-or-auto-complete operator to Add a text editor indent-or-auto-complete operator.Jul 19 2019, 9:38 AM
Campbell Barton (campbellbarton) lowered the priority of this task from 90 to Low.
Campbell Barton (campbellbarton) created this task.
Campbell Barton (campbellbarton) mentioned this in T63726: User Interface Module .
Campbell Barton (campbellbarton) updated the task description.
Campbell Barton (campbellbarton) edited a custom field.Jul 19 2019, 9:45 AM
Campbell Barton (campbellbarton) updated the task description.
B (bnzs) awarded a token.Aug 26 2019, 8:57 PM
Campbell Barton (campbellbarton) mentioned this in T68061: Text Editor Module.Sep 2 2019, 9:08 AM
Campbell Barton (campbellbarton) added a project: Text Editor.Sep 4 2019, 2:42 PM
Andrea Monzini (Andrea_Monzini) added a subscriber: Andrea Monzini (Andrea_Monzini).Nov 10 2019, 4:09 AM
Wilhem Barbier (wbrbr) added a subscriber: Wilhem Barbier (wbrbr).Nov 11 2019, 12:16 PM

I managed to implement this change, but I'd like to be sure of what the new behaviour should be:

  • If the selection is not empty, the line is indented
  • If the selection is empty and the character before the cursor is whitespace, the line is indented
  • If the selection is empty and the character before the cursor is not whitepace, the word is autocompleted

Is this what you had in mind ?

Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.Nov 26 2019, 4:24 PM
Campbell Barton (campbellbarton) claimed this task.

@Wilhem Barbier (wbrbr), missed your comment. Made it so any selection indents.