[gedit] Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var



commit 9165399b6d38b3cc7fefef7336d0af7874efd1eb
Author: Sindhu S <sindhus live in>
Date:   Fri Jan 10 23:46:17 2014 +0530

    Add GEDIT_CURRENT_DOCUMENT_LANGUAGE env var

 plugins/externaltools/tools/functions.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/plugins/externaltools/tools/functions.py b/plugins/externaltools/tools/functions.py
index 4b758dc..301fad3 100644
--- a/plugins/externaltools/tools/functions.py
+++ b/plugins/externaltools/tools/functions.py
@@ -83,6 +83,9 @@ def run_external_tool(window, panel, node):
         
         capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end))
         
+        if document.get_language() is not None:
+            capture.set_env(GEDIT_CURRRENT_DOCUMENT_LANGUAGE=document.get_language().get_id())
+
         # Selected text (only if input is not selection)
         if node.input != 'selection' and node.input != 'selection-document':
             bounds = document.get_selection_bounds()


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