Re: [gedit-list] [Help Needed] How to get the buffer of a newly opened file from a gedit plugin file?



Hi,

On Thu, May 07, 2015 at 03:38:14AM +0530, Pallab Pain wrote:
I've written a code for a Gedit Plugin which opens another file,

self.window.create_tab_from_location(Gio.file_new_for_path(file_path),
                                    None, line_number, 0, False, True)

Now, after the file gets opened in a separate tab. I want access to its
buffer. I wrote the following code for that

view = self.window.get_active_view()
buffer = view.get_buffer()

Somehow, I'm unable to access the buffer.

gedit_window_create_tab_from_location() returns the GeditTab.

Btw, it's recommended to use the latest gedit version for writing
plugins. Because sometimes the API changes, so it's less maintenance
work if the plugin is developed against the latest version (with jhbuild
for example).

Cheers,
Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]