Sublime Forum

Set position to end after insert command?

#1

Hi,
I want to add a default after creating a text file, but do not know how I can set the cursor at end of file
The current code is:

...
            content = "<?php\n/**\n *\n */\n\nif ( ! defined( 'ABSPATH' ) ) exit;\n"
            self.view.insert(edit, 0, content)
...
0 Likes

#2
sel = self.view.sel()
sel.clear()
sel.add(sublime.Region(self.view.size(), self.view.size()))
0 Likes