Home Download Buy Blog Forum Support

How to get complete text contents of active tab?

How to get complete text contents of active tab?

Postby russ_c on Fri Mar 02, 2012 6:36 pm

I'm new to Sublime plug-in development and have read through the API reference, experimented with some simple view methods, but am not sure how to get all the text from the active view besides grabbing it line-by-line. I'd like to grab all the text and either send it to another external command that requires it as a single long string or write the text out to a temporary file that I would then use externally.

Thanks for any direction toward the simplest method,

Russ
russ_c
 
Posts: 2
Joined: Fri Mar 02, 2012 6:10 pm

Re: How to get complete text contents of active tab?

Postby wuub on Fri Mar 02, 2012 6:44 pm

Code: Select all
view.substr(sublime.Region(0, view.size()))
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: How to get complete text contents of active tab?

Postby russ_c on Sat Mar 03, 2012 5:21 am

Thanks for the help wuub. It was so straighforward :oops:
russ_c
 
Posts: 2
Joined: Fri Mar 02, 2012 6:10 pm

Re: How to get complete text contents of active tab?

Postby dherrin79 on Mon Feb 18, 2013 6:35 pm

wuub wrote:
Code: Select all
view.substr(sublime.Region(0, view.size()))



@ wuub. Yep this anwered my question as well. Thanks!
dherrin79
 
Posts: 1
Joined: Sun Feb 17, 2013 11:08 pm


Return to Plugin Development

Who is online

Users browsing this forum: Ajas and 5 guests