How to remove trailing space (upon save)?

Asked by Filipe Manuel Azinhal Funenga on 2013-03-15

I'm trying to write a plugin for scratch in order to strip trailing spaces upon saving. So far I'was able to write this: https://gist.github.com/ffunenga/5166490

Look at this python implementation: https://github.com/jonleighton/gedit-trailsave/blob/master/trailsave.py

Is there a way to write a similar plugin to scratch in Vala?

Question information

Language:
English Edit question
Status:
Solved
For:
Scratch Edit question
Assignee:
No assignee Edit question
Solved by:
Filipe Manuel Azinhal Funenga
Solved:
2013-03-24
Last query:
2013-03-24
Last reply:
2013-03-22
Mario Guerriero (mefrio-g) said : #1

Write a scratch plugin is quite simple but it is also a bit different from writing a plugin for Gedit. Here is an example of complete scratch plugin: http://bazaar.launchpad.net/~elementary-apps/scratch/scratch/view/head:/plugins/contractor/contractor.vala

you can easily convert it to python and adapt to whatever you want to do. I would be happy to review and push your plugin in trunk too :)

Solved! New plugin commited