decklin / yakshave

Yet Another Key-binding System Halfway Approximating Vi or Emacs (for Chromium)
Other
18 stars 4 forks source link

more flexible $EDITOR handling #12

Closed taobert closed 13 years ago

taobert commented 13 years ago

Thanks very much for yakserver.

It seems that some editors (gvim) put themselves in the background when launched unless an argument is passed to them. Yakserver doesn't play nicely when the editor goes into background, and currently won't work if arguments are passed in $EDITOR (eg EDITOR="gvim -f") as the call to system expects $EDITOR to contain only the executable.

It'd be nice to be able to use $EDITOR more flexibly (i like "rxvt -e vim"). While it's fairly simple to write a wrapper shell script to avoid this, the fix in yakserver is simple too, and might save someone else the effort..:)

The following patch changes this...

bye TAO.

*\ yakserver-1.0/modules/edit.rb 2010-01-15 08:20:55.000000000 +1100 --- yakserver-1.0.tweaked/modules/edit.rb 2011-02-03 20:27:24.000000000 +1100


* 11,17 ** temp = Tempfile.new('yakserver') temp.write(data) temp.close ! system ENV['EDITOR'], temp.path read_and_unlink(temp) end

--- 11,17 ---- temp = Tempfile.new('yakserver') temp.write(data) temp.close ! system ENV['EDITOR'] + " " + temp.path read_and_unlink(temp) end

taobert commented 13 years ago

Hmmm..

It seems this would have been better added on the yakserver repo. I'll repost it there..

Sorry for the noise.

bye TAO.