From 5ae537136a308a970fdd37ace3ffae2104c7a552 Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Sun, 14 Jul 2019 12:07:23 +0800 Subject: [PATCH] automatically update first letter to lowcase for lwc name --- lwc.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lwc.py b/lwc.py index cf0eeb8..bdeeaed 100644 --- a/lwc.py +++ b/lwc.py @@ -17,16 +17,6 @@ def run(self): "", self.on_input, None, None) def on_input(self, lwc_name): - if not lwc_name or lwc_name[0].isupper(): - message = "The folder name must start with a lowercase character, "+\ - "do you want to try again?" - if not sublime.ok_cancel_dialog(message): - return - return self.window.show_input_panel( - "Please Input Your Component Name: ", - "", self.on_input, None, None - ) - # Create component to local according to user input if not re.match('^[a-zA-Z]+\\w+$', lwc_name): message = 'Invalid format, do you want to try again?' @@ -37,6 +27,9 @@ def on_input(self, lwc_name): "", self.on_input, None, None ) + # Update first letter to lower case + lwc_name = lwc_name[0].lower() + lwc_name[1:] + # Get settings settings = context.get_settings() workspace = settings["workspace"]