0

Feature Request: Tab Key to Cycle Through Code Completion Suggestions

Kyung Il Lee 6 hours ago in iPad 0

Hi Alexander,

I would like to request an option to use the Tab key to cycle through code completion suggestions, especially when using Textastic with an external hardware keyboard on iPad.


I currently own an older iOS version of Textastic as well as the current macOS version, and I am considering purchasing the current iPad version as well. This particular feature would make the iPad version especially attractive to me as a serious LaTeX editing environment.


I use TeXShop extensively on macOS, and one of its features I find extremely efficient is its Tab-based command completion. I have also been experimenting with Textastic's custom CodeCompletion files on macOS, and Textastic already seems very close to being able to provide the same kind of workflow.


For example, suppose I define several completions related to a:

A
$a$
$A$

Ideally, I would like to be able to use the keyboard like this:

type: a

Tab    → first completion
Tab    → next completion
Tab    → next completion
Enter  → accept the currently selected completion

An alternative UI would also be perfectly fine:

a
Tab    → open the completion popup and select the first candidate
Tab    → select the next candidate
Tab    → select the next candidate
Enter  → accept

The important part for me is being able to cycle through the candidates by repeatedly pressing Tab, without having to move my hand to the Up/Down arrow keys.

For LaTeX and mathematical typing, this makes a surprisingly large difference. I use many short custom abbreviations, and keeping my hands in the normal typing position makes command completion much faster.


I understand that Textastic currently allows completion-list navigation using the arrow keys and Return. I would not want that behavior removed. Ideally, this could simply be an optional keyboard shortcut configuration.


For example, perhaps the existing completion navigation actions could be exposed under:


Settings → Keyboard Shortcuts


as commands such as:

Select Next Completion
Select Previous Completion
Accept Completion

Then a user could assign:

Tab        → Select Next Completion
Shift-Tab  → Select Previous Completion
Return     → Accept Completion

Ideally, Tab would have this special behavior only while the completion popup is active:

When no completion popup is active:
Tab → normal Tab / indentation / snippet behavior

When completion popup is active:
Tab → next completion
Shift-Tab → previous completion
Return → accept

That way, normal Textastic behavior would remain unchanged outside the completion list.


An even more TeXShop-like option would be to allow popup-free cycling, where each Tab immediately replaces the current text with the next completion:

a
Tab → A
Tab → $a$
Tab → $A$

with no popup required.

However, I think simply exposing “Select Next Completion” as a configurable keyboard command would already solve most of the problem and would be a very useful improvement.


I have already experimented quite a bit with Textastic's custom completion system, including CodeCompletion JSON files and snippets. The completion definitions themselves seem flexible enough; the missing piece is mainly the ability to control completion-list navigation from the Tab key.


Textastic already has many of the qualities I would want in an iPad LaTeX editor, and this would make the hardware-keyboard workflow much closer to what I currently enjoy in TeXShop on the Mac.


Thank you very much for considering it.