randy3k / AlignTab

An alignment plugin for Sublime Text using regular expression
MIT License
631 stars 25 forks source link

Replace Input by InputHandler #82

Closed deathaxe closed 6 years ago

deathaxe commented 6 years ago

The latest release of ST supports InputHandlers to pass arguments to commands.

How about using a ListInputHandler in align_tab command to directly list the history and the named patterns? This way the align pattern could directly be entered in the Command Palette with all the most important/recent ones by hand.

The currently used view.show_input() to enter the pattern could either be removed or used for backward compatibility if InputHandlers are not supported.

randy3k commented 6 years ago

sounds like a good idea. With that said, I don’t think i am going to spend time on this one. (to be honest, I hv never read the doc for InputHandler and have never known how it works)

deathaxe commented 6 years ago

Seems not to be too difficult. Already played around with it a bit. Maybe prepare a PR.

randy3k commented 6 years ago

one potential problem though is that the InputHandler may block the view when the preview mode is on.

deathaxe commented 6 years ago

You mean it hides the part of the content, which is to be aligned? This is what I realized while prototyping.

randy3k commented 6 years ago

Ya, it’s what I meant.

deathaxe commented 6 years ago

Even though the InputHandlers can improve the workflow, the disadvantage of hiding the view partly causes them to not being suitable for that use case.