[gedit-list] please help write gedit plugin in vala



Hi, all

I copy some code from https://wiki.gnome.org/Projects/Vala/Gedit3PluginSample, want write a plugin. I want excute some command prefix with "!" in the first 5 lines of current file when press "F5". Normally those commands are compile cmd.

The result almost like below:
       Posix.system("gnome-terminal --working-directory="+path+" -e "+cmd+" &");

Here is compile code:
⭕ valac --pkg gtk+-3.0 --posix --pkg gedit --pkg libpeas-gtk-1.0 --pkg gtksourceview-4 \
 run5.vala -X --shared -X -fPIC --library run5 --output librun5.so
⭕ cp librun5.so run5.plugin ~/.local/share/gedit/plugins/

But now met some trouble, I dont know how to get the **path** of current file. I had attached all two files in email. Sorry for some test code lines in the file.

thanks for all advise.

扫描二维码添加名片到手机

扫一扫,

快速添加名片到手机

Attachment: run5.plugin
Description: Binary data

Attachment: run5.vala
Description: Binary data



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