GNOME Bugzilla – Bug 721946
Add new env var GEDIT_CURRENT_DOCUMENT_PATH
Last modified: 2019-03-23 20:34:17 UTC
Created attachment 265950 [details] [review] Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var I'd like to have this reviewed to know what I am doing wrong. Currently the env var contains None.
Review of attachment 265950 [details] [review]: It doesn't make sense to add it there. This needs to be added in run_external_tool, have a look at where GEDIT_CURRENT_LINE is set for example.
Created attachment 265962 [details] [review] Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var Added line to correct place. returns language of current document.
Review of attachment 265962 [details] [review]: See the comment. ::: plugins/externaltools/tools/functions.py @@ +84,2 @@ capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end)) + capture.set_env(GEDIT_CURRRENT_DOCUMENT_LANGUAGE=document.get_language().get_id()) as said on irc, get_language() might return None, so you need to do get_id only if get_language if not none
Created attachment 265965 [details] [review] Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var
Review of attachment 265965 [details] [review]: Looks good.
Pushed to master in 9165399 Available at https://git.gnome.org/browse/gedit/commit/?id=9165399b6d38b3cc7fefef7336d0af7874efd1eb Marking bug as RESOLVED and FIXED.