Keep $QUTE_COUNT unset if a count is not given

This commit is contained in:
wishfort36 2018-08-12 22:39:32 +02:00
parent a9725ddb4a
commit b05738dd6c
2 changed files with 4 additions and 2 deletions

View File

@ -1252,9 +1252,11 @@ class CommandDispatcher:
env = { env = {
'QUTE_MODE': 'command', 'QUTE_MODE': 'command',
'QUTE_SELECTED_TEXT': selection, 'QUTE_SELECTED_TEXT': selection,
'QUTE_COUNT': str(count), # must be a string
} }
if count is not None:
env['QUTE_COUNT'] = str(count) # must be str
idx = self._current_index() idx = self._current_index()
if idx != -1: if idx != -1:
env['QUTE_TITLE'] = self._tabbed_browser.widget.page_title(idx) env['QUTE_TITLE'] = self._tabbed_browser.widget.page_title(idx)

View File

@ -4,7 +4,7 @@ if [ "$QUTE_COUNT" = "5" ]; then
echo "message-info 'Count is five!'" >> "$QUTE_FIFO" echo "message-info 'Count is five!'" >> "$QUTE_FIFO"
elif [ "$QUTE_COUNT" = "None" ]; then elif [ -z "$QUTE_COUNT" ]; then
echo "message-info 'No count!'" >> "$QUTE_FIFO" echo "message-info 'No count!'" >> "$QUTE_FIFO"