Can someone push me in the right-direction with studying/developing a plug-in please?
The second to last line of the following code is my sticking point at the moment.
[code]import sublime, sublime_plugin
class ExampleCommand(sublime_plugin.TextCommand):
def run(self, edit):
# self.view.insert(edit, 0, āHello, World!ā)
the_sels = self.view.sel()
for a_sel in the_sels:
# the_text = self.view.substr(a_sel)
# self.view.insert(edit, 0, the_text)
# self.view.replace(edit,a_sel,āhowdyā)
the_text = self.view.line(a_sel) # the current line of text?
self.view.insert(edit, 0, the_text)[/code]
I want to read (store) the current line of text. How do I achieve this please?
- Also, do I need to loop through all selections, or is it possible just to specify the current line/ cursor location?
- How do I read/store the current āpointā? That is, the cursor position (on the current line)?
Andy.