It can often be necessary to gather some input from a user in order for a command to know what exactly it should do. However we know that commands take explicit arguments, so how do we gather this kind of information? The answer is Input Handlers.
Sublime Text allows commands to prompt the user for the values of missing arguments in a free form manner, allowing for gathering arbitrary strings of text, choosing items from a list, doing input validation and even providing a preview of what the command can do.
In this lesson, we take a deeper dive into Input Handlers in Sublime Text and take a look at the methods we can use in our handlers to control things like placeholder text, initial values and even how to perform input validation.
00:00 - Introduction
05:04 - The name method
07:26 - The initial_text method
08:04 - The placeholder method
08:43 - The description method
10:21 - The preview method
11:46 - The validate method
12:41 - The cancel and confirm methods
13:57 - The next_input method
14:48 - ListInputHandler Methods
18:43 - The list_items method
22:31 - The input handler stack
26:55 - Lesson recap
Plugin 101 playlist: • Plugin 101 - How to write Packages for Sub...
Introduction to input handlers: • [P101-09] Introduction to Sublime Text Inp...
Sublime Configuration: https://git.io/fARZ9
Official Documentation: https://www.sublimetext.com/docs/3/
Unofficial Documentation: https://docs.sublimetext.io/
Sublime Forum: https://forum.sublimetext.com/
Sublime Discord: / discord
Configuring Sublime Text: • [CQ15] How does the config system in Subli...
Watch live streams: https://odatnurd.net/live
#SublimeText #Plugin101 #Tutorial
Subscribe for more videos: https://www.youtube.com/user/nurdz?su...
Subscribe for more Sublime live streams: / @terencemartinlive
Follow me on Twitter: / odatnurd