diff --git a/utils_ide/qtcreator/externaltools/qtc_select_surround.py b/utils_ide/qtcreator/externaltools/qtc_select_surround.py new file mode 100755 index 0000000000000000000000000000000000000000..2c2af5f6fa28f45a78ec86c07524effcc29ce09a --- /dev/null +++ b/utils_ide/qtcreator/externaltools/qtc_select_surround.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +import sys + +# TODO, accept other characters as args + +txt = sys.stdin.read() +print("(", end="") +print(txt, end="") +print(")", end="") + diff --git a/utils_ide/qtcreator/externaltools/qtc_select_surround.xml b/utils_ide/qtcreator/externaltools/qtc_select_surround.xml new file mode 100644 index 0000000000000000000000000000000000000000..ca7c9a2964a8f274dbc07d0ad8f8b3b9035a09f5 --- /dev/null +++ b/utils_ide/qtcreator/externaltools/qtc_select_surround.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<externaltool id="qtc_select_surround"> + <description>Surround selection with parentheses or other optionally other characters.</description> + <displayname>Surround selection with parentheses</displayname> + <category>Formatting</category> + <executable output="replaceselection" error="showinpane" modifiesdocument="no"> + <path>qtc_select_surround.py</path> + <input>%{CurrentDocument:Selection}</input> + <workingdirectory>%{CurrentDocument:Path}</workingdirectory> + </executable> +</externaltool>