HI,
On Feb 18, 2008 8:46 PM, Enrico Tröger enrico.troeger@uvena.de wrote:
I don't understand what you mean, the two "current file"s confuse me :)
Sorry, I should read what I'm writing before hitting the send button :D. Steps to reproduce:
- Geany working copy, only plugins/vcdiff.c is modified, all other
files are unmodified from SVN
- start Geany and open the file ChangeLog from this working copy
- then Tools->VCdiff->From Current File
- instead of reporting "No changes were made", it shows the changes
from plugins/vcdiff.c
If more files are changed, these diffs are also shown. So, I guess passing the file argument to the svn command line seems to be broken.
I didn't do much testing but I guess it's only a small error.
It uses its own spawn functions based on CreateProcess and CreatePipe. Ideally we may create a common wrapper for all platform specific spawn (until glib works correctly). It is not yet complete as I was not sure
Yes, this would be a good idea and especially to save duplicate code because we need your code in Geany, in the vcdiff plugin and Frank and Yura probably want to use it also in their GeanyVC plugin. Not to mention any other plugins which want to execute some programs on Windows. Maybe we should put your code into src/win32.c. And we create a wrapper function for g_spawn_sync() and g_spawn_async() which just call these functions on non-Windows systems, else the Win32 specific versions. Could you also create a geany_w32_spawn_async()?
I first tried to do that but win32 functions are not exported and thus not callable by plugins. It will require a dllexport first (and probably some def files too). However I agree, the win32 function fits
Then we add these wrapper functions to the plugin API just like any other function in Geany. So, plugins don't know anything about all the different handling, they just use Geany's utils_spawn_sync() and the correct code is executed by Geany.
The last paragraph is what I meant, create a wrapper around the OS specific functions and export it via the plugin API. My first attempt was to use the win32.c function directly.
Attached is an updated version, the changes are: - Fixed bug when diffing a single file - stderr support implemented (function sets now both stdout and stderr - a couple of leaks and error checks - a bit cleaner
What I still have to do is: - display errors using the various UI methods when necessary - move the win32 codes to win32.c - add utils_spawn_sync to the struct UtilsFuncs
I don't see a need of async call right now, I will implement sync only for now. However, on windows it will be async anyway, but I don't feel confortable enough with geany to go down the road of non blocking async IO for the plugins, maybe later :)
let me know how it works and what you like to add/change,
Cheers,