Skip to content

Commit

Permalink
Remove initial selection workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann committed Oct 25, 2023
1 parent 927a2df commit 024e4ba
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plugin/core/input_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ def attach_listener(self) -> None:
raise RuntimeError('Could not find the Command Palette input field view')
self.listener = InputListener(self)
self.listener.attach(buffer)
# --- Hack needed because the initial_selection method is not supported on Python 3.3 API
selection = self.input_view.sel()
selection.clear()
selection.add(len(self.text))
# --- End of hack

@final
def list_items(self) -> List[sublime.ListInputItem]:
Expand All @@ -143,7 +138,8 @@ def initial_text(self) -> str:
sublime.set_timeout(self.attach_listener)
return self.text

# Not supported on Python 3.3 API :-(
# This requires a fix for https://github.com/sublimehq/sublime_text/issues/6175 - it can manually be fixed in
# sublime_plugin.py
def initial_selection(self) -> List[Tuple[int, int]]:
pt = len(self.text)
return [(pt, pt)]
Expand Down

0 comments on commit 024e4ba

Please sign in to comment.