Compare commits
125 Commits
9b083515ba
...
c_support
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f9d6e9214 | |||
| 40ceb04bf8 | |||
| b12381dbce | |||
| 3d0ae84dc2 | |||
| afa368c519 | |||
| 118638e42e | |||
| 723426b1d6 | |||
| c8547ec45b | |||
| e83507eb9b | |||
| 382e62df95 | |||
| 7d0b40d651 | |||
| 2877ebc8a2 | |||
| 04ba6663ee | |||
| 676a0e6185 | |||
| 5dc1da5dbf | |||
| 7511a5445e | |||
| 3860db2c26 | |||
| bded0b22b1 | |||
| 478f1d156f | |||
| e86b600cd9 | |||
| c4923c5871 | |||
| c2d128dd42 | |||
| 166cd5f4d8 | |||
| 782ed0298a | |||
| 3de27dac4f | |||
| 1c7c2ec90e | |||
| dee9141e91 | |||
| 1b6493d3a8 | |||
| 36d1940c7b | |||
| c69db69c69 | |||
| c74fa5b113 | |||
| e21995d13e | |||
| 26546dfe27 | |||
| a974068883 | |||
| d13a4adba5 | |||
| 2dd7b7239e | |||
| 4b09b1e97d | |||
| 807131eee2 | |||
| aaa027398a | |||
| bc2808c3e4 | |||
| 1758afd100 | |||
| c2ebf1e724 | |||
| 72a23954f6 | |||
| f865cc2b5e | |||
| 6fd0d2a77b | |||
| ebc2e2eef8 | |||
| b12273809b | |||
| 611ed34dc1 | |||
| d4b7e4e453 | |||
| 80d7fc1256 | |||
| 2e5c7640e5 | |||
| 0c3ef13f25 | |||
| 6f858814ce | |||
| 5f8f7a64c3 | |||
| a6ad7c7720 | |||
| ff1e9dcf8e | |||
| c26301d611 | |||
| faaecbb271 | |||
| d60bef5de3 | |||
| b8ada446e1 | |||
| 47f1473167 | |||
| 72101c90d5 | |||
| 261dc38748 | |||
| e20cb3464f | |||
| d4ed578178 | |||
| 46017d027a | |||
| d4d38e26ce | |||
| a2c525ecd1 | |||
| f743c47d6b | |||
| 08ba3678f8 | |||
| 9cc837bdd8 | |||
| 9eb32586c7 | |||
| ff18a032f4 | |||
| debcffb9a2 | |||
| 9c15f23987 | |||
| 5f89f0ce31 | |||
| 6ec850c77c | |||
| 7def13e265 | |||
| cf41075f42 | |||
| 4f0e746128 | |||
| bc706ab410 | |||
| 83d70ebd3f | |||
| f9dbdf893d | |||
| f1fcd09f89 | |||
| cdb47df781 | |||
| d7e681c607 | |||
| 978482c2ae | |||
| 8435bf0254 | |||
| 604175491a | |||
| 9ff7fa815f | |||
| 1a490afe44 | |||
| 78107b529f | |||
| 781352b249 | |||
| 478a583c3a | |||
| 4f01a1fbd7 | |||
| 96dd7a1b4b | |||
|
|
4b2adb3299 | ||
|
|
0c4928c224 | ||
|
|
eb6b2c6f53 | ||
|
|
aa9bb03cc2 | ||
|
|
bcc3460e06 | ||
|
|
1385c91255 | ||
|
|
ead8267d61 | ||
|
|
e534b27407 | ||
|
|
45cbd7845b | ||
|
|
b830838f8e | ||
|
|
ef87b88156 | ||
| 264368c61f | |||
| c38dffeeb9 | |||
| df1d9aa36d | |||
| cff798a9f1 | |||
| 64287f1a01 | |||
| 5e1c057bc5 | |||
| ab740f0be8 | |||
| 4c6713b2d3 | |||
| dc5fd60c0d | |||
| c3848566df | |||
| 961d597032 | |||
| 5d70d508cd | |||
| 8619e3e1f4 | |||
| 8834c0954e | |||
| 4e67dbfccf | |||
| e5b0468a44 | |||
| a9ac54ce54 | |||
| 297d0f7420 |
@@ -1,17 +1,272 @@
|
|||||||
name: Gitea Actions Demo
|
name: Build and Release
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
on:
|
||||||
on: [push]
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- main
|
||||||
|
workflow_dispatch: # Ручной запуск
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
build:
|
||||||
runs-on: tcl-tk-builder
|
runs-on: tcl-tk-builder
|
||||||
steps:
|
steps:
|
||||||
- name: Build the packages
|
- name: Клонирование
|
||||||
run: |
|
run: |
|
||||||
git clone ${{ vars.main_url }}${{ gitea.repository }}
|
git clone "${{ vars.main_url }}${{ gitea.repository }}.git" .
|
||||||
pwd
|
|
||||||
cd projman/debian
|
- name: Получение версии
|
||||||
./build-deb-projman.sh
|
id: get_version
|
||||||
cd ../../
|
run: |
|
||||||
curl --user ${{ vars.user}}:${{vars.api_token}} --upload-file "$(ls -1| grep projman | grep -E 'deb$')" ${{vars.main_url}}api/packages/${{vars.user}}/debian/pool/bookworm/main/upload
|
VERSION=$(grep "Version" projman.tcl | head -1 | grep -o '[0-9.]\+[a-zA-Z0-9]*' || echo "1.0.0")
|
||||||
- run: echo "This job's status is ${{ job.status }}."
|
RELEASE=$(grep "# Release" projman.tcl | tail -1 | awk '{print $NF}' || echo "$(date +%Y%m%d)")
|
||||||
|
|
||||||
|
# Создаем имя тега
|
||||||
|
TAG="v${VERSION}"
|
||||||
|
echo "TAG=$TAG" >> $GITEA_ENV
|
||||||
|
echo "VERSION=$VERSION" >> $GITEA_ENV
|
||||||
|
echo "RELEASE=$RELEASE" >> $GITEA_ENV
|
||||||
|
|
||||||
|
echo "Тег: $TAG"
|
||||||
|
echo "Версия: $VERSION"
|
||||||
|
echo "Ревизия: $RELEASE"
|
||||||
|
|
||||||
|
- name: Проверка существования тега
|
||||||
|
id: check_tag
|
||||||
|
run: |
|
||||||
|
echo "Проверяем тег: $TAG"
|
||||||
|
|
||||||
|
# Проверяем на удаленном сервере
|
||||||
|
if git ls-remote --tags origin "$TAG" 2>/dev/null | grep -q "$TAG"; then
|
||||||
|
echo "Тег $TAG уже существует на удаленном сервере"
|
||||||
|
echo "TAG_EXISTS_REMOTE=true" >> $GITEA_ENV
|
||||||
|
else
|
||||||
|
echo "Тег $TAG не существует на удаленном сервере"
|
||||||
|
echo "TAG_EXISTS_REMOTE=false" >> $GITEA_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Создание тега (только если не существует)
|
||||||
|
if: env.TAG_EXISTS_REMOTE == 'false'
|
||||||
|
run: |
|
||||||
|
echo "Создаем новый тег: $TAG"
|
||||||
|
git config user.email "svk@nuk-svk.ru"
|
||||||
|
git config user.name "svk"
|
||||||
|
|
||||||
|
# Создаем тег локально
|
||||||
|
git tag -a "$TAG" -m "Release $TAG - $RELEASE"
|
||||||
|
|
||||||
|
# Настраиваем URL для push
|
||||||
|
git remote set-url origin "https://${{ secrets.USER }}:${{ secrets.API_TOKEN }}@git.nuk-svk.ru/${{ gitea.repository }}.git"
|
||||||
|
|
||||||
|
# Пушим тег на сервер
|
||||||
|
git push origin "$TAG"
|
||||||
|
|
||||||
|
- name: Сборка пакетов
|
||||||
|
run: |
|
||||||
|
echo "=== Сборка DEB пакета ==="
|
||||||
|
cd debian && ./build-deb-projman.sh
|
||||||
|
|
||||||
|
echo "=== Сборка OpenBSD пакета ==="
|
||||||
|
cd ../openbsd && ./build-package-bsd.sh
|
||||||
|
|
||||||
|
echo "=== Сборка RPM пакета ==="
|
||||||
|
cd ../redhat && ./build-rpm.sh
|
||||||
|
|
||||||
|
echo "=== Собранные файлы ==="
|
||||||
|
find . -maxdepth 1 -name "projman*" -type f | xargs ls -la 2>/dev/null || echo "Файлы не найдены"
|
||||||
|
|
||||||
|
- name: Проверка существования релиза
|
||||||
|
id: check_release
|
||||||
|
run: |
|
||||||
|
# Проверяем, существует ли уже релиз для этого тега
|
||||||
|
RESPONSE=$(curl -s -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/tags/$TAG" || echo "{}")
|
||||||
|
|
||||||
|
echo "Ответ API проверки релиза: $RESPONSE"
|
||||||
|
|
||||||
|
# Извлекаем id релиза - первый id в JSON
|
||||||
|
if echo "$RESPONSE" | grep -q '"id"'; then
|
||||||
|
# Извлекаем только первый id (id релиза), игнорируем id автора
|
||||||
|
# Используем awk для точного извлечения
|
||||||
|
REL_ID=$(echo "$RESPONSE" | awk -F'"id":' '{print $2}' | awk -F',' '{print $1}' | head -1 | tr -d ' ')
|
||||||
|
echo "Релиз уже существует. ID: $REL_ID"
|
||||||
|
echo "RELEASE_EXISTS=true" >> $GITEA_ENV
|
||||||
|
|
||||||
|
# Очищаем и сохраняем REL_ID в файл
|
||||||
|
echo -n "$REL_ID" | tr -d '\n' > /tmp/rel_id.txt
|
||||||
|
else
|
||||||
|
echo "Релиз не существует"
|
||||||
|
echo "RELEASE_EXISTS=false" >> $GITEA_ENV
|
||||||
|
echo -n "" > /tmp/rel_id.txt
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Создание или обновление релиза
|
||||||
|
id: create_release
|
||||||
|
run: |
|
||||||
|
# Читаем REL_ID из файла и очищаем от лишних символов
|
||||||
|
REL_ID=$(cat /tmp/rel_id.txt 2>/dev/null | tr -d '\n\r ' || echo "")
|
||||||
|
|
||||||
|
echo "=== Работа с релизом для тега $TAG ==="
|
||||||
|
echo "RELEASE_EXISTS: $RELEASE_EXISTS"
|
||||||
|
echo "REL_ID: '$REL_ID'"
|
||||||
|
|
||||||
|
RELEASE_BODY="## Projman $VERSION
|
||||||
|
|
||||||
|
**Ревизия:** $RELEASE
|
||||||
|
**Дата сборки:** $(date)
|
||||||
|
**Коммит:** $(git rev-parse --short HEAD)"
|
||||||
|
|
||||||
|
|
||||||
|
# Экранируем переносы строк для JSON
|
||||||
|
ESCAPED_BODY=$(echo "$RELEASE_BODY" | sed ':a;N;$!ba;s/\n/\\n/g')
|
||||||
|
|
||||||
|
if [ "$RELEASE_EXISTS" = "true" ] && [ -n "$REL_ID" ]; then
|
||||||
|
echo "Обновляем существующий релиз ID: $REL_ID"
|
||||||
|
|
||||||
|
# Обновляем существующий релиз
|
||||||
|
RESPONSE=$(curl -s -X PATCH \
|
||||||
|
-u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"name": "Projman '"$VERSION"'",
|
||||||
|
"body": "'"$ESCAPED_BODY"'",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}' \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID")
|
||||||
|
|
||||||
|
echo "Ответ обновления релиза: $RESPONSE"
|
||||||
|
|
||||||
|
# Проверяем ответ
|
||||||
|
if echo "$RESPONSE" | grep -q '"id"'; then
|
||||||
|
echo "Релиз успешно обновлен"
|
||||||
|
else
|
||||||
|
echo "ОШИБКА: Не удалось обновить релиз"
|
||||||
|
echo "Ответ: $RESPONSE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "Создаем новый релиз"
|
||||||
|
|
||||||
|
# Создаем новый релиз
|
||||||
|
RESPONSE=$(curl -s -X POST \
|
||||||
|
-u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"tag_name": "'"$TAG"'",
|
||||||
|
"name": "Projman '"$VERSION"'",
|
||||||
|
"body": "'"$ESCAPED_BODY"'",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}' \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases")
|
||||||
|
|
||||||
|
echo "Ответ создания релиза: $RESPONSE"
|
||||||
|
|
||||||
|
# Получаем ID нового релиза
|
||||||
|
NEW_REL_ID=$(echo "$RESPONSE" | awk -F'"id":' '{print $2}' | awk -F',' '{print $1}' | head -1 | tr -d ' ')
|
||||||
|
if [ -n "$NEW_REL_ID" ]; then
|
||||||
|
echo "Новый ID релиза: $NEW_REL_ID"
|
||||||
|
echo -n "$NEW_REL_ID" > /tmp/rel_id.txt
|
||||||
|
else
|
||||||
|
echo "ОШИБКА: Не удалось получить ID релиза из ответа"
|
||||||
|
echo "Ответ: $RESPONSE"
|
||||||
|
echo -n "" > /tmp/rel_id.txt
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Загрузка файлов в релиз
|
||||||
|
run: |
|
||||||
|
# Читаем REL_ID из файла и очищаем
|
||||||
|
REL_ID=$(cat /tmp/rel_id.txt 2>/dev/null | tr -d '\n\r ' || echo "")
|
||||||
|
|
||||||
|
if [ -z "$REL_ID" ]; then
|
||||||
|
echo "Нет ID релиза, пропускаем загрузку файлов"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "=== Загрузка файлов в релиз ==="
|
||||||
|
echo "ID релиза для загрузки: $REL_ID"
|
||||||
|
|
||||||
|
# Находим все файлы projman
|
||||||
|
FILES=$(find ../ -maxdepth 1 \( -name "*projman*deb" -o -name "*projman*tgz" -o -name "*projman*rpm" \) -type f)
|
||||||
|
if [ -z "$FILES" ]; then
|
||||||
|
echo "Нет файлов projman для загрузки"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Найдены файлы:"
|
||||||
|
echo "$FILES"
|
||||||
|
|
||||||
|
# Сначала проверим существующие ассеты
|
||||||
|
echo "=== Проверяем существующие ассеты ==="
|
||||||
|
curl -s -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID/assets" | \
|
||||||
|
jq -r '.[].name' 2>/dev/null || echo "Не удалось получить список ассетов"
|
||||||
|
|
||||||
|
# Загружаем каждый файл
|
||||||
|
for FILE in $FILES; do
|
||||||
|
FILENAME=$(basename "$FILE")
|
||||||
|
echo "Загружаем: $FILENAME"
|
||||||
|
|
||||||
|
# Используем правильный endpoint для загрузки ассетов
|
||||||
|
UPLOAD_URL="${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID/assets"
|
||||||
|
|
||||||
|
echo "URL загрузки: $UPLOAD_URL?name=$FILENAME"
|
||||||
|
|
||||||
|
# Загружаем файл
|
||||||
|
RESPONSE=$(curl -s -w "\nHTTP_STATUS:%{http_code}" \
|
||||||
|
--user "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
-X POST \
|
||||||
|
--data-binary @"$FILE" \
|
||||||
|
"$UPLOAD_URL?name=$FILENAME")
|
||||||
|
|
||||||
|
HTTP_STATUS=$(echo "$RESPONSE" | grep "HTTP_STATUS:" | cut -d':' -f2)
|
||||||
|
API_RESPONSE=$(echo "$RESPONSE" | grep -v "HTTP_STATUS:")
|
||||||
|
|
||||||
|
echo "Статус: $HTTP_STATUS"
|
||||||
|
echo "Ответ API: $API_RESPONSE"
|
||||||
|
|
||||||
|
if [ "$HTTP_STATUS" = "201" ] || [ "$HTTP_STATUS" = "200" ]; then
|
||||||
|
echo "Файл загружен: $FILENAME"
|
||||||
|
else
|
||||||
|
echo "ОШИБКА загрузки: $FILENAME"
|
||||||
|
echo "Детали: $API_RESPONSE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "---"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Проверяем итоговый список ассетов
|
||||||
|
echo "=== Итоговый список ассетов ==="
|
||||||
|
curl -s -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID/assets" | \
|
||||||
|
jq -r '.[] | "\(.name) - \(.browser_download_url)"' 2>/dev/null || \
|
||||||
|
curl -s -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID/assets" | \
|
||||||
|
grep -o '"name":"[^"]*"' | cut -d'"' -f4
|
||||||
|
|
||||||
|
- name: Финализация
|
||||||
|
run: |
|
||||||
|
# Читаем REL_ID из файла
|
||||||
|
REL_ID=$(cat /tmp/rel_id.txt 2>/dev/null | tr -d '\n\r ' || echo "")
|
||||||
|
|
||||||
|
echo "=== Сборка завершена ==="
|
||||||
|
echo "Тег: $TAG"
|
||||||
|
echo "Версия: $VERSION"
|
||||||
|
echo "Ревизия: $RELEASE"
|
||||||
|
echo "ID релиза: $REL_ID"
|
||||||
|
|
||||||
|
if [ -n "$REL_ID" ]; then
|
||||||
|
echo "Проверяем файлы в релизе..."
|
||||||
|
curl -s -u "${{ secrets.USER }}:${{ secrets.API_TOKEN }}" \
|
||||||
|
"${{ vars.main_url }}api/v1/repos/${{ gitea.repository }}/releases/$REL_ID/assets" | \
|
||||||
|
grep -o '"name":"[^"]*"' | cut -d'"' -f4 || echo "Не удалось получить список файлов"
|
||||||
|
else
|
||||||
|
echo "Релиз не был создан или ID не получен"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Собранные файлы:"
|
||||||
|
find ../ -maxdepth 1 \( -name "*projman*deb" -o -name "*projman*tgz" -o -name "*projman*rpm"\) -type f | xargs ls -la 2>/dev/null || echo "Файлы не найдены"
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -5,4 +5,6 @@ debian/projman.substvars
|
|||||||
debian/files
|
debian/files
|
||||||
debian/projman.debhelper.log
|
debian/projman.debhelper.log
|
||||||
debian/*.tmp
|
debian/*.tmp
|
||||||
*.tmp
|
debian/errors
|
||||||
|
*.tmp
|
||||||
|
errors
|
||||||
121
CHANGELOG
121
CHANGELOG
@@ -1,4 +1,123 @@
|
|||||||
projman (2.0.0-alfa16)
|
|
||||||
|
projman (2.0.0-beta1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Сделан вывод отладочной информации по запросу.
|
||||||
|
* Добавлены параметры в файл конфигурации "debug" - включение или отключение отладки и "debugOut" - куда выводить информацию.
|
||||||
|
* Переделка кода.
|
||||||
|
* Добавлены процедуры проверки наличия параметров конфигурации в файле и устанвоки переменных по умолчанию.
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:44:07 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha24) stable; urgency=medium
|
||||||
|
|
||||||
|
* Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
|
||||||
|
* Исправил вставку кавычек при выделении текста
|
||||||
|
* Исправил ошибку при отправке сигналов несуществующему процессу.
|
||||||
|
* Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
|
||||||
|
* Изменил команду загрузки пакета в репу
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:35:06 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha23) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправлен флаг модификации при открытии файла
|
||||||
|
* Исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
|
||||||
|
* Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Mon, 19 Jan 2026 14:49:29 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha22) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
|
||||||
|
* Новая сборка
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 18:06:32 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha21) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил ошибку
|
||||||
|
* Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 17:59:31 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha20) stable; urgency=medium
|
||||||
|
|
||||||
|
* Добавление вывод номера версии tcl/tl в О Программе
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 03 Dec 2025 17:22:44 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha19) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
|
||||||
|
* Добавил проверку пакета Img. И поправил проверку типов изображений
|
||||||
|
* Переделал сигналы и сочетания
|
||||||
|
* Небольшие исправления
|
||||||
|
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
|
* Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
|
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
||||||
|
* Добавлен диалог настроек
|
||||||
|
* Добавил псевдо-терминал
|
||||||
|
* Добавлен диалог при открытии файлов отличных от текстовых
|
||||||
|
* Поправил тему оформления
|
||||||
|
* Исправлена работа в windows
|
||||||
|
* Уменьшил колдичество выводимой отладочной информации
|
||||||
|
* Добавлено определение пути до git в зависимости от платформы.
|
||||||
|
* Исправлено создание файла конфигурации
|
||||||
|
* Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимость на Threads.
|
||||||
|
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
|
||||||
|
* Bugfix release
|
||||||
|
* Bug fix with varhelper
|
||||||
|
* Added the "Open Recent" menu. The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories. The procedures for working with this list have also been added.
|
||||||
|
* Косметические изменения.
|
||||||
|
* Исправлены ошибки при вставке кавычек
|
||||||
|
|
||||||
|
-- Калинин Сергей Валерьевич <svk@nuk-svk.ru> Thu, 30 Jan 2025 12:19:56 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha19) stable; urgency=medium
|
||||||
|
|
||||||
|
* Переделал сигналы и сочетния
|
||||||
|
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
|
* Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
|
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
||||||
|
* Добавлен диалог настроек
|
||||||
|
* Добавил псевдо-терминал
|
||||||
|
* Добавлен диалог при открытии файлов отличных от текстовых
|
||||||
|
* Добавлен просмотр файлов изображений (png, bmp, gif, ppm, pgm)
|
||||||
|
* Исправлена процедура опреления типа файла
|
||||||
|
* Добавлены диалоги для подтверждения открытия больших файлов, и двоичных файлов.
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 29 Oct 2025 13:10:31 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha18) stable; urgency=medium
|
||||||
|
|
||||||
|
* Поправил тему оформления
|
||||||
|
* Исправлена работа в windows
|
||||||
|
* Уменьшил количество выводимой отладочной информации
|
||||||
|
* Добавлено определение пути до git в зависимости от платформы.
|
||||||
|
* Исправлено создание файла конфигурации
|
||||||
|
* Добавлены номера версий в вызов tclsh8.6 и wish8.6.
|
||||||
|
* Убрана зависимость на Threads.
|
||||||
|
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
|
||||||
|
* Исправление работы процедуры varhelper
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 27 Oct 2025 14:05:40 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha17) stable; urgency=medium
|
||||||
|
|
||||||
|
* Added the "Open Recent" menu.
|
||||||
|
* The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories.
|
||||||
|
* The procedures for working with this list have also been added.
|
||||||
|
* Новая сборка
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Sat, 18 Oct 2025 16:29:50 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha17) stable; urgency=medium
|
||||||
|
|
||||||
|
* Косметические изменения.
|
||||||
|
* Исправлены ошибки при вставке кавычек
|
||||||
|
* Обновить README.md
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Thu, 31 Oct 2024 19:48:30 +0300
|
||||||
|
|
||||||
Sergey Kalinin <svk@nuk-svk.ru> Thu, 22 Aug 2024 15:09:19 +0300
|
Sergey Kalinin <svk@nuk-svk.ru> Thu, 22 Aug 2024 15:09:19 +0300
|
||||||
- changelog-gen.tcl: Добавлена генерация текстового журнала изменений
|
- changelog-gen.tcl: Добавлена генерация текстового журнала изменений
|
||||||
|
|||||||
41
README.md
41
README.md
@@ -17,6 +17,7 @@ Highlightning and source code navigation:
|
|||||||
* Markdown
|
* Markdown
|
||||||
* YAML (Ansible support)
|
* YAML (Ansible support)
|
||||||
* Lua
|
* Lua
|
||||||
|
* C
|
||||||
|
|
||||||
Highlightning:
|
Highlightning:
|
||||||
|
|
||||||
@@ -69,6 +70,17 @@ tcllib, tklib
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
- A pseudo-terminal for launching the edited file and other command
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Image viewer
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Getting source code
|
## Getting source code
|
||||||
|
|
||||||
Download the source code https://git.nuk-svk.ru/svk/projman/
|
Download the source code https://git.nuk-svk.ru/svk/projman/
|
||||||
@@ -120,7 +132,6 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
|
|||||||
- Ctrl-N - Create new file
|
- Ctrl-N - Create new file
|
||||||
- Ctrl-O - Open file
|
- Ctrl-O - Open file
|
||||||
- Ctrl-W - Close editor (file)
|
- Ctrl-W - Close editor (file)
|
||||||
- Ctrl-K - Open folder
|
|
||||||
- Ctrl-Q - Quit from ProjMan
|
- Ctrl-Q - Quit from ProjMan
|
||||||
- Ctrl-J - Show procedures (functions) list for navigation in open editor
|
- Ctrl-J - Show procedures (functions) list for navigation in open editor
|
||||||
- Ctrl-L - Find and display files where the variable is defined, the name of which is located under the cursor in the editor
|
- Ctrl-L - Find and display files where the variable is defined, the name of which is located under the cursor in the editor
|
||||||
@@ -134,6 +145,10 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
|
|||||||
- Ctrl-G - Go to line dialog
|
- Ctrl-G - Go to line dialog
|
||||||
- Ctrl-C - Copy selected text into buffer
|
- Ctrl-C - Copy selected text into buffer
|
||||||
- Ctrl-V - Paste text from buffer
|
- Ctrl-V - Paste text from buffer
|
||||||
|
- Ctrl-R - Open terminal for edited file
|
||||||
|
- Ctrl-Z - Send SIGTSTP signal
|
||||||
|
- Ctrl-D - Send SIGINT signal
|
||||||
|
- Ctrl-C - Send SIGKILL signal
|
||||||
|
|
||||||
- Alt-P - Show/Hide the file tree panel
|
- Alt-P - Show/Hide the file tree panel
|
||||||
- Alt-W - Delete the current word
|
- Alt-W - Delete the current word
|
||||||
@@ -142,6 +157,30 @@ Or type "projman" into terminal, Or choose the name of the program "Projman" on
|
|||||||
- Alt-R - Delete current line
|
- Alt-R - Delete current line
|
||||||
- Alt-Y - Copy current line into buffer
|
- Alt-Y - Copy current line into buffer
|
||||||
- Alt-S - Split the edited window horizontally
|
- Alt-S - Split the edited window horizontally
|
||||||
|
- Alt-K - Open folder
|
||||||
|
|
||||||
|
### Work with external tools
|
||||||
|
ProjMan allows you to connect any external tools to the editor. To do this, you need to add an entry to the file ~/.config/projman/tools.ini.
|
||||||
|
|
||||||
|
Calling an external program is available through the main and pop-up menus. To transfer the parameters, write the appropriate template in the file.
|
||||||
|
- %s - template for substituting selected text in the editor
|
||||||
|
- %f - template for substituting selected file\(s\) in the file tree
|
||||||
|
|
||||||
|
When adding multiple %f templates, the corresponding number of files allocated in the tree will be substituted.
|
||||||
|
|
||||||
|
```
|
||||||
|
[TkDIFF]
|
||||||
|
commandString=tkdiff %f %f
|
||||||
|
description=TkDiff is a Tcl/Tk front-end to diff
|
||||||
|
icon=
|
||||||
|
shortCut=
|
||||||
|
|
||||||
|
[VisualRegexp]
|
||||||
|
commandString=tkregexp "%s"
|
||||||
|
description=A graphical front-end to write/debug regular expression
|
||||||
|
icon=
|
||||||
|
shortCut=
|
||||||
|
```
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
|
|||||||
5
TODO
5
TODO
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
--- Ansible ---
|
--- Ansible ---
|
||||||
1. Определение всех переменных в отдельный список
|
1. Определение всех переменных в отдельный список
|
||||||
- внутри файла, конструкции вида:
|
- внутри файла, конструкции вида:
|
||||||
set_fact:
|
set_fact:
|
||||||
varName: value
|
varName: value
|
||||||
set_fact varName value
|
set_fact varName value
|
||||||
@@ -18,5 +18,4 @@
|
|||||||
- var1.yml
|
- var1.yml
|
||||||
- var2.yml
|
- var2.yml
|
||||||
|
|
||||||
3. Если используется роль и переменная не найдена в плэйбуке то искать в роли (не факт что требуется)
|
3. Если используется роль и переменная не найдена в плэйбуке
|
||||||
|
|
||||||
|
|||||||
@@ -106,14 +106,14 @@ proc ReadGitLog {} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc StoreProjectInfo {timeStamp} {
|
proc StoreProjectInfo {timeStamp changelogFormat} {
|
||||||
global dir args
|
global dir args
|
||||||
set cfgFile [open [file join $dir(cfg) $args(--project-name).conf] "w+"]
|
set cfgFile [open [file join $dir(cfg) $args(--project-name).$changelogFormat.conf] "w+"]
|
||||||
puts $cfgFile "# set args(--project-version) \"$args(--project-version)\""
|
puts $cfgFile "# set args(--project-version) \"$args(--project-version)\""
|
||||||
puts $cfgFile "# set args(--project-release) \"$args(--project-release)\""
|
puts $cfgFile "# set args(--project-release) \"$args(--project-release)\""
|
||||||
puts $cfgFile "set lastCommitTimeStamp \"$timeStamp\""
|
puts $cfgFile "set lastCommitTimeStamp \"$timeStamp\""
|
||||||
puts $cfgFile "set lastCommitTimeStampSec [clock scan $timeStamp]"
|
puts $cfgFile "set lastCommitTimeStampSec [clock scan $timeStamp]"
|
||||||
close $cfgFile
|
close $cfgFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -141,37 +141,77 @@ proc GenerateChangelogDEB {} {
|
|||||||
set timeStamp [clock format [clock scan $timeStamp] -format {%a, %e %b %Y %H:%M:%S %z}]
|
set timeStamp [clock format [clock scan $timeStamp] -format {%a, %e %b %Y %H:%M:%S %z}]
|
||||||
# puts "> $commiter"
|
# puts "> $commiter"
|
||||||
if {$index == 0} {
|
if {$index == 0} {
|
||||||
puts "$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n"
|
# puts "$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n"
|
||||||
append outText "$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n\n"
|
append outText "$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n\n"
|
||||||
set commiter [lindex $record 2]
|
set commiter [lindex $record 2]
|
||||||
StoreProjectInfo $timeStamp
|
StoreProjectInfo $timeStamp "deb"
|
||||||
# puts "\n \[ [string trim $commiter] \]"
|
# puts "\n \[ [string trim $commiter] \]"
|
||||||
}
|
}
|
||||||
# puts ">> $commiter"
|
# puts ">> $commiter"
|
||||||
if {$commiter ne [lindex $record 2]} {
|
if {$commiter ne [lindex $record 2]} {
|
||||||
puts "\n -- [string trim $commiter] <$email> $timeStamp"
|
# puts "\n -- [string trim $commiter] <$email> $timeStamp"
|
||||||
append outText "\n -- [string trim $commiter] <$email> $timeStamp\n"
|
append outText "\n -- [string trim $commiter] <$email> $timeStamp\n"
|
||||||
puts "\n$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n"
|
# puts "\n$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n"
|
||||||
append outText "\n$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n\n"
|
append outText "\n$args(--project-name) ($args(--project-version)-$args(--project-release)) stable; urgency=medium\n\n"
|
||||||
set commiter [lindex $record 2]
|
set commiter [lindex $record 2]
|
||||||
# puts "\n \[ [string trim $commiter] \]"
|
# puts "\n \[ [string trim $commiter] \]"
|
||||||
}
|
}
|
||||||
|
|
||||||
set commitTex [lindex $record 4]
|
set commitTex [lindex $record 4]
|
||||||
puts " * $commitTex"
|
# puts " * $commitTex"
|
||||||
append outText " * $commitTex\n"
|
append outText " * $commitTex\n"
|
||||||
|
|
||||||
}
|
}
|
||||||
puts "\n -- [string trim $commiter] <$email> $timeStamp"
|
# puts "\n -- [string trim $commiter] <$email> $timeStamp"
|
||||||
append outText "\n -- [string trim $commiter] <$email> $timeStamp\n"
|
append outText "\n -- [string trim $commiter] <$email> $timeStamp\n"
|
||||||
return $outText
|
return $outText
|
||||||
}
|
}
|
||||||
|
|
||||||
proc GenerateChangelogRPM {} {
|
proc GenerateChangelogRPM {} {
|
||||||
puts "GenerateChangelogRPM"
|
global args
|
||||||
|
# puts "GenerateChangelogRPM"
|
||||||
|
set lastCommitTimeStamp ""
|
||||||
|
set commiter ""
|
||||||
|
set commitText ""
|
||||||
|
# ReadGitLog
|
||||||
|
set lst [lsort -integer -index 0 [ReadGitLog]]
|
||||||
|
# puts $lst
|
||||||
|
# exit
|
||||||
|
set outText ""
|
||||||
|
foreach l $lst {
|
||||||
|
set index [lindex $l 0]
|
||||||
|
set line [lindex $l 1]
|
||||||
|
# puts "$index - $line"
|
||||||
|
set record [split $line ","]
|
||||||
|
set timeStamp [string trim [lindex $record 1]]
|
||||||
|
set email [string trim [lindex $record 3]]
|
||||||
|
if {$lastCommitTimeStamp eq ""} {
|
||||||
|
set lastCommitTimeStamp [string trim [lindex $record 1]]
|
||||||
|
}
|
||||||
|
set timeStampForStore [clock format [clock scan $timeStamp] -format {%a, %e %b %Y %H:%M:%S %z}]
|
||||||
|
set timeStamp [clock format [clock scan $timeStamp] -format {%a %b %e %Y}]
|
||||||
|
if {$index == 0} {
|
||||||
|
set commiter [lindex $record 2]
|
||||||
|
append outText "* $timeStamp [string trim $commiter] <$email> $args(--project-version)-$args(--project-release)\n"
|
||||||
|
StoreProjectInfo $timeStampForStore "rpm"
|
||||||
|
}
|
||||||
|
if {$commiter ne [lindex $record 2]} {
|
||||||
|
append outText "\n"
|
||||||
|
append outText "* $timeStamp [string trim $commiter] <$email> $args(--project-version)-$args(--project-release)\n"
|
||||||
|
set commiter [lindex $record 2]
|
||||||
|
}
|
||||||
|
|
||||||
|
set commitTex [lindex $record 4]
|
||||||
|
# puts " * $commitTex"
|
||||||
|
append outText " - $commitTex\n"
|
||||||
|
|
||||||
|
}
|
||||||
|
# puts "\n -- [string trim $commiter] <$email> $timeStamp"
|
||||||
|
# append outText "\n -- [string trim $commiter] <$email> $timeStamp\n"
|
||||||
|
return $outText
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
proc GenerateChangelogTXT {} {
|
proc GenerateChangelogTXT {} {
|
||||||
global args
|
global args
|
||||||
set lastCommitTimeStamp ""
|
set lastCommitTimeStamp ""
|
||||||
@@ -189,14 +229,15 @@ proc GenerateChangelogTXT {} {
|
|||||||
if {$lastCommitTimeStamp eq ""} {
|
if {$lastCommitTimeStamp eq ""} {
|
||||||
set lastCommitTimeStamp [string trim [lindex $record 1]]
|
set lastCommitTimeStamp [string trim [lindex $record 1]]
|
||||||
}
|
}
|
||||||
set timeStamp [clock format [clock scan $timeStamp] -format {%a, %e %b %Y %H:%M:%S %z}]
|
# * Mon Nov 28 2022 Sergey Kalinin <svk@nuk-svk.ru> 2.0.0
|
||||||
|
set timeStamp [clock format [clock scan $timeStamp] -format {%a %b %e %Y %H:%M:%S %z}]
|
||||||
# puts "> $commiter"
|
# puts "> $commiter"
|
||||||
if {$index == 0} {
|
if {$index == 0} {
|
||||||
append outText "$args(--project-name) ($args(--project-version)-$args(--project-release))\n"
|
append outText "$args(--project-name) ($args(--project-version)-$args(--project-release))\n"
|
||||||
set commiter [lindex $record 2]
|
set commiter [lindex $record 2]
|
||||||
puts "\n[string trim $commiter] <$email> $timeStamp"
|
puts "\n[string trim $commiter] <$email> $timeStamp"
|
||||||
append outText "\n[string trim $commiter] <$email> $timeStamp\n"
|
append outText "\n[string trim $commiter] <$email> $timeStamp\n"
|
||||||
StoreProjectInfo $timeStamp
|
StoreProjectInfo $timeStamp "txt"
|
||||||
}
|
}
|
||||||
if {$commiter ne [lindex $record 2]} {
|
if {$commiter ne [lindex $record 2]} {
|
||||||
puts "\n[string trim $commiter] <$email> $timeStamp"
|
puts "\n[string trim $commiter] <$email> $timeStamp"
|
||||||
@@ -254,6 +295,68 @@ proc StoreChangeLog {outText} {
|
|||||||
} else {
|
} else {
|
||||||
set outFile [open $args(--out-file) "w+"]
|
set outFile [open $args(--out-file) "w+"]
|
||||||
puts $outFile $outText
|
puts $outFile $outText
|
||||||
|
puts $outText
|
||||||
|
close $outFile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc StoreChangeLogRPM {outText} {
|
||||||
|
global args
|
||||||
|
if [file exists $args(--out-file)] {
|
||||||
|
file copy -force $args(--out-file) "$args(--out-file).tmp"
|
||||||
|
|
||||||
|
set fh [open $args(--out-file) r]
|
||||||
|
set lines [split [read $fh] "\n"]
|
||||||
|
close $fh
|
||||||
|
|
||||||
|
set result [list]
|
||||||
|
set inserted false
|
||||||
|
|
||||||
|
foreach line $lines {
|
||||||
|
lappend result $line
|
||||||
|
|
||||||
|
if {!$inserted && $line eq "%changelog"} {
|
||||||
|
lappend result $outText
|
||||||
|
set inserted true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set fh [open $args(--out-file) w]
|
||||||
|
puts $fh [join $result "\n"]
|
||||||
|
close $fh
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc StoreChangeLogRPM_ {outText} {
|
||||||
|
global args
|
||||||
|
|
||||||
|
puts "Changelog generator write a file $args(--out-file)"
|
||||||
|
|
||||||
|
if [file exists $args(--out-file)] {
|
||||||
|
file copy -force $args(--out-file) "$args(--out-file).tmp"
|
||||||
|
|
||||||
|
set origOutFile [open "$args(--out-file).tmp" "r"]
|
||||||
|
set origText [read $origOutFile]
|
||||||
|
close $origOutFile
|
||||||
|
|
||||||
|
set outFile [open $args(--out-file) "w"]
|
||||||
|
puts $outFile $outText
|
||||||
|
puts $outFile $origText
|
||||||
|
close $outFile
|
||||||
|
|
||||||
|
if [info exists args(--last)] {
|
||||||
|
set outFile [open $args(--out-file) "r+"]
|
||||||
|
puts $outFile $outText
|
||||||
|
close $outFile
|
||||||
|
} else {
|
||||||
|
set outFile [open $args(--out-file) "w+"]
|
||||||
|
puts $outFile $outText
|
||||||
|
close $outFile
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set outFile [open $args(--out-file) "w+"]
|
||||||
|
puts $outFile $outText
|
||||||
|
puts $outText
|
||||||
close $outFile
|
close $outFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,26 +414,43 @@ if ![info exists args(--project-release)] {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
if [file exists [file join $dir(cfg) $args(--project-name).conf]] {
|
puts "Running chngelog generator with folowing options:\n"
|
||||||
source [file join $dir(cfg) $args(--project-name).conf]
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach arg [array names args] {
|
foreach arg [array names args] {
|
||||||
puts "$arg $args($arg)"
|
puts "\t$arg $args($arg)"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [info exists args(--deb)] {
|
if [info exists args(--deb)] {
|
||||||
|
if [file exists [file join $dir(cfg) $args(--project-name).deb.conf]] {
|
||||||
|
source [file join $dir(cfg) $args(--project-name).deb.conf]
|
||||||
|
}
|
||||||
set outText [GenerateChangelogDEB]
|
set outText [GenerateChangelogDEB]
|
||||||
if [info exists args(--out-file)] {
|
if [info exists args(--out-file)] {
|
||||||
StoreChangeLog $outText
|
StoreChangeLog $outText
|
||||||
|
} else {
|
||||||
|
puts $outText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if [info exists args(--rpm)] {
|
if [info exists args(--rpm)] {
|
||||||
GenerateChangelogRPM
|
if [file exists [file join $dir(cfg) $args(--project-name).rpm.conf]] {
|
||||||
|
source [file join $dir(cfg) $args(--project-name).rpm.conf]
|
||||||
|
}
|
||||||
|
set outText [GenerateChangelogRPM]
|
||||||
|
# puts $outText
|
||||||
|
if [info exists args(--out-file)] {
|
||||||
|
StoreChangeLogRPM $outText
|
||||||
|
} else {
|
||||||
|
puts $outText
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if [info exists args(--txt)] {
|
if [info exists args(--txt)] {
|
||||||
|
if [file exists [file join $dir(cfg) $args(--project-name).txt.conf]] {
|
||||||
|
source [file join $dir(cfg) $args(--project-name).txt.conf]
|
||||||
|
}
|
||||||
set outText [GenerateChangelogTXT]
|
set outText [GenerateChangelogTXT]
|
||||||
if [info exists args(--out-file)] {
|
if [info exists args(--out-file)] {
|
||||||
StoreChangeLog $outText
|
StoreChangeLog $outText
|
||||||
|
} else {
|
||||||
|
puts $outText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
debian/build-deb-projman.sh
vendored
5
debian/build-deb-projman.sh
vendored
@@ -3,7 +3,7 @@
|
|||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
VERSION=$(grep Version projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
|
VERSION=$(grep Version projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
|
||||||
RELEASE=$(grep Release projman.tcl | grep -oE '[0-9A-Za-z]+$')
|
RELEASE=$(grep "# Release" projman.tcl | grep -oE '[0-9A-Za-z]+$')
|
||||||
BUILD_DATE=$(date +%d%m%Y%H%M%S)
|
BUILD_DATE=$(date +%d%m%Y%H%M%S)
|
||||||
TXT="# Build: ${BUILD_DATE}"
|
TXT="# Build: ${BUILD_DATE}"
|
||||||
echo "$VERSION, $RELEASE, $BUILD_DATE"
|
echo "$VERSION, $RELEASE, $BUILD_DATE"
|
||||||
@@ -11,6 +11,7 @@ sed -i "/# Build:.*/c$TXT" projman.tcl
|
|||||||
|
|
||||||
cp projman.tcl projman
|
cp projman.tcl projman
|
||||||
cp changelog-gen.tcl changelog-gen
|
cp changelog-gen.tcl changelog-gen
|
||||||
|
cp tkregexp.tcl tkregexp
|
||||||
|
|
||||||
./changelog-gen.tcl --project-name projman --project-version ${VERSION} --project-release ${RELEASE} --out-file debian/changelog --deb --last
|
./changelog-gen.tcl --project-name projman --project-version ${VERSION} --project-release ${RELEASE} --out-file debian/changelog --deb --last
|
||||||
|
|
||||||
@@ -25,5 +26,5 @@ dpkg-buildpackage -d
|
|||||||
|
|
||||||
#cp ../projman_${VERSION}-${RELEASE}_amd64.deb /files/
|
#cp ../projman_${VERSION}-${RELEASE}_amd64.deb /files/
|
||||||
|
|
||||||
rm -v projman changelog-gen
|
rm -v projman changelog-gen tkregexp
|
||||||
rm -r -v debian/{projman,.debhelper}
|
rm -r -v debian/{projman,.debhelper}
|
||||||
|
|||||||
141
debian/changelog
vendored
141
debian/changelog
vendored
@@ -1,11 +1,138 @@
|
|||||||
projman (2.0.0-alpha18) stable; urgency=medium
|
projman (2.0.0-beta4) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправлено регулярное выражение для поиска переменных в коде на С.
|
||||||
|
* Добавил экранирование '*' в имени функции для поиска.
|
||||||
|
* Подкрректировал регулярки для работы с С.
|
||||||
|
* Исиправил закрытие вкладки при отпускании кнопки мыши при нажатии на крестик.
|
||||||
|
* Добавил иконки для 'c' и 'h'. Добавил сочитание Alt-R в русской раскладке
|
||||||
|
* Добавил поддержку С подсветка
|
||||||
|
* Добавил копирование готовых пакетов
|
||||||
|
* Откорректировал сборку рпм
|
||||||
|
* Добавил сборку rpm. Исправил changelog-и
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Fri, 6 Feb 2026 14:07:53 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-beta3) stable; urgency=medium
|
||||||
|
|
||||||
|
* changelog-gen: сделал вывод изменения в формате rpm.spec
|
||||||
|
* Исправил смену регистра в заголовках вкладок
|
||||||
|
* Добавил диалог вменю "Сохранить как"
|
||||||
|
* Добавил проверки в диалог FileOper::SaveFile
|
||||||
|
* Вынес код связанный с обработкой подсказок при вводе переменных и процедур в отдельный модуль.
|
||||||
|
* Исправил работу со списком переменных из всплывающего окна. Теперь там можно выбрать из списка стрелками и вставить по Enter. Исправил обработку клавиш Вверх Вниз Ввод Отмена в окне со списком вариантов.
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Thu, 29 Jan 2026 14:22:55 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-beta2) stable; urgency=medium
|
||||||
|
|
||||||
|
* Добавлено подключение (bind) сочетания клавиш указанных в настройках инструментов.
|
||||||
|
* Добавлена динамическая генерация меню 'Инструменты'. Теперь новые внешние инструменты доступны сразу после сохранения файла настроек tools.ini в редакторе.
|
||||||
|
* Исправлена ошибка с некорректным определением виджета в процедуре получения выделенного текста.
|
||||||
|
* Добавлено редактирование настроек внешних инструментов. И пункт в меню 'Инструменты'->'Настройки'
|
||||||
|
* Исправление ошибки с запуском внешних программ.
|
||||||
|
* Добавлено определение путей до внешних программ при подключении к редактору.
|
||||||
|
* Сделана обработка шаблонов командной строки и запуск внешних инструментов.
|
||||||
|
* Добавлен tkregexp для установки в /usr/bin
|
||||||
|
* Начало работы с внешними инструментами: - Добавлено создание и работа (проверка параметров
|
||||||
|
* Исправлен скрипт сборки бсд-пакета
|
||||||
|
* Добавлена сборка пакетов для openbsd
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Tue, 27 Jan 2026 16:44:48 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-beta1) stable; urgency=medium
|
||||||
|
|
||||||
|
* Сделан вывод отладочной информации по запросу.
|
||||||
|
* Добавлены параметры в файл конфигурации "debug" - включение или отключение отладки и "debugOut" - куда выводить информацию.
|
||||||
|
* Переделка кода.
|
||||||
|
* Добавлены процедуры проверки наличия параметров конфигурации в файле и устанвоки переменных по умолчанию.
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:44:07 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha24) stable; urgency=medium
|
||||||
|
|
||||||
|
* Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
|
||||||
|
* Исправил вставку кавычек при выделении текста
|
||||||
|
* Исправил ошибку при отправке сигналов несуществующему процессу.
|
||||||
|
* Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
|
||||||
|
* Изменил команду загрузки пакета в репу
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Wed, 21 Jan 2026 16:35:06 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha23) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправлен флаг модификации при открытии файла
|
||||||
|
* Исправлена 'Отмена' до пустого файла. Внес исправления на основе изменений https://github.com/wandrien/projman
|
||||||
|
* Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
|
||||||
|
|
||||||
|
-- svk <svk@nuk-svk.ru> Mon, 19 Jan 2026 14:49:29 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha22) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
|
||||||
* Новая сборка
|
* Новая сборка
|
||||||
|
|
||||||
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 27 Oct 2025 14:48:18 +0300
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 18:06:32 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha21) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил ошибку
|
||||||
|
* Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 3 Dec 2025 17:59:31 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha20) stable; urgency=medium
|
||||||
|
|
||||||
|
* Добавление вывод номера версии tcl/tl в О Программе
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Mon, 03 Dec 2025 17:22:44 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha19) stable; urgency=medium
|
||||||
|
|
||||||
|
* Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
|
||||||
|
* Добавил проверку пакета Img. И поправил проверку типов изображений
|
||||||
|
* Переделал сигналы и сочетания
|
||||||
|
* Небольшие исправления
|
||||||
|
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
|
* Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
|
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
||||||
|
* Добавлен диалог настроек
|
||||||
|
* Добавил псевдо-терминал
|
||||||
|
* Добавлен диалог при открытии файлов отличных от текстовых
|
||||||
|
* Поправил тему оформления
|
||||||
|
* Исправлена работа в windows
|
||||||
|
* Уменьшил колдичество выводимой отладочной информации
|
||||||
|
* Добавлено определение пути до git в зависимости от платформы.
|
||||||
|
* Исправлено создание файла конфигурации
|
||||||
|
* Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимость на Threads.
|
||||||
|
* Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
|
||||||
|
* Bugfix release
|
||||||
|
* Bug fix with varhelper
|
||||||
|
* Added the "Open Recent" menu. The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories. The procedures for working with this list have also been added.
|
||||||
|
* Косметические изменения.
|
||||||
|
* Исправлены ошибки при вставке кавычек
|
||||||
|
|
||||||
|
-- Калинин Сергей Валерьевич <svk@nuk-svk.ru> Thu, 30 Jan 2025 12:19:56 +0300
|
||||||
|
|
||||||
|
projman (2.0.0-alpha19) stable; urgency=medium
|
||||||
|
|
||||||
|
* Переделал сигналы и сочетния
|
||||||
|
* Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
|
* Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
|
* Изменил виджет текста в окне псевдо-терминала. Добавил подстановку имени файла к командную строку по шаблону %f
|
||||||
|
* Добавлен диалог настроек
|
||||||
|
* Добавил псевдо-терминал
|
||||||
|
* Добавлен диалог при открытии файлов отличных от текстовых
|
||||||
|
* Добавлен просмотр файлов изображений (png, bmp, gif, ppm, pgm)
|
||||||
|
* Исправлена процедура опреления типа файла
|
||||||
|
* Добавлены диалоги для подтверждения открытия больших файлов, и двоичных файлов.
|
||||||
|
|
||||||
|
-- Sergey Kalinin <svk@nuk-svk.ru> Wed, 29 Oct 2025 13:10:31 +0300
|
||||||
|
|
||||||
projman (2.0.0-alpha18) stable; urgency=medium
|
projman (2.0.0-alpha18) stable; urgency=medium
|
||||||
|
|
||||||
|
* Поправил тему оформления
|
||||||
|
* Исправлена работа в windows
|
||||||
|
* Уменьшил количество выводимой отладочной информации
|
||||||
* Добавлено определение пути до git в зависимости от платформы.
|
* Добавлено определение пути до git в зависимости от платформы.
|
||||||
* Исправлено создание файла конфигурации
|
* Исправлено создание файла конфигурации
|
||||||
* Добавлены номера версий в вызов tclsh8.6 и wish8.6.
|
* Добавлены номера версий в вызов tclsh8.6 и wish8.6.
|
||||||
@@ -375,3 +502,13 @@ projman (2.0.0-alfa0) stable; urgency=medium
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
debian/install
vendored
1
debian/install
vendored
@@ -1,5 +1,6 @@
|
|||||||
projman /usr/bin/
|
projman /usr/bin/
|
||||||
changelog-gen /usr/bin/
|
changelog-gen /usr/bin/
|
||||||
|
tkregexp /usr/bin
|
||||||
lib/*.tcl /usr/share/projman/lib
|
lib/*.tcl /usr/share/projman/lib
|
||||||
lib/msgs/* /usr/share/projman/lib/msgs
|
lib/msgs/* /usr/share/projman/lib/msgs
|
||||||
theme /usr/share/projman/
|
theme /usr/share/projman/
|
||||||
|
|||||||
@@ -65,6 +65,19 @@ multilineComments=true
|
|||||||
opened=
|
opened=
|
||||||
editedFiles=
|
editedFiles=
|
||||||
recentFolder=
|
recentFolder=
|
||||||
|
\[Executor\]
|
||||||
|
TCL=tclsh
|
||||||
|
GO=go
|
||||||
|
PY=python3
|
||||||
|
SH=bash
|
||||||
|
PL=perl
|
||||||
|
RB=ruby
|
||||||
|
HTM=firefox
|
||||||
|
HTML=firefox
|
||||||
|
LUA=lua
|
||||||
|
\[Debug\]
|
||||||
|
debug=false
|
||||||
|
debugOut=stdout
|
||||||
"
|
"
|
||||||
proc Config::create {dir} {
|
proc Config::create {dir} {
|
||||||
set cfgFile [open [file join $dir projman.ini] "w+"]
|
set cfgFile [open [file join $dir projman.ini] "w+"]
|
||||||
@@ -121,3 +134,49 @@ proc Config::write {dir} {
|
|||||||
ini::commit $cfgFile
|
ini::commit $cfgFile
|
||||||
ini::close $cfgFile
|
ini::close $cfgFile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Добавление перменной в список
|
||||||
|
# если отсутствует нужная секция то она будет добавлена.
|
||||||
|
proc Config::AddVariable {key value section} {
|
||||||
|
# Проверяем, существует ли уже такая переменная
|
||||||
|
if {[info exists ::cfgVariables($key)]} {
|
||||||
|
DebugPuts "The variable '$key' already exists: $::cfgVariables($key)"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
# Добавляем в массив переменных
|
||||||
|
set ::cfgVariables($key) $value
|
||||||
|
|
||||||
|
# Добавляем в список ключей секции
|
||||||
|
if {[info exists ::cfgINIsections($section)]} {
|
||||||
|
# Проверяем, нет ли уже такого ключа в секции
|
||||||
|
if {[lsearch -exact $::cfgINIsections($section) $key] == -1} {
|
||||||
|
lappend ::cfgINIsections($section) $key
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set ::cfgINIsections($section) [list $key]
|
||||||
|
}
|
||||||
|
DebugPuts "Config::AddVariable: The variable '$key' has been added to the array 'cfgVariables'"
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Проверяем наличие переменных в конфиге на основе "эталонного" списка
|
||||||
|
# и выставляем значение по умолчанию если в конфиге переменной нет
|
||||||
|
proc Config::CheckVariables {} {
|
||||||
|
set valList [split $::configDefault "\n"]
|
||||||
|
foreach item $valList {
|
||||||
|
if {[regexp -nocase -all -- {\[(\w+)\]} $item -> v1]} {
|
||||||
|
set section $v1
|
||||||
|
}
|
||||||
|
if {[regexp {^([^=]+)=(.*)$} $item -> var value]} {
|
||||||
|
if ![info exists ::cfgVariables($var)] {
|
||||||
|
DebugPuts "Error in Config::CheckVariables: variable ::cfgVariables($var) not found"
|
||||||
|
# set ::cfgVariables($var) $value
|
||||||
|
DebugPuts "Config::CheckVariables: The variable cfgVariables($var) setting to default value \"$value\""
|
||||||
|
Config::AddVariable "$var" "$value" "$section"
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
469
lib/editor.tcl
469
lib/editor.tcl
@@ -6,7 +6,6 @@
|
|||||||
######################################################
|
######################################################
|
||||||
# Editor module
|
# Editor module
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
namespace eval Editor {
|
namespace eval Editor {
|
||||||
variable selectionTex
|
variable selectionTex
|
||||||
# Set the editor option
|
# Set the editor option
|
||||||
@@ -17,7 +16,7 @@ namespace eval Editor {
|
|||||||
$node.frmText.t configure -$optionName $value
|
$node.frmText.t configure -$optionName $value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Comment one string or selected string
|
# Comment one string or selected string
|
||||||
proc Comment {txt fileType} {
|
proc Comment {txt fileType} {
|
||||||
global lexers cfgVariables
|
global lexers cfgVariables
|
||||||
@@ -364,15 +363,24 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc SelectionGet {txt} {
|
proc SelectionGet {{txt ""}} {
|
||||||
variable selectionText
|
global nbEditor
|
||||||
|
variable selectionText ""
|
||||||
|
if {$txt eq ""} {
|
||||||
|
DebugPuts "Editor::SelectionGet: [focus]"
|
||||||
|
set txt [focus]
|
||||||
|
if {![string match -nocase "*text*" $txt]} {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
set selBegin [lindex [$txt tag ranges sel] 0]
|
set selBegin [lindex [$txt tag ranges sel] 0]
|
||||||
set selEnd [lindex [$txt tag ranges sel] 1]
|
set selEnd [lindex [$txt tag ranges sel] 1]
|
||||||
if {$selBegin ne "" && $selEnd ne ""} {
|
if {$selBegin ne "" && $selEnd ne ""} {
|
||||||
set selectionText [$txt get $selBegin $selEnd]
|
set selectionText [$txt get $selBegin $selEnd]
|
||||||
}
|
}
|
||||||
|
return $selectionText
|
||||||
}
|
}
|
||||||
|
|
||||||
proc SelectionHighlight {txt} {
|
proc SelectionHighlight {txt} {
|
||||||
variable selectionText
|
variable selectionText
|
||||||
$txt tag remove lightSelected 1.0 end
|
$txt tag remove lightSelected 1.0 end
|
||||||
@@ -394,236 +402,16 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
proc VarHelperKey { widget K A } {
|
|
||||||
set win .varhelper
|
|
||||||
# if { [winfo exists $win] == 0 } { return }
|
|
||||||
set ind [$win.lBox curselection]
|
|
||||||
# puts ">>>>>>>>>>>> VarHelperBind <<<<<<<<<<<<<<<<"
|
|
||||||
|
|
||||||
switch -- $K {
|
|
||||||
Prior {
|
|
||||||
set up [expr [$win.lBox index active] - [$win.lBox cget -height]]
|
|
||||||
if { $up < 0 } { set up 0 }
|
|
||||||
$win.lBox activate $up
|
|
||||||
$win.lBox selection clear 0 end
|
|
||||||
$win.lBox selection set $up $up
|
|
||||||
}
|
|
||||||
Next {
|
|
||||||
set down [expr [$win.lBox index active] + [$win.lBox cget -height]]
|
|
||||||
if { $down >= [$win.lBox index end] } { set down end }
|
|
||||||
$win.lBox activate $down
|
|
||||||
$win.lBox selection clear 0 end
|
|
||||||
$win.lBox selection set $down $down
|
|
||||||
}
|
|
||||||
Up {
|
|
||||||
set up [expr [$win.lBox index active] - 1]
|
|
||||||
if { $up < 0 } { set up 0 }
|
|
||||||
$win.lBox activate $up
|
|
||||||
$win.lBox selection clear 0 end
|
|
||||||
$win.lBox selection set $up $up
|
|
||||||
}
|
|
||||||
Down {
|
|
||||||
set down [expr [$win.lBox index active] + 1]
|
|
||||||
if { $down >= [$win.lBox index end] } { set down end }
|
|
||||||
$win.lBox activate $down
|
|
||||||
$win.lBox selection clear 0 end
|
|
||||||
$win.lBox selection set $down $down
|
|
||||||
}
|
|
||||||
Return {
|
|
||||||
$widget delete "insert - 1 chars wordstart" "insert wordend - 1 chars"
|
|
||||||
$widget insert "insert" [$win.lBox get [$win.lBox curselection]]
|
|
||||||
# eval [bind VarHelperBind <Escape>]
|
|
||||||
Editor::VarHelperEscape $widget
|
|
||||||
}
|
|
||||||
default {
|
|
||||||
$widget insert "insert" $A
|
|
||||||
# eval [bind VarHelperBind <Escape>]
|
|
||||||
Editor::VarHelperEscape $widget
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ;# proc auto_completition_key
|
|
||||||
proc VarHelperEscape {w} {
|
|
||||||
# puts ">>>>>>>>>>>> VarHelperEscape <<<<<<<<<<<<<<<<"
|
|
||||||
# bindtags $w [list [winfo parent $w] $w Text sysAfter all]
|
|
||||||
bindtags $w [list [winfo toplevel $w] $w Ctext sysAfter all]
|
|
||||||
catch { destroy .varhelper }
|
|
||||||
puts [bindtags $w]
|
|
||||||
puts [bind $w]
|
|
||||||
|
|
||||||
}
|
proc ReleaseKey {k txt fileType} {
|
||||||
proc VarHelper {x y w word wordType} {
|
global cfgVariables lexers returnProcessed
|
||||||
global editors lexers variables
|
# Если Return уже обработан в SelectFromList, пропускаем
|
||||||
variable txt
|
# puts "$returnProcessed $k"
|
||||||
variable win
|
if {$k eq "Return" && [info exists returnProcessed]} {
|
||||||
# set txt $w.frmText.t
|
unset returnProcessed
|
||||||
# блокировка открытия диалога если запущен другой
|
|
||||||
set txt $w
|
|
||||||
# set win .varhelper
|
|
||||||
# Проверяем если есть выделение то блокировать появление диалога
|
|
||||||
if {[$txt tag ranges sel] != ""} {
|
|
||||||
puts "You have selected text [$txt tag ranges sel]"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
# puts "$x $y $w $word $wordType"
|
|
||||||
set fileType [dict get $editors $txt fileType]
|
|
||||||
|
|
||||||
if {[dict exists $editors $txt variableList] != 0} {
|
|
||||||
set varList [dict get $editors $txt variableList]
|
|
||||||
# puts $varList
|
|
||||||
}
|
|
||||||
if {[dict exists $editors $txt procedureList] != 0} {
|
|
||||||
set procList [dict get $editors $txt procedureList]
|
|
||||||
}
|
|
||||||
# puts $procList
|
|
||||||
# puts ">>>>>>>[dict get $lexers $fileType commands]"
|
|
||||||
if {[dict exists $lexers $fileType commands] !=0} {
|
|
||||||
foreach i [dict get $lexers $fileType commands] {
|
|
||||||
# puts $i
|
|
||||||
lappend procList $i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# if {[dict exists $editors $txt variableList] == 0 && [dict exists $editors $txt procedureList] == 0} {
|
|
||||||
# return
|
|
||||||
# }
|
|
||||||
set findedVars ""
|
|
||||||
switch -- $wordType {
|
|
||||||
vars {
|
|
||||||
foreach i [lsearch -nocase -all $varList $word*] {
|
|
||||||
# puts [lindex $varList $i]
|
|
||||||
set item [lindex [lindex $varList $i] 0]
|
|
||||||
# puts $item
|
|
||||||
if {[lsearch $findedVars $item] eq "-1"} {
|
|
||||||
lappend findedVars $item
|
|
||||||
# puts $item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
procedure {
|
|
||||||
foreach i [lsearch -nocase -all $procList $word*] {
|
|
||||||
# puts [lindex $varList $i]
|
|
||||||
set item [lindex [lindex $procList $i] 0]
|
|
||||||
# puts $item
|
|
||||||
if {[lsearch $findedVars $item] eq "-1"} {
|
|
||||||
lappend findedVars $item
|
|
||||||
# puts $item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default {
|
|
||||||
foreach i [lsearch -nocase -all $varList $word*] {
|
|
||||||
# puts [lindex $varList $i]
|
|
||||||
set item [lindex [lindex $varList $i] 0]
|
|
||||||
# puts $item
|
|
||||||
if {[lsearch $findedVars $item] eq "-1"} {
|
|
||||||
lappend findedVars $item
|
|
||||||
# puts $item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach i [lsearch -nocase -all $procList $word*] {
|
|
||||||
# puts [lindex $varList $i]
|
|
||||||
set item [lindex [lindex $procList $i] 0]
|
|
||||||
# puts $item
|
|
||||||
if {[lsearch $findedVars $item] eq "-1"} {
|
|
||||||
lappend findedVars $item
|
|
||||||
# puts $item
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
# unset item
|
|
||||||
# bindtags $txt [list VarHelperBind [winfo toplevel $txt] $txt Ctext sysAfter all]
|
|
||||||
# bindtags $txt.t [list VarHelperBind [winfo parent $txt.t] $txt.t Text sysAfter all]
|
|
||||||
# bind VarHelperBind <Escape> "Editor::VarHelperEscape $txt.t; break"
|
|
||||||
# # bindtags $txt.t {[list [winfo parent $txt.t] $txt.t Text sysAfter all]};
|
|
||||||
# # bindtags $txt {[list [winfo toplevel $txt] $txt Ctext sysAfter all]};
|
|
||||||
# # catch { destroy .varhelper }"
|
|
||||||
# bind VarHelperBind <Key> {Editor::VarHelperKey %W %K %A; break}
|
|
||||||
#
|
|
||||||
if {$findedVars eq ""} {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# puts $findedVars
|
#
|
||||||
VarHelperDialog $x $y $w $word $findedVars
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
proc VarHelperDialog {x y w word findedVars} {
|
|
||||||
global editors lexers variables
|
|
||||||
variable txt
|
|
||||||
variable win
|
|
||||||
# puts ">>>>>>>>>>>>>$x $y $w $word $findedVars"
|
|
||||||
# set txt $w.frmText.t
|
|
||||||
# блокировка открытия диалога если запущен другой
|
|
||||||
# if [winfo exists .findVariables] {
|
|
||||||
# return
|
|
||||||
# }
|
|
||||||
# if { [winfo exists $win] } { destroy $win }
|
|
||||||
set txt $w
|
|
||||||
set win .varhelper
|
|
||||||
# if {$findedVars eq ""} {
|
|
||||||
# return
|
|
||||||
# }
|
|
||||||
toplevel $win
|
|
||||||
wm transient $win .
|
|
||||||
wm overrideredirect $win 1
|
|
||||||
|
|
||||||
listbox $win.lBox -width 30 -border 0
|
|
||||||
pack $win.lBox -expand true -fill y -side left
|
|
||||||
|
|
||||||
foreach { item } $findedVars {
|
|
||||||
$win.lBox insert end $item
|
|
||||||
}
|
|
||||||
|
|
||||||
catch { $win.lBox activate 0 ; $win.lBox selection set 0 0 }
|
|
||||||
|
|
||||||
if { [set height [llength $findedVars]] > 10 } { set height 10 }
|
|
||||||
$win.lBox configure -height $height
|
|
||||||
|
|
||||||
# focus $win.lBox
|
|
||||||
|
|
||||||
bind $win <Escape> {
|
|
||||||
destroy $Editor::win
|
|
||||||
focus -force $Editor::txt.t
|
|
||||||
break
|
|
||||||
}
|
|
||||||
bind $win.lBox <Escape> {
|
|
||||||
destroy $Editor::win
|
|
||||||
focus -force $Editor::txt.t
|
|
||||||
break
|
|
||||||
}
|
|
||||||
bind VarHelperBind <Control-Return> {
|
|
||||||
$Editor::txt delete "insert - 1 chars wordstart" "insert wordend - 1 chars"
|
|
||||||
$Editor::txt insert "insert" [.varhelper.lBox get [.varhelper.lBox curselection]]
|
|
||||||
# eval [bind VarHelperBind <Escape>]
|
|
||||||
Editor::VarHelperEscape $Editor::txt
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
# Определям расстояние до края экрана (основного окна) и если
|
|
||||||
# оно меньше размера окна со списком то сдвигаем его вверх
|
|
||||||
set winGeomY [winfo reqheight $win]
|
|
||||||
set winGeomX [winfo reqwidth $win]
|
|
||||||
|
|
||||||
set topHeight [winfo height .]
|
|
||||||
set topWidth [winfo width .]
|
|
||||||
set topLeftUpperX [winfo x .]
|
|
||||||
set topLeftUpperY [winfo y .]
|
|
||||||
set topRightLowerX [expr $topLeftUpperX + $topWidth]
|
|
||||||
set topRightLowerY [expr $topLeftUpperY + $topHeight]
|
|
||||||
|
|
||||||
if {[expr [expr $x + $winGeomX] > $topRightLowerX]} {
|
|
||||||
set x [expr $x - $winGeomX]
|
|
||||||
}
|
|
||||||
if {[expr [expr $y + $winGeomY] > $topRightLowerY]} {
|
|
||||||
set y [expr $y - $winGeomY]
|
|
||||||
}
|
|
||||||
|
|
||||||
wm geom $win +$x+$y
|
|
||||||
}
|
|
||||||
|
|
||||||
proc ReleaseKey {k txt fileType} {
|
|
||||||
global cfgVariables lexers
|
|
||||||
set pos [$txt index insert]
|
set pos [$txt index insert]
|
||||||
set lineNum [lindex [split $pos "."] 0]
|
set lineNum [lindex [split $pos "."] 0]
|
||||||
set posNum [lindex [split $pos "."] 1]
|
set posNum [lindex [split $pos "."] 1]
|
||||||
@@ -637,8 +425,53 @@ namespace eval Editor {
|
|||||||
unset lpos
|
unset lpos
|
||||||
$txt tag remove lightSelected 1.0 end
|
$txt tag remove lightSelected 1.0 end
|
||||||
|
|
||||||
if { [winfo exists .varhelper] } { destroy .varhelper }
|
# Обработка ввода для показа окна с подсказками.
|
||||||
# puts $k
|
# if { [winfo exists .varhelper] } { destroy .varhelper }
|
||||||
|
# Флаг, нужно ли показывать новый список
|
||||||
|
set showNewList 1
|
||||||
|
|
||||||
|
# Проверяем окно списка
|
||||||
|
if {[winfo exists .varhelper]} {
|
||||||
|
# Определяем, какая клавиша отпущена
|
||||||
|
switch -- $k {
|
||||||
|
Up - Down {
|
||||||
|
# Стрелки - управление списком, окно остается
|
||||||
|
# НЕ показываем новый список
|
||||||
|
set showNewList 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Return {
|
||||||
|
# Enter - выберет элемент, окно закроется в SelectFromList
|
||||||
|
# НЕ показываем новый список
|
||||||
|
set showNewList 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Escape {
|
||||||
|
# Escape - закрыть окно
|
||||||
|
destroy .varhelper
|
||||||
|
set ::Helper::listActive 0
|
||||||
|
Helper::VarHelperBindingsRestore $txt
|
||||||
|
# НЕ показываем новый список
|
||||||
|
set showNewList 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
Control_L - Control_R - Alt_L - Alt_R - Shift_L - Shift_R {
|
||||||
|
# Модификаторы - окно остается
|
||||||
|
# НЕ показываем новый список
|
||||||
|
set showNewList 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
# Любая другая клавиша (буквы, цифры, пробел, Tab и т.д.)
|
||||||
|
# закрывает окно списка, но ПОКАЗЫВАЕМ новый список
|
||||||
|
destroy .varhelper
|
||||||
|
set ::Helper::listActive 0
|
||||||
|
Helper::VarHelperBindingsRestore $txt
|
||||||
|
# showNewList остается = 1 (показываем новый список)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch $k {
|
switch $k {
|
||||||
Return {
|
Return {
|
||||||
regexp {^(\s*)} [$txt get [expr $lineNum - 1].0 [expr $lineNum - 1].end] -> spaceStart
|
regexp {^(\s*)} [$txt get [expr $lineNum - 1].0 [expr $lineNum - 1].end] -> spaceStart
|
||||||
@@ -682,10 +515,68 @@ namespace eval Editor {
|
|||||||
if {$cfgVariables(variableHelper) eq "true"} {
|
if {$cfgVariables(variableHelper) eq "true"} {
|
||||||
if {[dict exists $lexers $fileType variableSymbol] != 0} {
|
if {[dict exists $lexers $fileType variableSymbol] != 0} {
|
||||||
set varSymbol [dict get $lexers $fileType variableSymbol]
|
set varSymbol [dict get $lexers $fileType variableSymbol]
|
||||||
set lastSymbol [string last $varSymbol [$txt get $lineNum.0 $pos]]
|
set lineText [$txt get $lineNum.0 $pos]
|
||||||
|
# # Ищем переменную с помощью регулярного выражения
|
||||||
|
# # Паттерн ищет $ за которым идет имя переменной И курсор сразу после имени
|
||||||
|
# if {[regexp "(\\$)(\[a-zA-Z_:\]\[a-zA-Z0-9_:\]*)\$" $lineText -> symbol varName]} {
|
||||||
|
# # Проверяем, что найденный $ - это действительно начало переменной
|
||||||
|
# # (а не часть строки или другого символа)
|
||||||
|
# DebugPuts "Found variable: $symbol$varName"
|
||||||
|
#
|
||||||
|
# # Дополнительная проверка: перед $ не должно быть обратного слэша (экранирование)
|
||||||
|
# set posOfVarSymbol [string last $varSymbol $lineText]
|
||||||
|
# if {$posOfVarSymbol > 0} {
|
||||||
|
# set charBefore [string index $lineText [expr {$posOfVarSymbol - 1}]]
|
||||||
|
# if {$charBefore eq "\\"} {
|
||||||
|
# DebugPuts "Dollar sign is escaped, skipping"
|
||||||
|
# return
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# Helper::VarHelper $box_x $box_y $txt $varName vars
|
||||||
|
# }
|
||||||
|
DebugPuts "Line text: '$lineText'"
|
||||||
|
|
||||||
|
# Проверяем, есть ли $ в строке
|
||||||
|
set lastSymbol [string last $varSymbol $lineText]
|
||||||
if {$lastSymbol ne "-1"} {
|
if {$lastSymbol ne "-1"} {
|
||||||
set word [string trim [$txt get $lineNum.[expr $lastSymbol + 1] $pos]]
|
# Проверяем экранирование
|
||||||
Editor::VarHelper $box_x $box_y $txt $word vars
|
if {$lastSymbol > 0} {
|
||||||
|
set charBefore [string index $lineText [expr {$lastSymbol - 1}]]
|
||||||
|
if {$charBefore eq "\\"} {
|
||||||
|
DebugPuts "Dollar sign is escaped, skipping"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Берем текст после $
|
||||||
|
set afterDollar [string range $lineText [expr {$lastSymbol + 1}] end]
|
||||||
|
DebugPuts "Text after $varSymbol: '$afterDollar'"
|
||||||
|
# Если после $ ничего нет (только что ввели $) - показываем все переменные
|
||||||
|
if {$afterDollar eq ""} {
|
||||||
|
DebugPuts "Just typed $varSymbol, showing all variables"
|
||||||
|
Helper::VarHelper $box_x $box_y $txt "" vars
|
||||||
|
return
|
||||||
|
}
|
||||||
|
# Проверяем, что введено после $
|
||||||
|
if {[regexp {^([a-zA-Z_:][a-zA-Z0-9_:]*)?$} $afterDollar -> varName]} {
|
||||||
|
# Вариант 1: regexp с концом строки - курсор сразу после (возможного) имени
|
||||||
|
DebugPuts "Cursor after variable name (or $varSymbol only): '$varName'"
|
||||||
|
Helper::VarHelper $box_x $box_y $txt $varName vars
|
||||||
|
} elseif {[regexp {^([a-zA-Z_:][a-zA-Z0-9_:]*)} $afterDollar -> varName]} {
|
||||||
|
# Вариант 2: есть имя переменной, но курсор не обязательно сразу после
|
||||||
|
DebugPuts "Found variable name: '$varName'"
|
||||||
|
# Проверяем позицию курсора
|
||||||
|
set varEndPos [expr {[string length $varName] + 1}] ; # +1 для $
|
||||||
|
|
||||||
|
if {$varEndPos == [string length $lineText]} {
|
||||||
|
# Курсор сразу после имени
|
||||||
|
Helper::VarHelper $box_x $box_y $txt $varName vars
|
||||||
|
} else {
|
||||||
|
DebugPuts "Cursor not immediately after variable name, skipping"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# После $ что-то недопустимое (например, цифра, скобка и т.д.)
|
||||||
|
DebugPuts "Invalid characters after $varSymbol"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
set ind [$txt search -backwards -regexp {\W} $pos {insert linestart}]
|
set ind [$txt search -backwards -regexp {\W} $pos {insert linestart}]
|
||||||
@@ -697,8 +588,9 @@ namespace eval Editor {
|
|||||||
# set ind [$txt search -backwards -regexp {^} $pos {insert linestart}]
|
# set ind [$txt search -backwards -regexp {^} $pos {insert linestart}]
|
||||||
set word [$txt get {insert linestart} $pos]
|
set word [$txt get {insert linestart} $pos]
|
||||||
}
|
}
|
||||||
|
DebugPuts "> Extracted word: '$word'"
|
||||||
if {$word ne ""} {
|
if {$word ne ""} {
|
||||||
Editor::VarHelper $box_x $box_y $txt $word {}
|
Helper::VarHelper $box_x $box_y $txt $word {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -714,7 +606,7 @@ namespace eval Editor {
|
|||||||
set word [$txt get {insert linestart} $pos]
|
set word [$txt get {insert linestart} $pos]
|
||||||
}
|
}
|
||||||
if {$word ne ""} {
|
if {$word ne ""} {
|
||||||
Editor::VarHelper $box_x $box_y $txt $word procedure
|
Helper::VarHelper $box_x $box_y $txt $word procedure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -786,36 +678,51 @@ namespace eval Editor {
|
|||||||
bind $txt <Control-eacute> Quit
|
bind $txt <Control-eacute> Quit
|
||||||
bind $txt <Control-igrave> "Editor::SelectionPaste $txt"
|
bind $txt <Control-igrave> "Editor::SelectionPaste $txt"
|
||||||
bind $txt <Control-v> "Editor::SelectionPaste $txt"
|
bind $txt <Control-v> "Editor::SelectionPaste $txt"
|
||||||
|
bind $txt <Control-Cyrillic_em> "Editor::SelectionPaste $txt"
|
||||||
bind $txt <Control-l> "SearchVariable $txt; break"
|
bind $txt <Control-l> "SearchVariable $txt; break"
|
||||||
bind $txt <Control-i> "ImageBase64Encode $txt"
|
bind $txt <Control-Cyrillic_de> "SearchVariable $txt; break"
|
||||||
|
bind $txt <Control-i> "ImageBase64Encode"
|
||||||
|
bind $txt <Control-Cyrillic_sha> "ImageBase64Encode $txt"
|
||||||
bind $txt <Control-bracketleft> "Editor::InsertTabular $txt"
|
bind $txt <Control-bracketleft> "Editor::InsertTabular $txt"
|
||||||
bind $txt <Control-bracketright> "Editor::DeleteTabular $txt"
|
bind $txt <Control-bracketright> "Editor::DeleteTabular $txt"
|
||||||
bind $txt <Control-comma> "Editor::Comment $txt $fileType"
|
bind $txt <Control-comma> "Editor::Comment $txt $fileType"
|
||||||
bind $txt <Control-period> "Editor::Uncomment $txt $fileType"
|
bind $txt <Control-period> "Editor::Uncomment $txt $fileType"
|
||||||
bind $txt <Control-eacute> Find
|
bind $txt <Control-eacute> Find
|
||||||
bind $txt <Insert> {OverWrite}
|
# bind $txt <Insert> {OverWrite}
|
||||||
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
|
bind $txt <ButtonRelease-1> "Editor::SearchBrackets $txt"
|
||||||
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
|
bind $txt <Button-1><ButtonRelease-1> "Editor::SelectionHighlight $txt"
|
||||||
bind $txt <<Modified>> "SetModifiedFlag $w $nb"
|
bind $txt <<Modified>> "SetModifiedFlag $w $nb auto"
|
||||||
bind $txt <Control-i> ImageBase64Encode
|
|
||||||
bind $txt <Control-u> "Editor::SearchBrackets %W"
|
bind $txt <Control-u> "Editor::SearchBrackets %W"
|
||||||
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}"
|
bind $txt <Control-Cyrillic_ghe> "Editor::SearchBrackets %W"
|
||||||
|
bind $txt <Control-J> "catch {Editor::GoToFunction $txt}; break"
|
||||||
bind $txt <Control-j> "catch {Editor::GoToFunction $txt}; break"
|
bind $txt <Control-j> "catch {Editor::GoToFunction $txt}; break"
|
||||||
|
bind $txt <Control-y> {Redo; break}
|
||||||
|
bind $txt <Control-Cyrillic_o> "catch {Editor::GoToFunction $txt}; break"
|
||||||
bind $txt <Alt-w> "$txt delete {insert wordstart} {insert wordend}"
|
bind $txt <Alt-w> "$txt delete {insert wordstart} {insert wordend}"
|
||||||
bind $txt <Alt-odiaeresis> "$txt delete {insert wordstart} {insert wordend}"
|
bind $txt <Alt-odiaeresis> "$txt delete {insert wordstart} {insert wordend}"
|
||||||
|
bind $txt <Alt-Cyrillic_tse> "$txt delete {insert wordstart} {insert wordend}"
|
||||||
bind $txt <Alt-r> "$txt delete {insert linestart} {insert lineend + 1char}"
|
bind $txt <Alt-r> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
|
bind $txt <Alt-Cyrillic_ka> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
bind $txt <Alt-ecircumflex> "$txt delete {insert linestart} {insert lineend + 1char}"
|
bind $txt <Alt-ecircumflex> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
|
bind $txt <Alt-Cyrillic_er> "$txt delete {insert linestart} {insert lineend + 1char}"
|
||||||
bind $txt <Alt-b> "$txt delete {insert linestart} insert"
|
bind $txt <Alt-b> "$txt delete {insert linestart} insert"
|
||||||
|
bind $txt <Alt-Cyrillic_i> "$txt delete {insert linestart} insert"
|
||||||
bind $txt <Alt-e> "$txt delete insert {insert lineend}"
|
bind $txt <Alt-e> "$txt delete insert {insert lineend}"
|
||||||
|
bind $txt <Alt-Cyrillic_u> "$txt delete insert {insert lineend}"
|
||||||
bind $txt <Alt-s> "Editor::SplitEditorH $w $fileType"
|
bind $txt <Alt-s> "Editor::SplitEditorH $w $fileType"
|
||||||
bind $txt <Alt-ucircumflex> "Editor::SplitEditorH $w $fileType"
|
bind $txt <Alt-ucircumflex> "Editor::SplitEditorH $w $fileType"
|
||||||
|
bind $txt <Alt-Cyrillic_hardsign> "Editor::SplitEditorH $w $fileType"
|
||||||
bind $txt <Alt-y> "Editor::TextCopy $txt"
|
bind $txt <Alt-y> "Editor::TextCopy $txt"
|
||||||
|
bind $txt <Alt-Cyrillic_en> "Editor::TextCopy $txt"
|
||||||
bind $txt <Control-g> "Editor::GoToLineNumberDialog $txt"
|
bind $txt <Control-g> "Editor::GoToLineNumberDialog $txt"
|
||||||
|
bind $txt <Control-Cyrillic_pe> "Editor::GoToLineNumberDialog $txt"
|
||||||
bind $txt <Control-agrave> "Editor::FindDialog $w"
|
bind $txt <Control-agrave> "Editor::FindDialog $w"
|
||||||
bind $txt <Control-f> "Editor::FindDialog $txt"
|
bind $txt <Control-f> "Editor::FindDialog $txt"
|
||||||
|
bind $txt <Control-Cyrillic_a> "Editor::FindDialog $txt"
|
||||||
bind $txt <Control-F> "Editor::FindDialog $txt"
|
bind $txt <Control-F> "Editor::FindDialog $txt"
|
||||||
bind $txt <Control-odiaeresis> FileOper::Close
|
bind $txt <Control-odiaeresis> FileOper::Close
|
||||||
bind $txt <Control-w> FileOper::Close
|
bind $txt <Control-w> FileOper::Close
|
||||||
|
bind $txt <Control-Cyrillic_tse> FileOper::Close
|
||||||
bind $txt <Control-o> {
|
bind $txt <Control-o> {
|
||||||
set filePath [FileOper::OpenDialog]
|
set filePath [FileOper::OpenDialog]
|
||||||
if {$filePath != ""} {
|
if {$filePath != ""} {
|
||||||
@@ -830,6 +737,18 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
bind $txt <Control-Cyrillic_shcha> {
|
||||||
|
set filePath [FileOper::OpenDialog]
|
||||||
|
if {$filePath != ""} {
|
||||||
|
FileOper::Edit $filePath
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
bind $txt <Control-r> "Editor::SplitEditorForExecute $w $fileType $nb "
|
||||||
|
bind $txt <Control-Cyrillic_ka> "Editor::SplitEditorForExecute $w $fileType $nb "
|
||||||
|
# bind $txt <Shift-Control-s> FileOper::Close
|
||||||
|
# bind $txt <Shift-Control-Cyrillic_es> "FileOper::Close saveas"
|
||||||
|
|
||||||
# bind $txt.t <KeyRelease> "Editor::ReleaseKey %K $txt.t $fileType"
|
# bind $txt.t <KeyRelease> "Editor::ReleaseKey %K $txt.t $fileType"
|
||||||
# bind $txt.t <KeyPress> "Editor::PressKey %K $txt.t"
|
# bind $txt.t <KeyPress> "Editor::PressKey %K $txt.t"
|
||||||
# bind $txt <KeyRelease> "Editor::Key %k %K"
|
# bind $txt <KeyRelease> "Editor::Key %k %K"
|
||||||
@@ -904,7 +823,9 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
if {$posNum == $posBegin} {
|
if {$posNum == $posBegin} {
|
||||||
if {$symbol == {"} || $symbol == {_}} {
|
if {$symbol == {"} || $symbol == {_}} {
|
||||||
$txt insert $lineEnd.$posEnd "$selText$symbol"
|
$txt tag remove sel $lineBegin.$posBegin $lineEnd.$posEnd
|
||||||
|
$txt insert $lineEnd.$posEnd "$symbol"
|
||||||
|
# $txt tag add sel "$lineBegin.$posBegin + 1 char" "$lineEnd.$posEnd + 1 char"
|
||||||
} else {
|
} else {
|
||||||
$txt insert $lineEnd.$posEnd "$symbol"
|
$txt insert $lineEnd.$posEnd "$symbol"
|
||||||
}
|
}
|
||||||
@@ -913,7 +834,7 @@ namespace eval Editor {
|
|||||||
if {$posBegin == 0} {
|
if {$posBegin == 0} {
|
||||||
$txt insert $pos "$symbol"
|
$txt insert $pos "$symbol"
|
||||||
} else {
|
} else {
|
||||||
$txt insert "$pos + 1 chars" "$symbol"
|
$txt insert "$pos + 0 chars" "$symbol"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$txt highlight $lineBegin.$posBegin $lineEnd.end
|
$txt highlight $lineBegin.$posBegin $lineEnd.end
|
||||||
@@ -939,10 +860,10 @@ namespace eval Editor {
|
|||||||
# set fileName untitled-$untitledNumber
|
# set fileName untitled-$untitledNumber
|
||||||
set fileFullPath untitled-$untitledNumber
|
set fileFullPath untitled-$untitledNumber
|
||||||
#puts [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
|
#puts [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
|
||||||
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
|
set nbEditorItem [NB::InsertItem $nbEditor $fileFullPath "file"]
|
||||||
# puts "$nbEditorItem, $nbEditor"
|
# puts "$nbEditorItem, $nbEditor"
|
||||||
Editor $fileFullPath $nbEditor $nbEditorItem
|
Editor $fileFullPath $nbEditor $nbEditorItem
|
||||||
SetModifiedFlag $nbEditorItem $nbEditor
|
SetModifiedFlag $nbEditorItem $nbEditor force
|
||||||
focus -force $nbEditorItem.frmText.t.t
|
focus -force $nbEditorItem.frmText.t.t
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -956,9 +877,15 @@ namespace eval Editor {
|
|||||||
for {set lineNumber 0} {$lineNumber <= [$txt count -lines 0.0 end]} {incr lineNumber} {
|
for {set lineNumber 0} {$lineNumber <= [$txt count -lines 0.0 end]} {incr lineNumber} {
|
||||||
set line [$txt get $lineNumber.0 $lineNumber.end]
|
set line [$txt get $lineNumber.0 $lineNumber.end]
|
||||||
# Выбираем процедуры (функции, классы и т.д.)
|
# Выбираем процедуры (функции, классы и т.д.)
|
||||||
|
# DebugPuts "Editor::RedaStructure: file type $fileType"
|
||||||
|
|
||||||
if {[dict exists $lexers $fileType procRegexpCommand] != 0 } {
|
if {[dict exists $lexers $fileType procRegexpCommand] != 0 } {
|
||||||
|
# regexp -nocase -all -line -- {^\s*(?:(\w+)\s+)+(\w+)\s*\((.*?)\)\s*(?:;|\{)} $line match returns procName params
|
||||||
|
# regexp -nocase -all -line -lineanchor -linestop -- {^\s*(?:(\w+)\s+)+(\w+)\s*\((.*?)(,|\))} $line match v1 v2 v3 v4
|
||||||
if {[eval [dict get $lexers $fileType procRegexpCommand]]} {
|
if {[eval [dict get $lexers $fileType procRegexpCommand]]} {
|
||||||
|
DebugPuts "Editor::RedaStructure: regexp = [dict get $lexers $fileType procRegexpCommand]"
|
||||||
set procName_ [string trim $procName]
|
set procName_ [string trim $procName]
|
||||||
|
DebugPuts "Editor::RedaStructure: find the proc $procName_"
|
||||||
if {$treeItemName ne ""} {
|
if {$treeItemName ne ""} {
|
||||||
Tree::InsertItem $tree $treeItemName $procName_ "procedure" "$procName_ ($params)"
|
Tree::InsertItem $tree $treeItemName $procName_ "procedure" "$procName_ ($params)"
|
||||||
}
|
}
|
||||||
@@ -1285,7 +1212,7 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
ttk::button $win.bBackward -state disable -image backward_20x20 -command "puts $replaceString"
|
ttk::button $win.bBackward -state disable -image backward_20x20 -command "puts $replaceString"
|
||||||
ttk::button $win.bDone -image done_20x20 -state disable -command {
|
ttk::button $win.bDone -image done_20x20 -state disable -command {
|
||||||
puts "$findString -> $replaceString, $regexpSet"
|
DebugPuts "$findString -> $replaceString, $regexpSet"
|
||||||
}
|
}
|
||||||
ttk::button $win.bDoneAll -image doneall_20x20 -command {
|
ttk::button $win.bDoneAll -image doneall_20x20 -command {
|
||||||
Editor::FindReplaceText $Editor::txt "$findString" "$replaceString" $regexpSet
|
Editor::FindReplaceText $Editor::txt "$findString" "$replaceString" $regexpSet
|
||||||
@@ -1355,6 +1282,7 @@ namespace eval Editor {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
set frmText [Editor::EditorWidget $w $fileType $nb]
|
set frmText [Editor::EditorWidget $w $fileType $nb]
|
||||||
|
# puts "Editor::SplitEditorH: w - $w"
|
||||||
$frmText.t insert end [$w.frmText.t get 0.0 end]
|
$frmText.t insert end [$w.frmText.t get 0.0 end]
|
||||||
|
|
||||||
# $w.panelTxt add $w.frmText -weight 0
|
# $w.panelTxt add $w.frmText -weight 0
|
||||||
@@ -1367,9 +1295,9 @@ namespace eval Editor {
|
|||||||
|
|
||||||
proc SplitEditorV {fileFullPath} {
|
proc SplitEditorV {fileFullPath} {
|
||||||
global cfgVariables
|
global cfgVariables
|
||||||
regsub -all {\.|/|\\|\s} $fileFullPath "_" itemName
|
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
|
||||||
set itemName ".frmWork.nbEditor2.$itemName"
|
set itemName ".frmWork.nbEditor2.$itemName"
|
||||||
# puts $itemName
|
DebugPuts "Editor::SplitEditoprV: nb item - $itemName"
|
||||||
if {[winfo exists $itemName] == 1} {
|
if {[winfo exists $itemName] == 1} {
|
||||||
.frmWork.nbEditor2 forget $itemName
|
.frmWork.nbEditor2 forget $itemName
|
||||||
destroy $itemName
|
destroy $itemName
|
||||||
@@ -1389,9 +1317,7 @@ namespace eval Editor {
|
|||||||
# grid columnconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
# grid columnconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
||||||
# grid rowconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
# grid rowconfigure .frmWork .frmWork.nbEditor2 -weight 1
|
||||||
.frmWork.panelNB add .frmWork.nbEditor2 -weight 0
|
.frmWork.panelNB add .frmWork.nbEditor2 -weight 0
|
||||||
puts [FileOper::Edit $fileFullPath .frmWork.nbEditor2]
|
DebugPuts [FileOper::Edit $fileFullPath .frmWork.nbEditor2]
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
proc GoToLineNumber {text lineNumber} {
|
proc GoToLineNumber {text lineNumber} {
|
||||||
@@ -1432,7 +1358,7 @@ namespace eval Editor {
|
|||||||
bind $win.ent <Return> {
|
bind $win.ent <Return> {
|
||||||
set lineNumber [.gotoline.ent get]
|
set lineNumber [.gotoline.ent get]
|
||||||
# $txt see insert $lineNumber
|
# $txt see insert $lineNumber
|
||||||
puts $Editor::txt
|
DebugPuts $Editor::txt
|
||||||
$Editor::txt mark set insert $lineNumber.0
|
$Editor::txt mark set insert $lineNumber.0
|
||||||
$Editor::txt see insert
|
$Editor::txt see insert
|
||||||
focus $Editor::txt.t
|
focus $Editor::txt.t
|
||||||
@@ -1515,6 +1441,7 @@ namespace eval Editor {
|
|||||||
ICO
|
ICO
|
||||||
XPM
|
XPM
|
||||||
}
|
}
|
||||||
|
# puts "$itemName"
|
||||||
set fr $itemName
|
set fr $itemName
|
||||||
if ![string match "*untitled*" $itemName] {
|
if ![string match "*untitled*" $itemName] {
|
||||||
set lblText $fileFullPath
|
set lblText $fileFullPath
|
||||||
@@ -1524,6 +1451,8 @@ namespace eval Editor {
|
|||||||
}
|
}
|
||||||
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
|
set fileType [string toupper [string trimleft [file extension $fileFullPath] "."]]
|
||||||
if {$fileType eq ""} {set fileType "Unknown"}
|
if {$fileType eq ""} {set fileType "Unknown"}
|
||||||
|
|
||||||
|
ExecutorCommandPathSetting $fileType
|
||||||
|
|
||||||
ttk::frame $fr.header
|
ttk::frame $fr.header
|
||||||
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"
|
set lblName "lbl[string range $itemName [expr [string last "." $itemName] +1] end]"
|
||||||
@@ -1536,9 +1465,13 @@ namespace eval Editor {
|
|||||||
-command "Editor::SplitEditorH $fr $fileType $nb"
|
-command "Editor::SplitEditorH $fr $fileType $nb"
|
||||||
ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \
|
ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \
|
||||||
-command "Editor::SplitEditorV $fileFullPath"
|
-command "Editor::SplitEditorV $fileFullPath"
|
||||||
|
|
||||||
|
set btnSplitExecute "btnSplitExec[string range $itemName [expr [string last "." $itemName] +1] end]"
|
||||||
|
ttk::button $fr.header.$btnSplitExecute -image execute_11x11 \
|
||||||
|
-command "Editor::SplitEditorForExecute $fr $fileType $nb $fileFullPath"
|
||||||
# pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e
|
# pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e
|
||||||
pack $fr.header.$lblName -side left -expand true -fill x
|
pack $fr.header.$lblName -side left -expand true -fill x
|
||||||
pack $fr.header.$btnSplitV $fr.header.$btnSplitH -side right
|
pack $fr.header.$btnSplitV $fr.header.$btnSplitH $fr.header.$btnSplitExecute -side right
|
||||||
|
|
||||||
pack $fr.header -side top -fill x
|
pack $fr.header -side top -fill x
|
||||||
|
|
||||||
@@ -1556,4 +1489,28 @@ namespace eval Editor {
|
|||||||
|
|
||||||
return $fr
|
return $fr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc SplitEditorForExecute {w fileType nb {fileFullPath ""}} {
|
||||||
|
global cfgVariables tree
|
||||||
|
if {$fileFullPath eq ""} {
|
||||||
|
set treeItem "file::[string range $w [expr [string last "." $w] +1] end ]"
|
||||||
|
set fileFullPath [Tree::GetItemID $tree $treeItem]
|
||||||
|
puts $fileFullPath
|
||||||
|
}
|
||||||
|
# puts [$w.panelTxt panes]
|
||||||
|
DebugPuts "$w $fileType $nb $fileFullPath"
|
||||||
|
if [winfo exists $w.frmText2] {
|
||||||
|
$w.panelTxt forget $w.frmText2
|
||||||
|
destroy $w.frmText2
|
||||||
|
focus -force $w.frmText.t.t
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
set frmText [ttk::frame $w.frmText2 -border 1]
|
||||||
|
$w.panelTxt add $frmText -weight 1
|
||||||
|
# puts "SplitEditorForExecute: $w"
|
||||||
|
# focus -force $frmText.t.t
|
||||||
|
Execute $fileFullPath $frmText $w
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
236
lib/files.tcl
236
lib/files.tcl
@@ -9,12 +9,42 @@
|
|||||||
|
|
||||||
|
|
||||||
namespace eval FileOper {
|
namespace eval FileOper {
|
||||||
variable types
|
global packages
|
||||||
|
variable types
|
||||||
|
|
||||||
set ::types {
|
set ::types {
|
||||||
{"All files" *}
|
{"All files" *}
|
||||||
}
|
}
|
||||||
|
# Проверка поддерживаемых типов изображений
|
||||||
|
# в зависимости устновлен пакет или нет
|
||||||
|
proc SupportImageType {type} {
|
||||||
|
if {[PackagePresent Img] eq "true"} {
|
||||||
|
switch $type {
|
||||||
|
jpeg { return true }
|
||||||
|
png { return true }
|
||||||
|
gif { return true }
|
||||||
|
bmp { return true }
|
||||||
|
svg { return true }
|
||||||
|
ppm { return true }
|
||||||
|
pgm { return true }
|
||||||
|
tiff { return true }
|
||||||
|
xbm { return true }
|
||||||
|
xpm { return true }
|
||||||
|
default { return false}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch $type {
|
||||||
|
png { return true }
|
||||||
|
gif { return true }
|
||||||
|
bmp { return true }
|
||||||
|
svg { return true }
|
||||||
|
ppm { return true }
|
||||||
|
pgm { return true }
|
||||||
|
default { return false}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
proc GetFileMimeType {fileFullPath {opt ""}} {
|
proc GetFileMimeType {fileFullPath {opt ""}} {
|
||||||
global cfgVariables
|
global cfgVariables
|
||||||
# Проверям наличие программы в системе, если есть то добавляем опции
|
# Проверям наличие программы в системе, если есть то добавляем опции
|
||||||
@@ -35,7 +65,7 @@ namespace eval FileOper {
|
|||||||
catch $cmd pipe
|
catch $cmd pipe
|
||||||
# puts $pipe
|
# puts $pipe
|
||||||
if [regexp -nocase -- {(\w+)/([\w\-_\.]+); charset=([[:alnum:]-]+)} $pipe m fType fExt fCharset] {
|
if [regexp -nocase -- {(\w+)/([\w\-_\.]+); charset=([[:alnum:]-]+)} $pipe m fType fExt fCharset] {
|
||||||
puts "$fType $fExt $fCharset"
|
DebugPuts "$fType $fExt $fCharset"
|
||||||
}
|
}
|
||||||
switch $opt {
|
switch $opt {
|
||||||
"charset" {
|
"charset" {
|
||||||
@@ -47,17 +77,71 @@ namespace eval FileOper {
|
|||||||
# линуксовый file не всегда корректно определяет тип файла
|
# линуксовый file не всегда корректно определяет тип файла
|
||||||
# используем пакет из tcl
|
# используем пакет из tcl
|
||||||
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
|
lassign [::fileutil::fileType $fileFullPath] fType fBinaryType fBinaryInterp
|
||||||
# puts "File type is $fType, $fBinaryType, $fBinaryInterp"
|
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp"
|
||||||
|
set ext [string tolower [file extension $fileFullPath]]
|
||||||
|
|
||||||
|
# Установка корректного типа для svg
|
||||||
|
# Но для новых версий tcl
|
||||||
|
switch $ext {
|
||||||
|
".svg" {
|
||||||
|
set fType "binary"
|
||||||
|
set fBinaryInterp "svg"
|
||||||
|
set fBinaryType "graphic"
|
||||||
|
}
|
||||||
|
".torrent" {
|
||||||
|
set fType "binary"
|
||||||
|
set fBinaryInterp "torrent"
|
||||||
|
set fBinaryType "x-bittorrent"
|
||||||
|
}
|
||||||
|
".pdf" {
|
||||||
|
set fType "binary"
|
||||||
|
set fBinaryInterp "pdf"
|
||||||
|
set fBinaryType "binary"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DebugPuts "File type is $fType, $fBinaryType, $fBinaryInterp, $ext"
|
||||||
|
|
||||||
switch $fType {
|
switch $fType {
|
||||||
"binary" {
|
"binary" {
|
||||||
return false
|
if {$fBinaryType ne ""} {
|
||||||
|
switch $fBinaryType {
|
||||||
|
"graphic" {
|
||||||
|
if {[SupportImageType $fBinaryInterp] eq "true"} {
|
||||||
|
return image
|
||||||
|
} else {
|
||||||
|
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
|
||||||
|
switch $answer {
|
||||||
|
ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
return binary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return binary
|
||||||
|
}
|
||||||
}
|
}
|
||||||
"text" {
|
"text" {
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
"image" {
|
"image" {
|
||||||
return false
|
if {[SupportImageType $fBinaryInterp] eq "true"} {
|
||||||
|
return image
|
||||||
|
} else {
|
||||||
|
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a image. Support not implemented yet."] -icon question -type ok]
|
||||||
|
switch $answer {
|
||||||
|
ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"empty" {
|
||||||
|
return text
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
return false
|
return false
|
||||||
@@ -214,9 +298,13 @@ namespace eval FileOper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Close {} {
|
proc Close {{nbEditorWindow ""}} {
|
||||||
global nbEditor modified tree editors
|
global nbEditor modified tree editors
|
||||||
set nbItem [$nbEditor select]
|
if {$nbEditorWindow eq ""} {
|
||||||
|
set nbEditorWindow $nbEditor
|
||||||
|
}
|
||||||
|
set nbItem [$nbEditorWindow select]
|
||||||
|
# puts "Procedure FileOper::Close: item - $nbItem"
|
||||||
# puts "close tab $nbItem"
|
# puts "close tab $nbItem"
|
||||||
|
|
||||||
if {$nbItem == ""} {return}
|
if {$nbItem == ""} {return}
|
||||||
@@ -226,14 +314,16 @@ namespace eval FileOper {
|
|||||||
-icon question -type yesnocancel \
|
-icon question -type yesnocancel \
|
||||||
-detail [::msgcat::mc "Do you want to save it?"]]
|
-detail [::msgcat::mc "Do you want to save it?"]]
|
||||||
switch $answer {
|
switch $answer {
|
||||||
yes Save
|
yes {Save close $nbEditorWindow}
|
||||||
no {}
|
no {}
|
||||||
cancel {return "cancel"}
|
cancel {return "cancel"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$nbEditor forget $nbItem
|
if {[$nbEditorWindow select] eq $nbItem} {
|
||||||
destroy $nbItem
|
$nbEditorWindow forget $nbItem
|
||||||
|
destroy $nbItem
|
||||||
|
}
|
||||||
set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]"
|
set treeItem "file::[string range $nbItem [expr [string last "." $nbItem] +1] end ]"
|
||||||
if [$tree exists $treeItem] {
|
if [$tree exists $treeItem] {
|
||||||
# delete all functions from tree item
|
# delete all functions from tree item
|
||||||
@@ -255,28 +345,36 @@ namespace eval FileOper {
|
|||||||
.frmStatus.lblPosition configure -text ""
|
.frmStatus.lblPosition configure -text ""
|
||||||
.frmStatus.lblEncoding configure -text ""
|
.frmStatus.lblEncoding configure -text ""
|
||||||
.frmStatus.lblSize configure -text ""
|
.frmStatus.lblSize configure -text ""
|
||||||
NB::NextTab $nbEditor 0
|
|
||||||
|
NB::NextTab $nbEditorWindow 0
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Save {} {
|
proc Save {{type ""} {nbEditorWindow ""}} {
|
||||||
global nbEditor tree env activeProject
|
global nbEditor tree env activeProject dir
|
||||||
|
|
||||||
if [info exists activeProject] {
|
if [info exists activeProject] {
|
||||||
set dir $activeProject
|
set dirProject $activeProject
|
||||||
} else {
|
} else {
|
||||||
set dir $env(HOME)
|
set dirProject $env(HOME)
|
||||||
}
|
}
|
||||||
|
|
||||||
set nbEditorItem [$nbEditor select]
|
if {$nbEditorWindow eq ""} {
|
||||||
# puts "Saved editor text: $nbEditorItem"
|
set nbEditorWindow $nbEditor
|
||||||
|
set str [split [focus] "."]
|
||||||
|
set nbEditorWindow "[lindex $str 0].[lindex $str 1].[lindex $str 2]"
|
||||||
|
# puts "FileOper::Save: current window $nbEditorWindow"
|
||||||
|
}
|
||||||
|
|
||||||
|
set nbEditorItem [$nbEditorWindow select]
|
||||||
|
DebugPuts "Saved editor text: $nbEditorItem"
|
||||||
if [string match "*untitled*" $nbEditorItem] {
|
if [string match "*untitled*" $nbEditorItem] {
|
||||||
set filePath [tk_getSaveFile -initialdir $dir -filetypes $::types -parent .]
|
set filePath [tk_getSaveFile -initialdir $dirProject -filetypes $::types -parent .]
|
||||||
if {$filePath eq ""} {
|
if {$filePath eq ""} {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
# set fileName [string range $filePath [expr [string last "/" $filePath]+1] end]
|
# set fileName [string range $filePath [expr [string last "/" $filePath]+1] end]
|
||||||
set fileName [file tail $filePath]
|
set fileName [file tail $filePath]
|
||||||
$nbEditor tab $nbEditorItem -text $fileName
|
$nbEditorWindow tab $nbEditorItem -text $fileName
|
||||||
# set treeitem [Tree::InsertItem $tree {} $filePath "file" $fileName]
|
# set treeitem [Tree::InsertItem $tree {} $filePath "file" $fileName]
|
||||||
set lblName "lbl[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end]"
|
set lblName "lbl[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end]"
|
||||||
$nbEditorItem.header.$lblName configure -text $filePath
|
$nbEditorItem.header.$lblName configure -text $filePath
|
||||||
@@ -284,12 +382,34 @@ namespace eval FileOper {
|
|||||||
set treeItem "file::[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end ]"
|
set treeItem "file::[string range $nbEditorItem [expr [string last "." $nbEditorItem] +1] end ]"
|
||||||
set filePath [Tree::GetItemID $tree $treeItem]
|
set filePath [Tree::GetItemID $tree $treeItem]
|
||||||
}
|
}
|
||||||
|
if {![winfo exists $nbEditorItem.frmText.t]} {
|
||||||
|
DebugPuts "winfo exists $nbEditorWindow.frmText.t equal [winfo exists $nbEditorWindow.frmText.t]"
|
||||||
|
return
|
||||||
|
}
|
||||||
set editedText [$nbEditorItem.frmText.t get 0.0 end]
|
set editedText [$nbEditorItem.frmText.t get 0.0 end]
|
||||||
|
if {$type eq "saveas"} {set filePath [FileOper::SaveDialog]}
|
||||||
|
if {$filePath eq "cancel"} {return}
|
||||||
|
DebugPuts "FileOper::Save $filePath"
|
||||||
set f [open $filePath "w+"]
|
set f [open $filePath "w+"]
|
||||||
puts -nonewline $f $editedText
|
puts -nonewline $f $editedText
|
||||||
# puts "$f was saved"
|
# puts "$f was saved"
|
||||||
close $f
|
close $f
|
||||||
ResetModifiedFlag $nbEditorItem $nbEditor
|
ResetModifiedFlag $nbEditorItem $nbEditorWindow
|
||||||
|
if {[file tail $filePath] eq "projman.ini"} {
|
||||||
|
Config::read $dir(cfg)
|
||||||
|
}
|
||||||
|
if {[file tail $filePath] eq "tools.ini"} {
|
||||||
|
Tools::Read $dir(cfg)
|
||||||
|
Tools::CheckVariables
|
||||||
|
Tools::GetMenu .popup.tools
|
||||||
|
Tools::GetMenu .frmMenu.mnuTools.m
|
||||||
|
}
|
||||||
|
if {[string match "*untitled*" $nbEditorItem] || $type eq "saveas"} {
|
||||||
|
FileOper::Close
|
||||||
|
if {$type ne "close"} {
|
||||||
|
FileOper::Edit $filePath
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
proc SaveAll {} {
|
proc SaveAll {} {
|
||||||
@@ -382,7 +502,7 @@ namespace eval FileOper {
|
|||||||
set txt $itemName.frmText.t
|
set txt $itemName.frmText.t
|
||||||
if ![string match "*untitled*" $itemName] {
|
if ![string match "*untitled*" $itemName] {
|
||||||
set file [open "$fileFullPath" r]
|
set file [open "$fileFullPath" r]
|
||||||
$txt insert end [chan read -nonewline $file]
|
$txt insert end [chan read -nonewline $file]
|
||||||
close $file
|
close $file
|
||||||
}
|
}
|
||||||
# Delete emty last line
|
# Delete emty last line
|
||||||
@@ -390,31 +510,61 @@ namespace eval FileOper {
|
|||||||
$txt delete {end-1 line} end
|
$txt delete {end-1 line} end
|
||||||
# puts ">[$txt get {end-1 line} end]<"
|
# puts ">[$txt get {end-1 line} end]<"
|
||||||
}
|
}
|
||||||
|
# ------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/7d5539ac2031fbdcb0f4a97465ff19d0c348cf33
|
||||||
|
$txt edit reset
|
||||||
|
# -----------
|
||||||
$txt see 1.0
|
$txt see 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
proc Edit {fileFullPath {nbEditor .frmWork.nbEditor}} {
|
proc Edit {fileFullPath {nbEditor .frmWork.nbEditor}} {
|
||||||
global tree
|
global tree
|
||||||
|
DebugPuts "$fileFullPath"
|
||||||
if {[file exists $fileFullPath] == 0} {
|
if {[file exists $fileFullPath] == 0} {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
# puts "$fileFullPath File type [::fileutil::magic::filetype $fileFullPath]"
|
# puts "$fileFullPath File type [::fileutil::magic::filetype $fileFullPath]"
|
||||||
set fileType [FileOper::GetFileMimeType $fileFullPath]
|
set fileType [FileOper::GetFileMimeType $fileFullPath]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# puts "$fileType <<<<<<<<<<<"
|
||||||
|
|
||||||
switch $fileType {
|
switch $fileType {
|
||||||
"text" {
|
"text" {
|
||||||
# return text
|
# return text
|
||||||
}
|
}
|
||||||
"image" {
|
"image" {
|
||||||
# return image
|
}
|
||||||
|
"binary" {
|
||||||
|
set answer [tk_messageBox -message [::msgcat::mc "The file looks like a binary file. Open anyway?"] \
|
||||||
|
-icon question -type yesno]
|
||||||
|
switch $answer {
|
||||||
|
yes {}
|
||||||
|
no {return}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
false {
|
false {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
# Проверяем размер файла и если он больше 1мб вывести предупреждение
|
||||||
|
# puts " File size = [file size $fileFullPath]"
|
||||||
|
if {[file size $fileFullPath] > 1000000} {
|
||||||
|
set answer [tk_messageBox -message [::msgcat::mc "The file size to big. Open anyway?"] \
|
||||||
|
-detail [GetFileAttr $fileFullPath "size"] \
|
||||||
|
-icon question -type yesno]
|
||||||
|
switch $answer {
|
||||||
|
yes {}
|
||||||
|
no {return}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
set filePath [file dirname $fileFullPath]
|
set filePath [file dirname $fileFullPath]
|
||||||
set fileName [file tail $fileFullPath]
|
set fileName [file tail $fileFullPath]
|
||||||
regsub -all {\.|/|\\|\s} $fileFullPath "_" itemName
|
|
||||||
|
regsub -all {\.|/|\\|\s|:} $fileFullPath "_" itemName
|
||||||
|
set itemName [string tolower $itemName]
|
||||||
set itemName "$nbEditor.$itemName"
|
set itemName "$nbEditor.$itemName"
|
||||||
set treeItemName [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
|
set treeItemName [Tree::InsertItem $tree {} $fileFullPath "file" $fileName]
|
||||||
|
|
||||||
@@ -423,6 +573,11 @@ namespace eval FileOper {
|
|||||||
|
|
||||||
if {[winfo exists $itemName] == 0} {
|
if {[winfo exists $itemName] == 0} {
|
||||||
NB::InsertItem $nbEditor $fileFullPath "file"
|
NB::InsertItem $nbEditor $fileFullPath "file"
|
||||||
|
if {$fileType eq "image"} {
|
||||||
|
ImageViewer $fileFullPath $itemName $itemName
|
||||||
|
return $itemName
|
||||||
|
}
|
||||||
|
|
||||||
Editor::Editor $fileFullPath $nbEditor $itemName
|
Editor::Editor $fileFullPath $nbEditor $itemName
|
||||||
ReadFile $fileFullPath $itemName
|
ReadFile $fileFullPath $itemName
|
||||||
$itemName.frmText.t highlight 1.0 end
|
$itemName.frmText.t highlight 1.0 end
|
||||||
@@ -430,6 +585,11 @@ namespace eval FileOper {
|
|||||||
$itemName.frmText.t see 1.1
|
$itemName.frmText.t see 1.1
|
||||||
}
|
}
|
||||||
$nbEditor select $itemName
|
$nbEditor select $itemName
|
||||||
|
focus -force $itemName
|
||||||
|
if {$fileType eq "image"} {
|
||||||
|
# ImageViewer $fileFullPath $itemName $itemName
|
||||||
|
return $itemName
|
||||||
|
}
|
||||||
Editor::ReadStructure $itemName.frmText.t $treeItemName
|
Editor::ReadStructure $itemName.frmText.t $treeItemName
|
||||||
GetVariablesFromFile $fileFullPath
|
GetVariablesFromFile $fileFullPath
|
||||||
$itemName.frmText.t.t mark set insert 1.0
|
$itemName.frmText.t.t mark set insert 1.0
|
||||||
@@ -437,6 +597,8 @@ namespace eval FileOper {
|
|||||||
focus -force $itemName.frmText.t.t
|
focus -force $itemName.frmText.t.t
|
||||||
.frmStatus.lblSize configure -text [GetFileAttr $fileFullPath "size"]
|
.frmStatus.lblSize configure -text [GetFileAttr $fileFullPath "size"]
|
||||||
.frmStatus.lblEncoding configure -text [GetFileMimeType $fileFullPath "charset"]
|
.frmStatus.lblEncoding configure -text [GetFileMimeType $fileFullPath "charset"]
|
||||||
|
# puts ">> $itemName"
|
||||||
|
|
||||||
return $itemName
|
return $itemName
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,5 +634,29 @@ namespace eval FileOper {
|
|||||||
# set selEnd [lindex [$txt tag ranges sel] 1]
|
# set selEnd [lindex [$txt tag ranges sel] 1]
|
||||||
# puts [$txt get [$txt tag ranges sel]]
|
# puts [$txt get [$txt tag ranges sel]]
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
proc SaveDialog {} {
|
||||||
|
global env project activeProject
|
||||||
|
if [info exists activeProject] {
|
||||||
|
set dir $activeProject
|
||||||
|
} else {
|
||||||
|
set dir $env(HOME)
|
||||||
|
}
|
||||||
|
set fileName [tk_getSaveFile -initialdir $dir -filetypes $::types -parent .]
|
||||||
|
if {$fileName eq ""} {return "cancel"}
|
||||||
|
set fullPath [file join $dir $fileName]
|
||||||
|
set file [string range $fullPath [expr [string last "/" $fullPath]+1] end]
|
||||||
|
DebugPuts "FileOper::SaveDialog $fileName $fullPath"
|
||||||
|
regsub -all "." $file "_" node
|
||||||
|
set dir [file dirname $fullPath]
|
||||||
|
set file [file tail $fullPath]
|
||||||
|
set name [file rootname $file]
|
||||||
|
set ext [string range [file extension $file] 1 end]
|
||||||
|
if {$fullPath != ""} {
|
||||||
|
# puts $fullPath
|
||||||
|
return $fullPath
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace eval Git {
|
|||||||
}
|
}
|
||||||
if {[catch {exec {*}$cmd} git_path]} {
|
if {[catch {exec {*}$cmd} git_path]} {
|
||||||
puts "Git не найден в системе"
|
puts "Git не найден в системе"
|
||||||
set cfgVariables(gitCommand) "Git not found"
|
set cfgVariables(gitCommand) ""
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set git_path [string trim $git_path]
|
set git_path [string trim $git_path]
|
||||||
|
|||||||
58
lib/gui.tcl
58
lib/gui.tcl
@@ -23,12 +23,14 @@ wm overrideredirect . 0
|
|||||||
|
|
||||||
bind . <Control-q> Quit
|
bind . <Control-q> Quit
|
||||||
bind . <Control-Q> Quit
|
bind . <Control-Q> Quit
|
||||||
|
bind . <Control-Cyrillic_shorti> Quit
|
||||||
bind . <Control-eacute> Quit
|
bind . <Control-eacute> Quit
|
||||||
bind . <Insert> Add
|
# bind . <Insert> Add
|
||||||
bind . <Delete> Del
|
# bind . <Delete> Del
|
||||||
bind . <F1> ShowHelpDialog
|
bind . <F1> ShowHelpDialog
|
||||||
bind . <Control-n> Editor::New
|
bind . <Control-n> Editor::New
|
||||||
bind . <Control-N> Editor::New
|
bind . <Control-N> Editor::New
|
||||||
|
bind . <Control-Cyrillic_te> Editor::New
|
||||||
bind . <Control-o> {
|
bind . <Control-o> {
|
||||||
set filePath [FileOper::OpenDialog]
|
set filePath [FileOper::OpenDialog]
|
||||||
if {$filePath != ""} {
|
if {$filePath != ""} {
|
||||||
@@ -41,21 +43,45 @@ bind . <Control-O> {
|
|||||||
FileOper::Edit $filePath
|
FileOper::Edit $filePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bind . <Control-k> {
|
bind . <Alt-k> {
|
||||||
set folderPath [FileOper::OpenFolderDialog]
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
if {$folderPath != ""} {
|
if {$folderPath != ""} {
|
||||||
FileOper::ReadFolder $folderPath
|
FileOper::ReadFolder $folderPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bind . <Control-K> {
|
bind . <Alt-K> {
|
||||||
set folderPath [FileOper::OpenFolderDialog]
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
if {$folderPath != ""} {
|
if {$folderPath != ""} {
|
||||||
FileOper::ReadFolder $folderPath
|
FileOper::ReadFolder $folderPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bind . <Alt-Cyrillic_el> {
|
||||||
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
|
if {$folderPath != ""} {
|
||||||
|
FileOper::ReadFolder $folderPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# -------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/22f6e235c3532c20573d44ee7eaaaa1fb56ad544
|
||||||
|
event add <<Copy>> <Control-Insert>
|
||||||
|
event add <<Paste>> <Shift-Insert>
|
||||||
|
event add <<Cut>> <Shift-Delete>
|
||||||
|
|
||||||
|
set latestTxtWidget {}
|
||||||
|
bind all <FocusIn> {
|
||||||
|
if {[winfo class %W] eq "Ctext"} {
|
||||||
|
global latestTxtWidget
|
||||||
|
set latestTxtWidget %W
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# ---------
|
||||||
bind . <Control-s> {FileOper::Save}
|
bind . <Control-s> {FileOper::Save}
|
||||||
bind . <Control-S> {FileOper::Save}
|
bind . <Control-S> {FileOper::Save}
|
||||||
|
bind . <Control-Cyrillic_hardsign> {FileOper::Save}
|
||||||
bind . <Alt-p> {ViewFilesTree true}
|
bind . <Alt-p> {ViewFilesTree true}
|
||||||
|
bind . <Alt-Cyrillic_ze> {ViewFilesTree true}
|
||||||
bind . <Button-3> {catch [PopupMenu %X %Y]}
|
bind . <Button-3> {catch [PopupMenu %X %Y]}
|
||||||
|
|
||||||
#ttk::style configure TPanedwindow -background blue
|
#ttk::style configure TPanedwindow -background blue
|
||||||
@@ -109,7 +135,11 @@ GetEditMenu [menu .frmMenu.mnuEdit.m]
|
|||||||
ttk::menubutton .frmMenu.mnuView -text [::msgcat::mc "View"] -menu .frmMenu.mnuView.m
|
ttk::menubutton .frmMenu.mnuView -text [::msgcat::mc "View"] -menu .frmMenu.mnuView.m
|
||||||
GetViewMenu [menu .frmMenu.mnuView.m]
|
GetViewMenu [menu .frmMenu.mnuView.m]
|
||||||
|
|
||||||
pack .frmMenu.mnuFile .frmMenu.mnuEdit .frmMenu.mnuView -side left
|
ttk::menubutton .frmMenu.mnuTools -text [::msgcat::mc "Tools"] -menu .frmMenu.mnuTools.m
|
||||||
|
Tools::GetMenu [menu .frmMenu.mnuTools.m]
|
||||||
|
|
||||||
|
|
||||||
|
pack .frmMenu.mnuFile .frmMenu.mnuEdit .frmMenu.mnuView .frmMenu.mnuTools -side left
|
||||||
|
|
||||||
ttk::menubutton .frmMenu.mnuHelp -text [::msgcat::mc "Help"] -menu .frmMenu.mnuHelp.m
|
ttk::menubutton .frmMenu.mnuHelp -text [::msgcat::mc "Help"] -menu .frmMenu.mnuHelp.m
|
||||||
GetHelpMenu [menu .frmMenu.mnuHelp.m]
|
GetHelpMenu [menu .frmMenu.mnuHelp.m]
|
||||||
@@ -117,9 +147,17 @@ pack .frmMenu.mnuHelp -side right
|
|||||||
|
|
||||||
# PopUP menu
|
# PopUP menu
|
||||||
menu .popup
|
menu .popup
|
||||||
GetFileMenu .popup
|
|
||||||
GetEditMenu .popup
|
GetEditMenu .popup
|
||||||
GetViewMenu .popup
|
.popup add separator
|
||||||
|
menu .popup.file
|
||||||
|
.popup add cascade -label [::msgcat::mc "File"] -menu .popup.file
|
||||||
|
GetFileMenu .popup.file
|
||||||
|
menu .popup.view
|
||||||
|
.popup add cascade -label [::msgcat::mc "View"] -menu .popup.view
|
||||||
|
GetViewMenu .popup.view
|
||||||
|
menu .popup.tools
|
||||||
|
.popup add cascade -label [::msgcat::mc "Tools"] -menu .popup.tools
|
||||||
|
Tools::GetMenu .popup.tools
|
||||||
|
|
||||||
set frmTool [ttk::frame .frmBody.frmTool]
|
set frmTool [ttk::frame .frmBody.frmTool]
|
||||||
ttk::panedwindow .frmBody.panel -orient horizontal -style TPanedwindow
|
ttk::panedwindow .frmBody.panel -orient horizontal -style TPanedwindow
|
||||||
@@ -134,11 +172,15 @@ grid .frmBody.panel -row 0 -column 1 -sticky nesw
|
|||||||
grid columnconfigure .frmBody .frmBody.panel -weight 1
|
grid columnconfigure .frmBody .frmBody.panel -weight 1
|
||||||
grid rowconfigure .frmBody .frmBody.panel -weight 1
|
grid rowconfigure .frmBody .frmBody.panel -weight 1
|
||||||
|
|
||||||
|
# Панель инстурментов
|
||||||
ttk::button $frmTool.btn_tree -command ToolBtnTreePress -image tree_24x24
|
ttk::button $frmTool.btn_tree -command ToolBtnTreePress -image tree_24x24
|
||||||
ttk::button $frmTool.btn_search -command FileOper::FindInFiles -image search_24x24
|
ttk::button $frmTool.btn_search -command FileOper::FindInFiles -image search_24x24
|
||||||
ttk::button $frmTool.btn_git -command Git::Dialog -image git_24x24
|
ttk::button $frmTool.btn_git -command Git::Dialog -image git_24x24
|
||||||
|
ttk::button $frmTool.btn_settings -command Settings -image settings_24x24
|
||||||
|
|
||||||
pack $frmTool.btn_tree $frmTool.btn_search $frmTool.btn_git -side top -padx 1 -pady 1
|
pack $frmTool.btn_tree $frmTool.btn_search $frmTool.btn_git -side top -padx 1 -pady 1
|
||||||
|
pack $frmTool.btn_settings -side bottom -padx 1 -pady 10
|
||||||
|
|
||||||
# #label $frmTool.lbl_logo -image tcl
|
# #label $frmTool.lbl_logo -image tcl
|
||||||
# pack $frmTool.btn_quit -side bottom -padx 5 -pady 5
|
# pack $frmTool.btn_quit -side bottom -padx 5 -pady 5
|
||||||
# #pack $frmTool.lbl_logo -side bottom -padx 5 -pady 5
|
# #pack $frmTool.lbl_logo -side bottom -padx 5 -pady 5
|
||||||
@@ -195,7 +237,7 @@ ttk::style layout TNotebook.Tab {
|
|||||||
}
|
}
|
||||||
bind TNotebook <Button-1> "catch {NB::PressTab %W %x %y}\;[bind TNotebook <Button-1>];break"
|
bind TNotebook <Button-1> "catch {NB::PressTab %W %x %y}\;[bind TNotebook <Button-1>];break"
|
||||||
# bind <<NotebookTabChanged>> "NB::PressTab %W %x %y"
|
# bind <<NotebookTabChanged>> "NB::PressTab %W %x %y"
|
||||||
bind TNotebook <ButtonRelease-1> "NB::PressTab %W %x %y"
|
# bind TNotebook <ButtonRelease-1> "NB::PressTab %W %x %y"
|
||||||
# bind TNotebook <Control-w> FileOper::Close
|
# bind TNotebook <Control-w> FileOper::Close
|
||||||
# bind . <Control-Tab> "NB::NextTab $nbEditor"
|
# bind . <Control-Tab> "NB::NextTab $nbEditor"
|
||||||
bind . <Control-Next> "NB::NextTab $nbEditor 1"
|
bind . <Control-Next> "NB::NextTab $nbEditor 1"
|
||||||
|
|||||||
339
lib/helper.tcl
Normal file
339
lib/helper.tcl
Normal file
@@ -0,0 +1,339 @@
|
|||||||
|
namespace eval Helper {
|
||||||
|
variable ::originalBindings {}
|
||||||
|
# Флаг, указывающий, что окно со списком активно
|
||||||
|
variable ::listActive 0
|
||||||
|
# Переменная для отслеживания предыдущего ввода (чтобы не обновлять список без необходимости)
|
||||||
|
variable ::previousInput ""
|
||||||
|
|
||||||
|
proc VarHelperKey { widget K A } {
|
||||||
|
set win .varhelper
|
||||||
|
DebugPuts "Helper::VarHelperKey: K=$K, A='$A'"
|
||||||
|
|
||||||
|
# Проверяем, существует ли окно списка
|
||||||
|
if {![winfo exists $win]} {
|
||||||
|
DebugPuts "Window doesn't exist, restoring bindings"
|
||||||
|
Helper::VarHelperBindingsRestore $widget
|
||||||
|
set ::listActive 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
switch -- $K {
|
||||||
|
<Up> {
|
||||||
|
DebugPuts "Processing Up arrow"
|
||||||
|
# Перемещаем выбор вверх
|
||||||
|
set current [$win.lBox curselection]
|
||||||
|
DebugPuts "Current selection: $current"
|
||||||
|
|
||||||
|
if {$current ne "" && $current > 0} {
|
||||||
|
$win.lBox selection clear 0 end
|
||||||
|
$win.lBox selection set [expr {$current - 1}]
|
||||||
|
$win.lBox activate [expr {$current - 1}]
|
||||||
|
$win.lBox see [expr {$current - 1}]
|
||||||
|
} elseif {[$win.lBox size] > 0} {
|
||||||
|
# Если ничего не выбрано, выбираем последний элемент
|
||||||
|
set last [expr {[$win.lBox size] - 1}]
|
||||||
|
$win.lBox selection clear 0 end
|
||||||
|
$win.lBox selection set $last
|
||||||
|
$win.lBox activate $last
|
||||||
|
$win.lBox see $last
|
||||||
|
}
|
||||||
|
return -code break
|
||||||
|
}
|
||||||
|
<Down> {
|
||||||
|
DebugPuts "Processing Down arrow"
|
||||||
|
# Перемещаем выбор вниз
|
||||||
|
set current [$win.lBox curselection]
|
||||||
|
set size [$win.lBox size]
|
||||||
|
DebugPuts "Current selection: $current, size: $size"
|
||||||
|
|
||||||
|
if {$current ne "" && $current < $size - 1} {
|
||||||
|
$win.lBox selection clear 0 end
|
||||||
|
$win.lBox selection set [expr {$current + 1}]
|
||||||
|
$win.lBox activate [expr {$current + 1}]
|
||||||
|
$win.lBox see [expr {$current + 1}]
|
||||||
|
} elseif {$size > 0} {
|
||||||
|
# Если ничего не выбрано, выбираем первый элемент
|
||||||
|
$win.lBox selection clear 0 end
|
||||||
|
$win.lBox selection set 0
|
||||||
|
$win.lBox activate 0
|
||||||
|
$win.lBox see 0
|
||||||
|
}
|
||||||
|
return -code break
|
||||||
|
}
|
||||||
|
<Return> {
|
||||||
|
DebugPuts "Processing Return"
|
||||||
|
Helper::SelectFromList $widget
|
||||||
|
return -code break
|
||||||
|
}
|
||||||
|
<Escape> {
|
||||||
|
DebugPuts "Processing Escape"
|
||||||
|
# Закрываем окно списка
|
||||||
|
wm withdraw $win
|
||||||
|
set ::listActive 0
|
||||||
|
Helper::VarHelperBindingsRestore $widget
|
||||||
|
set ::previousInput ""
|
||||||
|
focus $widget
|
||||||
|
return -code break
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
DebugPuts "Default case for K=$K, A='$A'"
|
||||||
|
# Для печатных символов
|
||||||
|
if {$A ne ""} {
|
||||||
|
DebugPuts "Inserting character '$A' and restoring bindings"
|
||||||
|
# Восстанавливаем привязки перед вставкой
|
||||||
|
Helper::VarHelperBindingsRestore $widget
|
||||||
|
# Вставляем символ
|
||||||
|
$widget insert "insert" $A
|
||||||
|
}
|
||||||
|
return -code break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc VarHelper {x y w word wordType} {
|
||||||
|
global editors lexers variables
|
||||||
|
variable txt
|
||||||
|
variable win
|
||||||
|
|
||||||
|
DebugPuts "=== VarHelper called: word='$word', wordType='$wordType' ==="
|
||||||
|
|
||||||
|
set txt $w
|
||||||
|
# Проверяем если есть выделение то блокировать появление диалога
|
||||||
|
if {[$txt tag ranges sel] != ""} {
|
||||||
|
DebugPuts "You have selected text [$txt tag ranges sel]"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
set fileType [dict get $editors $txt fileType]
|
||||||
|
|
||||||
|
if {[dict exists $editors $txt variableList] != 0} {
|
||||||
|
set varList [dict get $editors $txt variableList]
|
||||||
|
} else {
|
||||||
|
set varList {}
|
||||||
|
}
|
||||||
|
if {[dict exists $editors $txt procedureList] != 0} {
|
||||||
|
set procList [dict get $editors $txt procedureList]
|
||||||
|
} else {
|
||||||
|
set procList {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[dict exists $lexers $fileType commands] != 0} {
|
||||||
|
foreach i [dict get $lexers $fileType commands] {
|
||||||
|
lappend procList $i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set findedVars ""
|
||||||
|
switch -- $wordType {
|
||||||
|
vars {
|
||||||
|
foreach i [lsearch -nocase -all $varList $word*] {
|
||||||
|
set item [lindex [lindex $varList $i] 0]
|
||||||
|
if {[lsearch $findedVars $item] eq "-1"} {
|
||||||
|
lappend findedVars $item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
procedure {
|
||||||
|
foreach i [lsearch -nocase -all $procList $word*] {
|
||||||
|
set item [lindex [lindex $procList $i] 0]
|
||||||
|
if {[lsearch $findedVars $item] eq "-1"} {
|
||||||
|
lappend findedVars $item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
foreach i [lsearch -nocase -all $varList $word*] {
|
||||||
|
set item [lindex [lindex $varList $i] 0]
|
||||||
|
if {[lsearch $findedVars $item] eq "-1"} {
|
||||||
|
lappend findedVars $item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach i [lsearch -nocase -all $procList $word*] {
|
||||||
|
set item [lindex [lindex $procList $i] 0]
|
||||||
|
if {[lsearch $findedVars $item] eq "-1"} {
|
||||||
|
lappend findedVars $item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugPuts "Found [llength $findedVars] items: $findedVars"
|
||||||
|
|
||||||
|
if {$findedVars eq ""} {
|
||||||
|
DebugPuts "No items found, returning"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
VarHelperDialog $x $y $w $word $findedVars
|
||||||
|
}
|
||||||
|
|
||||||
|
proc VarHelperDialog {x y w word findedVars} {
|
||||||
|
variable txt
|
||||||
|
variable win
|
||||||
|
|
||||||
|
set txt $w
|
||||||
|
set win .varhelper
|
||||||
|
|
||||||
|
DebugPuts "VarHelperDialog called with [llength $findedVars] items"
|
||||||
|
|
||||||
|
# Если окно уже существует, уничтожаем его
|
||||||
|
if {[winfo exists $win]} {
|
||||||
|
DebugPuts "Window already exists, destroying it"
|
||||||
|
destroy $win
|
||||||
|
Helper::VarHelperBindingsRestore $txt
|
||||||
|
}
|
||||||
|
|
||||||
|
toplevel $win
|
||||||
|
wm transient $win .
|
||||||
|
wm overrideredirect $win 1
|
||||||
|
|
||||||
|
listbox $win.lBox -width 30 -border 0
|
||||||
|
pack $win.lBox -expand true -fill y -side left
|
||||||
|
|
||||||
|
foreach item $findedVars {
|
||||||
|
$win.lBox insert end $item
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugPuts "Listbox created with [llength $findedVars] items"
|
||||||
|
|
||||||
|
# Выбираем первый элемент
|
||||||
|
if {[llength $findedVars] > 0} {
|
||||||
|
$win.lBox selection set 0
|
||||||
|
$win.lBox activate 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[set height [llength $findedVars]] > 10} {
|
||||||
|
set height 10
|
||||||
|
}
|
||||||
|
$win.lBox configure -height $height
|
||||||
|
|
||||||
|
Helper::VarHelperBindingsSetup $w
|
||||||
|
|
||||||
|
# Привязка для закрытия окна списка
|
||||||
|
bind $win <Destroy> [list apply {{win txt} {
|
||||||
|
set ::listActive 0
|
||||||
|
Helper::VarHelperBindingsRestore $txt
|
||||||
|
set ::previousInput ""
|
||||||
|
}} $win $txt.t]
|
||||||
|
|
||||||
|
# Определяем расстояние до края экрана (основного окна) и если
|
||||||
|
# оно меньше размера окна со списком то сдвигаем его вверх
|
||||||
|
set winGeomY [winfo reqheight $win]
|
||||||
|
set winGeomX [winfo reqwidth $win]
|
||||||
|
|
||||||
|
set topHeight [winfo height .]
|
||||||
|
set topWidth [winfo width .]
|
||||||
|
set topLeftUpperX [winfo x .]
|
||||||
|
set topLeftUpperY [winfo y .]
|
||||||
|
set topRightLowerX [expr $topLeftUpperX + $topWidth]
|
||||||
|
set topRightLowerY [expr $topLeftUpperY + $topHeight]
|
||||||
|
|
||||||
|
if {[expr $x + $winGeomX] > $topRightLowerX} {
|
||||||
|
set x [expr $x - $winGeomX]
|
||||||
|
}
|
||||||
|
if {[expr $y + $winGeomY] > $topRightLowerY} {
|
||||||
|
set y [expr $y - $winGeomY]
|
||||||
|
}
|
||||||
|
set ::listActive 1
|
||||||
|
DebugPuts "Showing window at +$x+$y"
|
||||||
|
wm geom $win +$x+$y
|
||||||
|
}
|
||||||
|
|
||||||
|
proc VarHelperBindingsSetup {txt} {
|
||||||
|
DebugPuts "Setting up bindings for $txt"
|
||||||
|
|
||||||
|
# Сбрасываем сохраненные привязки
|
||||||
|
set ::originalBindings {}
|
||||||
|
|
||||||
|
# Список событий для перехвата
|
||||||
|
set events {<Up> <Down> <Return>}
|
||||||
|
|
||||||
|
# Сохраняем и заменяем привязки
|
||||||
|
foreach event $events {
|
||||||
|
# Получаем текущую привязку
|
||||||
|
set original [bind $txt $event]
|
||||||
|
DebugPuts " Saving binding for $event: '$original'"
|
||||||
|
|
||||||
|
# Сохраняем оригинал
|
||||||
|
lappend ::originalBindings [list $event $original]
|
||||||
|
|
||||||
|
# Устанавливаем новую привязку
|
||||||
|
bind $txt $event [list Helper::VarHelperKey $txt $event %A]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Восстановление оригинальных привязок
|
||||||
|
proc VarHelperBindingsRestore {txt} {
|
||||||
|
DebugPuts "Restoring bindings for $txt"
|
||||||
|
DebugPuts "Have [llength $::originalBindings] bindings to restore"
|
||||||
|
|
||||||
|
if {![info exists ::originalBindings]} {
|
||||||
|
DebugPuts " No original bindings stored"
|
||||||
|
# Очищаем наши привязки
|
||||||
|
foreach event {<Up> <Down> <Return>} {
|
||||||
|
bind $txt $event {}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
# Восстанавливаем оригинальные привязки
|
||||||
|
foreach binding $::originalBindings {
|
||||||
|
set event [lindex $binding 0]
|
||||||
|
set command [lindex $binding 1]
|
||||||
|
DebugPuts " Restoring $event: '$command'"
|
||||||
|
|
||||||
|
if {$command eq ""} {
|
||||||
|
bind $txt $event {}
|
||||||
|
} else {
|
||||||
|
bind $txt $event $command
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Очищаем сохраненные привязки
|
||||||
|
set ::originalBindings {}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc SelectFromList {txt} {
|
||||||
|
global returnProcessed editors lexers
|
||||||
|
set win .varhelper
|
||||||
|
# puts "[dict get $editors $txt fileType]"
|
||||||
|
# puts "[dict get $lexers [dict get $editors $txt fileType] variableSymbol]"
|
||||||
|
|
||||||
|
if {![winfo exists $win]} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set selected [$win.lBox curselection]
|
||||||
|
if {$selected ne ""} {
|
||||||
|
set text [string trim [$win.lBox get $selected]]
|
||||||
|
# DebugPuts "[dict exists $lexers [dict get $editors $txt fileType] variableSymbol]"
|
||||||
|
if [dict exists $lexers [dict get $editors $txt fileType] variableSymbol] {
|
||||||
|
set varSymbol [dict get $lexers [dict get $editors $txt fileType] variableSymbol]
|
||||||
|
} else {
|
||||||
|
set varSymbol ""
|
||||||
|
}
|
||||||
|
# Опеределяем что символ перед позицией вставки равен символу переменной из настроек lexers
|
||||||
|
# если равен то вставляем выбранное из списка сразу за ним
|
||||||
|
# если нет то удаляем введенный текст до этого символа и вставляем выбранное из списка
|
||||||
|
if {[$txt get "insert - 1 char" "insert"] eq $varSymbol} {
|
||||||
|
$txt insert "insert" $text
|
||||||
|
} else {
|
||||||
|
$txt delete "insert - 1 chars wordstart" "insert wordend - 1 chars"
|
||||||
|
$txt insert "insert" $text
|
||||||
|
}
|
||||||
|
# Закрываем окно
|
||||||
|
destroy $win
|
||||||
|
set ::listActive 0
|
||||||
|
Helper::VarHelperBindingsRestore $txt
|
||||||
|
set ::previousInput ""
|
||||||
|
|
||||||
|
# Устанавливаем флаг, что Return уже обработан
|
||||||
|
set returnProcessed 1
|
||||||
|
# after 10 {catch {unset returnProcessed}}
|
||||||
|
|
||||||
|
focus $txt.t
|
||||||
|
}
|
||||||
|
}
|
||||||
|
proc DebugPuts {msg} {
|
||||||
|
puts "DEBUG: $msg"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -190,5 +190,44 @@ namespace eval Highlight {} {
|
|||||||
ctext::addHighlightClassForRegexp $txt namespaces #0093ff {->|\+\+|::}
|
ctext::addHighlightClassForRegexp $txt namespaces #0093ff {->|\+\+|::}
|
||||||
ctext::addHighlightClass $txt bool #3e803b {null false true}
|
ctext::addHighlightClass $txt bool #3e803b {null false true}
|
||||||
}
|
}
|
||||||
|
proc ExecuteColorized {txt} {
|
||||||
|
# ctext::addHighlightClassForRegexp $txt flags orange {\s-[a-zA-Z]+}
|
||||||
|
# ctext::addHighlightClass $txt stackControl #19a2a6 [info commands]
|
||||||
|
# ctext::addHighlightClass $txt widgets #9d468d [list canvas ctext button entry label text labelframe frame toplevel scrollbar checkbutton canvas listbox menu menubar menubutton radiobutton scale entry message tk_chooseDir tk_getSaveFile tk_getOpenFile tk_chooseColor tk_optionMenu ttk::button ttk::checkbutton ttk::combobox ttk::entry ttk::frame ttk::intro ttk::label ttk::labelframe ttk::menubutton ttk::treeview ttk::notebook ttk::panedwindow ttk::progressbar ttk::radiobutton ttk::scale ttk::scrollbar ttk::separator ttk::sizegrip ttk::spinbox ]
|
||||||
|
# ctext::addHighlightClassWithOnlyCharStart $txt vars #4471ca "\$"
|
||||||
|
# ctext::addHighlightClass $txt variable_funcs gold {set global variable unset}
|
||||||
|
# # ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt namespaces #4f64ff {::}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).+("|'|`)}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt colors #68ceff {(#)(\w)+?(\s|$)}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt comments #666666 {(^|;)\s*(#)[^\n\r]*}
|
||||||
|
# ctext::addHighlightClass $txt bool #3e803b {null false true}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt paths lightblue {(\s)([\w]+)(=)}
|
||||||
|
# ctext::addHighlightClassForSpecialChars $txt tags lightgreen {<>/}
|
||||||
|
# ctext::addHighlightClassForRegexp $txt tags #199100 {/.+\s}
|
||||||
|
ctext::addHighlightClassForRegexp $txt gopaths lightblue {(.+?):(\d+):(\d+):}
|
||||||
|
ctext::addHighlightClassForRegexp $txt paths lightblue {(\\|/|\.|^)((\w)|(\.)|(/)|([\.\w]))+?\s}
|
||||||
|
ctext::addHighlightClass $txt compile_errors #ff5050 {error Error ERROR invalid undefined cannot}
|
||||||
|
ctext::addHighlightClassForRegexp $txt url lightblue {\w+://\w.+\w+}
|
||||||
|
}
|
||||||
|
proc C {txt} {
|
||||||
|
global lexers
|
||||||
|
ctext::addHighlightClassForRegexp $txt flags orange {-+[a-zA-Z\-_]+}
|
||||||
|
ctext::addHighlightClassForRegexp $txt arrows orange {(->)|(-<)}
|
||||||
|
ctext::addHighlightClass $txt stackControl #19a2a6 [dict get $lexers C commands]
|
||||||
|
ctext::addHighlightClass $txt types #7187d5 {string int int16 int32 int64 float bool byte size_t void char uint32_t uint32}
|
||||||
|
ctext::addHighlightClassWithOnlyCharStart $txt vars #4471ca "\&"
|
||||||
|
ctext::addHighlightClassWithOnlyCharStart $txt vars #4471ca "\*"
|
||||||
|
# ctext::addHighlightClassForRegexp $txt vars_extended #4471ca {\$\{[a-zA-Z0-9\_\-:\./\$\{\}]+\}}
|
||||||
|
ctext::addHighlightClass $txt variable_funcs gold {var type struct}
|
||||||
|
ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
|
||||||
|
ctext::addHighlightClassForRegexp $txt paths lightblue {\.[a-zA-Z0-9\_\-]+}
|
||||||
|
ctext::addHighlightClassForRegexp $txt comments #666666 {(//|/\*)[^\n\r]*}
|
||||||
|
ctext::addHighlightClassForSpecialChars $txt qoute #b84a0c {"'`}
|
||||||
|
ctext::addHighlightClass $txt bool #3e803b {nil false true NULL TRUE FALSE}
|
||||||
|
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}
|
||||||
|
ctext::addHighlightClassForRegexp $txt macros #f88ffb {#\w+}
|
||||||
|
ctext::addHighlightClassForRegexp $txt include #68ceff {<[\w./_-]+?>}
|
||||||
|
}
|
||||||
|
proc H {txt} {Highlight::C $txt}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1912,4 +1912,59 @@ image create photo j2_16x12 -data {
|
|||||||
waYDtkPwRhMJCQAAcy6XQBVVAwTH2sGQ25vNaAwYtjCvkcjhE5Ysd1Cwe/gmifh0nQMAwBvJ5H54
|
waYDtkPwRhMJCQAAcy6XQBVVAwTH2sGQ25vNaAwYtjCvkcjhE5Ysd1Cwe/gmifh0nQMAwBvJ5H54
|
||||||
5nEG7+28M9SARyoW37c7A72MxzFpr/Dd1sUKRxpZbJg7joMDAwDgDzlS9ta5m7mUAAAAAElFTkSu
|
5nEG7+28M9SARyoW37c7A72MxzFpr/Dd1sUKRxpZbJg7joMDAwDgDzlS9ta5m7mUAAAAAElFTkSu
|
||||||
QmCC
|
QmCC
|
||||||
}
|
}
|
||||||
|
image create photo execute_11x11 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9
|
||||||
|
kT1Iw1AUhU9TpVIqDnYQUclQneyiIo5ahSJUCLVCqw4mL/2DJg1Jiouj4Fpw8Gex6uDirKuDqyAI
|
||||||
|
/oC4C06KLlLifUmhRYwPLu/jvHcO990HCI0K06yuWUDTbTOdTIjZ3KoYekUYw1QjiMrMMuYkKQXf
|
||||||
|
9XWPAN/v4jzL/96fq1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx43qUHiR64rHr9xLros8Myo
|
||||||
|
mUnPE0eJxWIHKx3MSqZGPEUcUzWd8oWsxyrnLc5apcZaffIXRvL6yjLXqYaQxCKWIEGEghrKqMBG
|
||||||
|
nHadFAtpOk/4+Addv0QuhVxlMHIsoAoNsusH/4Pfs7UKkxNeUiQBdL84zscoENoFmnXH+T52nOYJ
|
||||||
|
EHwGrvS2v9oAZj5Jr7e12BHQtw1cXLc1ZQ+43AEGngzZlF0pSCUUCsD7GX1TDui/BcJr3txa5zh9
|
||||||
|
ADI0q9QNcHAIjBUpe93n3T2dc/v3Tmt+P5frcrXBnzRwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
|
||||||
|
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6QodCiMdxWTpZwAAABl0RVh0Q29tbWVudABDcmVhdGVk
|
||||||
|
IHdpdGggR0lNUFeBDhcAAABHSURBVBjTjY/BDQAwCAKNUzleux1b2Y+PxgiRJ7kjalYBkADSRLwX
|
||||||
|
SvCpZIKzlUlwdWMXJFw5Kzgi7mr5A/XyBI4wA9kzFHrskxvBNKQinAAAAABJRU5ErkJggg==
|
||||||
|
}
|
||||||
|
image create photo settings_24x24 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAABg2lDQ1BJQ0MgcHJvZmlsZQAAKJF9
|
||||||
|
kT1Iw1AUhU9TpVIqDnYQUclQneyiIo5ahSJUCLVCqw4mL/2DJg1Jiouj4Fpw8Gex6uDirKuDqyAI
|
||||||
|
/oC4C06KLlLifUmhRYwPLu/jvHcO990HCI0K06yuWUDTbTOdTIjZ3KoYekUYw1QjiMrMMuYkKQXf
|
||||||
|
9XWPAN/v4jzL/96fq1fNWwwIiMSzzDBt4g3i6U3b4LxPHGUlWSU+Jx43qUHiR64rHr9xLros8Myo
|
||||||
|
mUnPE0eJxWIHKx3MSqZGPEUcUzWd8oWsxyrnLc5apcZaffIXRvL6yjLXqYaQxCKWIEGEghrKqMBG
|
||||||
|
nHadFAtpOk/4+Addv0QuhVxlMHIsoAoNsusH/4Pfs7UKkxNeUiQBdL84zscoENoFmnXH+T52nOYJ
|
||||||
|
EHwGrvS2v9oAZj5Jr7e12BHQtw1cXLc1ZQ+43AEGngzZlF0pSCUUCsD7GX1TDui/BcJr3txa5zh9
|
||||||
|
ADI0q9QNcHAIjBUpe93n3T2dc/v3Tmt+P5frcrXBnzRwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
|
||||||
|
WXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH6QodESQY6jzHvgAAABl0RVh0Q29tbWVudABDcmVhdGVk
|
||||||
|
IHdpdGggR0lNUFeBDhcAAAHySURBVEjHrZZPSFVREMZ/iomaBm1SApFHIEoL+6e7ROHTFkEbaWNb
|
||||||
|
95YgSFiLyECIoJXtIkEXZqSrIoYwQiEScVOCguQylCzKpyFBm3PjvcO5f8L3wV3cufPNnHNmvjO3
|
||||||
|
jAwws06gxTN/lTSfxq0gGx4BFz3bAVCdRizPmOBswFZlZg1HTmBm9UBVzOczafwyL9groAGYAJ4D
|
||||||
|
bcDDwPFE+AKMADPAdWAAaATOSfpdlMDM+oDZAvJPoC7jEf4CagveRySN/0tgZtXAKtBMabAH5CRt
|
||||||
|
RzUYyhj80D1pOA48KCzyQArhE9AlqVJSJXAeeJvC6TezY1GCXmAtxnEd6JD0LjJIWnWchRjOFtAj
|
||||||
|
6bDcETaAS8DLgPNdSXnfKOkPMBzw/wC0S1oq0oEL8jpAWIw7A0nLAfOypO3/UfKJBBGG+AdBJZtZ
|
||||||
|
DhgMEK4mJL8WsN0ws8tFSnYimwRqAoQfQJukLW/1jcB7oClmF7ckPYkSbAK5hJXmXV9HNWoH7gCn
|
||||||
|
U9R9KrquR4GpBOca4L57smJM0n7UptNuu6XCOvDY76KbntMC8C1DsDzwxrPdlrTv62AFuOeu6lZJ
|
||||||
|
3W5MPksIPgdckHTF1XAMeCrpRXAexPT6yYSddEj6eKSJJmk3IcFGqWby51AbSvpeqr+KPjcKC7GT
|
||||||
|
hfgXbteIc85F7RUAAAAASUVORK5CYII=
|
||||||
|
}
|
||||||
|
image create photo c_16x12 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAAXNSR0IB2cksfwAAAARnQU1BAACx
|
||||||
|
jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dE
|
||||||
|
APgAjwD7QQHXygAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+oCBg8YOxzsqLgAAABWSURB
|
||||||
|
VCjPY2AgATDCGFeLi/+jS2r39jJiKIYp1O7tZUDSjKGBCYdtyCbCbWTB5T6oiShOYyHWT7icgRPg
|
||||||
|
VHy1uPg/eggRY/J/YsMZRR0jLlNweZI2AAAzbhnP2WkKCAAAAABJRU5ErkJggg==
|
||||||
|
}
|
||||||
|
image create photo h_16x12 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAAXNSR0IB2cksfwAAAARnQU1BAACx
|
||||||
|
jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dE
|
||||||
|
AAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+oCBg8iNd79W8YAAABJSURB
|
||||||
|
VCjPY2AgB1wtLv5/tbj4Pz41TKQYSJJiRmRnYFOg3dvLSLTJyIawYDEJWSGM+Z+BgYGRCY/zGOkX
|
||||||
|
GkwMFID/UExIjDAAAEu2FECKwea9AAAAAElFTkSuQmCC
|
||||||
|
}
|
||||||
|
image create photo cpp_16x12 -data {
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAMAAABIK2QJAAAAAXNSR0IB2cksfwAAAARnQU1BAACx
|
||||||
|
jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAA9QTFRF
|
||||||
|
AAAAzAAAAAAA////////6rs+vwAAAAF0Uk5TAEDm2GYAAAABYktHRACIBR1IAAAACXBIWXMAAAsT
|
||||||
|
AAALEwEAmpwYAAAAB3RJTUUH6gIGDxU21/OqSAAAADVJREFUCNd9jUEOACAIw7D7/58VmNF4sAco
|
||||||
|
CbCIm5FsBTwsd+kmgVQu87p3OLfg/9AJJPFhAjDkAJmwKBolAAAAAElFTkSuQmCC
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
proc ImageViewer {f w node} {
|
proc ImageViewer {f w node} {
|
||||||
|
global factor cfgVariables
|
||||||
set factor($node) 1.0
|
set factor($node) 1.0
|
||||||
ttk::frame $w.f
|
ttk::frame $w.f
|
||||||
pack $w.f -side left -fill both -expand true
|
pack $w.f -side left -fill both -expand true
|
||||||
canvas $w.f.c -xscrollcommand "$w.f.x set" -yscrollcommand "$w.y set"
|
canvas $w.f.c -xscrollcommand "$w.f.x set" -yscrollcommand "$w.y set" -bg $cfgVariables(backGround)
|
||||||
ttk::scrollbar $w.f.x -ori hori -command "$w.f.c xview"
|
ttk::scrollbar $w.f.x -ori hori -command "$w.f.c xview"
|
||||||
ttk::scrollbar $w.y -ori vert -command "$w.f.c yview"
|
ttk::scrollbar $w.y -ori vert -command "$w.f.c yview"
|
||||||
|
|
||||||
@@ -18,17 +19,17 @@ proc ImageViewer {f w node} {
|
|||||||
#$w.scrwin setwidget $w.scrwin.f
|
#$w.scrwin setwidget $w.scrwin.f
|
||||||
openImg $f $w.f.c $node
|
openImg $f $w.f.c $node
|
||||||
}
|
}
|
||||||
|
|
||||||
proc openImg {fn w node} {
|
proc openImg {fn w node} {
|
||||||
global im1
|
global im1 factor
|
||||||
set im1 [image create photo -file $fn]
|
set im1 [image create photo -file $fn]
|
||||||
#scale $w
|
scale $w $factor($node) $node
|
||||||
list [file size $fn] bytes, [image width $im1]x[image height $im1]
|
list [file size $fn] bytes, [image width $im1]x[image height $im1]
|
||||||
$w create image 1 1 -image $im1 -anchor nw -tag img
|
$w create image 1 1 -image $im1 -anchor nw -tag img
|
||||||
}
|
}
|
||||||
|
|
||||||
proc scale {w {n 1} node} {
|
proc scale {w {n 1} node} {
|
||||||
global im1 im2 factor noteBook tab_label
|
global im1 im2 factor tab_label
|
||||||
set factor($node) [expr {$factor($node) * $n}]
|
set factor($node) [expr {$factor($node) * $n}]
|
||||||
$w delete img
|
$w delete img
|
||||||
catch {image delete $im2}
|
catch {image delete $im2}
|
||||||
@@ -41,7 +42,8 @@ proc scale {w {n 1} node} {
|
|||||||
$im2 copy $im1 -subsample $f $f
|
$im2 copy $im1 -subsample $f $f
|
||||||
}
|
}
|
||||||
$w create image 1 1 -image $im2 -anchor nw -tag img
|
$w create image 1 1 -image $im2 -anchor nw -tag img
|
||||||
$noteBook itemconfigure $node -text "$tab_label (size x$factor($node))"
|
set noteBook [file extension $node]
|
||||||
|
# $noteBook itemconfigure $node -text "(size x$factor($node))"
|
||||||
$w config -scrollregion [$w bbox all]
|
$w config -scrollregion [$w bbox all]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +54,7 @@ proc ImageBase64Encode {text} {
|
|||||||
{"GIF" {.gif}}
|
{"GIF" {.gif}}
|
||||||
{"JPEG" {.jpg}}
|
{"JPEG" {.jpg}}
|
||||||
{"BMP" {.bmp}}
|
{"BMP" {.bmp}}
|
||||||
|
{"SVG" {.svg}}
|
||||||
{"All files" *}
|
{"All files" *}
|
||||||
}
|
}
|
||||||
set img [tk_getOpenFile -initialdir $env(HOME) -filetypes $types -parent .]
|
set img [tk_getOpenFile -initialdir $env(HOME) -filetypes $types -parent .]
|
||||||
@@ -65,5 +68,3 @@ proc ImageBase64Encode {text} {
|
|||||||
$text insert [Position] "image create photo $name -data {\n$data\n}"
|
$text insert [Position] "image create photo $name -data {\n$data\n}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -104,5 +104,29 @@ dict set lexers LUA procFindString {function\s*?PROCNAME}
|
|||||||
dict set lexers LUA procRegexpCommand {regexp -nocase -all -- {^(local|)\s*?(function)\s([a-zA-Z0-9\-_:]+?)\s+\((.+?)\)} $line match v1 keyWord procName params}
|
dict set lexers LUA procRegexpCommand {regexp -nocase -all -- {^(local|)\s*?(function)\s([a-zA-Z0-9\-_:]+?)\s+\((.+?)\)} $line match v1 keyWord procName params}
|
||||||
dict set lexers LUA varRegexpCommand {regexp -nocase -all -- {^(\s*?)([a-zA-Z0-9\-_\.]+)\s+=\s+(.+?)(\s*$|--)} $line match indent varName varValue lineEnd}
|
dict set lexers LUA varRegexpCommand {regexp -nocase -all -- {^(\s*?)([a-zA-Z0-9\-_\.]+)\s+=\s+(.+?)(\s*$|--)} $line match indent varName varValue lineEnd}
|
||||||
|
|
||||||
|
#--------------------------------------------------
|
||||||
|
# C
|
||||||
|
dict set lexers C commentSymbol {//}
|
||||||
|
dict set lexers C commentMultilineSymbolBegin {/*}
|
||||||
|
dict set lexers C commentMultilineSymbolEnd {*/}
|
||||||
|
dict set lexers C procFindString {(\w+)\s+(PROCNAME)\s*\((.*?)(,|\))(\W|$)}
|
||||||
|
dict set lexers C procRegexpCommand {regexp -nocase -all -line -- {^(?:(\w+)\s+)+(\*\w+|\w+)\s*\((.*?)(,|\))} $line match returns procName params v4}
|
||||||
|
# dict set lexers C procRegexpCommand {regexp -nocase -all -- {\s*?func\s*?(\(\w+\s*?\**?\w+\)|)\s*?(\w+)\((.*?)\)\s+?([a-zA-Z0-9\{\}\[\]\(\)-_.]*?|)\s*?\{} $line match linkName procName params returns}
|
||||||
|
# dict set lexers C varRegexpCommand {regexp -nocase -all -line -- {^\s*?var\s+([a-zA-Z0-9\-_$]+)\s+(.+?)(\s*$)} $line match varName varType lineEnd}
|
||||||
|
dict set lexers C varRegexpCommand {regexp -nocase -all -line -- {^\s*(\w+\s+)+(?:[*\s]+)?(\w+)\s*[=;,\[]} $line match varType varName}
|
||||||
|
dict set lexers C commands {auto break case const continue default do else enum extern for goto if inline int long register restrict return signed sizeof static struct switch typedef typeof typeof_unqual union unsigned void volatile while}
|
||||||
|
|
||||||
|
#--------------------------------------------------
|
||||||
|
# H
|
||||||
|
dict set lexers H commentSymbol {//}
|
||||||
|
dict set lexers H commentMultilineSymbolBegin {/*}
|
||||||
|
dict set lexers H commentMultilineSymbolEnd {*/}
|
||||||
|
# dict set lexers C procFindString {^\s*(?:(\w+)\s+)+(PROCNAME)\s*\((.*?)(,|\))}
|
||||||
|
dict set lexers H procFindString {^\s*(?:(\w+)\s+)+(PROCNAME)\s*\((.*?)(,|\))}
|
||||||
|
dict set lexers H procRegexpCommand {regexp -nocase -all -line -- {^(?:(\w+)\s+)+(\*\w+|\w+)\s*\((.*?)(,|\))} $line match returns procName params v4}
|
||||||
|
# dict set lexers C procRegexpCommand {regexp -nocase -all -- {\s*?func\s*?(\(\w+\s*?\**?\w+\)|)\s*?(\w+)\((.*?)\)\s+?([a-zA-Z0-9\{\}\[\]\(\)-_.]*?|)\s*?\{} $line match linkName procName params returns}
|
||||||
|
dict set lexers C varRegexpCommand {regexp -nocase -all -line -- {^\s*(\w+\s+)+(?:[*\s]+)?(\w+)\s*[=;,\[]} $line match varType varName}
|
||||||
|
dict set lexers H commands {auto break case const continue default do else enum extern for goto if inline int long register restrict return signed sizeof static struct switch typedef typeof typeof_unqual union unsigned void volatile while}
|
||||||
|
|
||||||
# -------------------------------------------------
|
# -------------------------------------------------
|
||||||
dict set lexers ALL varDirectory {variables vars group_vars host_vars defaults}
|
dict set lexers ALL varDirectory {variables vars group_vars host_vars defaults}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ proc GetFileMenu {m} {
|
|||||||
}
|
}
|
||||||
$m add command -label [::msgcat::mc "Save file"] -command {FileOper::Save}\
|
$m add command -label [::msgcat::mc "Save file"] -command {FileOper::Save}\
|
||||||
-accelerator "Ctrl+S"
|
-accelerator "Ctrl+S"
|
||||||
|
$m add command -label [::msgcat::mc "Save as"] -command {FileOper::Save saveas}
|
||||||
$m add command -label [::msgcat::mc "Close file"] -command {FileOper::Close}\
|
$m add command -label [::msgcat::mc "Close file"] -command {FileOper::Close}\
|
||||||
-accelerator "Ctrl+w"
|
-accelerator "Ctrl+w"
|
||||||
$m add command -label [::msgcat::mc "Close all"] -command {FileOper::CloseAll}
|
$m add command -label [::msgcat::mc "Close all"] -command {FileOper::CloseAll}
|
||||||
@@ -33,7 +34,7 @@ proc GetFileMenu {m} {
|
|||||||
|
|
||||||
$m add separator
|
$m add separator
|
||||||
|
|
||||||
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Ctrl+K" -command {
|
$m add command -label [::msgcat::mc "Open folder"] -accelerator "Alt+K" -command {
|
||||||
set folderPath [FileOper::OpenFolderDialog]
|
set folderPath [FileOper::OpenFolderDialog]
|
||||||
if {$folderPath != ""} {
|
if {$folderPath != ""} {
|
||||||
# set activeProject $folderPath
|
# set activeProject $folderPath
|
||||||
@@ -76,7 +77,8 @@ proc GetEditMenu {m} {
|
|||||||
$m add separator
|
$m add separator
|
||||||
$m add command -label [::msgcat::mc "Insert image"] -accelerator "Ctrl+I"\
|
$m add command -label [::msgcat::mc "Insert image"] -accelerator "Ctrl+I"\
|
||||||
-command ImageBase64Encode
|
-command ImageBase64Encode
|
||||||
|
$m add separator
|
||||||
|
$m add command -label [::msgcat::mc "Settings"] -command Settings
|
||||||
}
|
}
|
||||||
|
|
||||||
proc GetViewMenu {m} {
|
proc GetViewMenu {m} {
|
||||||
|
|||||||
@@ -59,12 +59,16 @@
|
|||||||
::msgcat::mcset en "Editor font bold"
|
::msgcat::mcset en "Editor font bold"
|
||||||
::msgcat::mcset en "Error open URL"
|
::msgcat::mcset en "Error open URL"
|
||||||
::msgcat::mcset en "Editor settings"
|
::msgcat::mcset en "Editor settings"
|
||||||
|
::msgcat::mcset en "Enter command for execute file"
|
||||||
::msgcat::mcset en "Exit"
|
::msgcat::mcset en "Exit"
|
||||||
::msgcat::mcset en "File"
|
::msgcat::mcset en "File"
|
||||||
::msgcat::mcset en "File already exists. Overwrite?"
|
::msgcat::mcset en "File already exists. Overwrite?"
|
||||||
::msgcat::mcset en "File modify"
|
::msgcat::mcset en "File modify"
|
||||||
::msgcat::mcset en "File was modifyed. Close?"
|
::msgcat::mcset en "File was modifyed. Close?"
|
||||||
::msgcat::mcset en "File was modifyed. Save?"
|
::msgcat::mcset en "File was modifyed. Save?"
|
||||||
|
::msgcat::mcset en "The file looks like a binary file. Open anyway?"
|
||||||
|
::msgcat::mcset en "The file looks like a image. Support not implemented yet."
|
||||||
|
::msgcat::mcset en "The file size to big. Open anyway?"
|
||||||
::msgcat::mcset en "File saved"
|
::msgcat::mcset en "File saved"
|
||||||
::msgcat::mcset en "Files"
|
::msgcat::mcset en "Files"
|
||||||
::msgcat::mcset en "Find"
|
::msgcat::mcset en "Find"
|
||||||
@@ -170,6 +174,7 @@
|
|||||||
::msgcat::mcset en "Title normal"
|
::msgcat::mcset en "Title normal"
|
||||||
::msgcat::mcset en "Title modify"
|
::msgcat::mcset en "Title modify"
|
||||||
::msgcat::mcset en "Toolbar"
|
::msgcat::mcset en "Toolbar"
|
||||||
|
::msgcat::mcset en "Tools"
|
||||||
::msgcat::mcset en "Undo"
|
::msgcat::mcset en "Undo"
|
||||||
::msgcat::mcset en "Update"
|
::msgcat::mcset en "Update"
|
||||||
::msgcat::mcset en "Variables"
|
::msgcat::mcset en "Variables"
|
||||||
@@ -181,7 +186,3 @@
|
|||||||
::msgcat::mcset en "Work dir"
|
::msgcat::mcset en "Work dir"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
::msgcat::mcset ru "Editor settings" "Настройки редактора"
|
::msgcat::mcset ru "Editor settings" "Настройки редактора"
|
||||||
::msgcat::mcset ru "Editor helpers" "Подсказки при вводе"
|
::msgcat::mcset ru "Editor helpers" "Подсказки при вводе"
|
||||||
::msgcat::mcset ru "Encode" "Перекодировка"
|
::msgcat::mcset ru "Encode" "Перекодировка"
|
||||||
|
::msgcat::mcset ru "Enter command for execute file" "Введите команду для запуска текущего файла"
|
||||||
::msgcat::mcset ru "Authorisation required" "Требуется авторизация"
|
::msgcat::mcset ru "Authorisation required" "Требуется авторизация"
|
||||||
::msgcat::mcset ru "Error open URL" "Ошибка открытия URL"
|
::msgcat::mcset ru "Error open URL" "Ошибка открытия URL"
|
||||||
::msgcat::mcset ru "Exit" "Выход"
|
::msgcat::mcset ru "Exit" "Выход"
|
||||||
@@ -88,6 +89,9 @@
|
|||||||
::msgcat::mcset ru "File was modifyed" "Файл был изменен"
|
::msgcat::mcset ru "File was modifyed" "Файл был изменен"
|
||||||
::msgcat::mcset ru "File modify" "Файл изменен"
|
::msgcat::mcset ru "File modify" "Файл изменен"
|
||||||
::msgcat::mcset ru "File saved" "Файл сохранен"
|
::msgcat::mcset ru "File saved" "Файл сохранен"
|
||||||
|
::msgcat::mcset ru "The file looks like a binary file. Open anyway?" "Файл похож на двоичный. Открыть все равно?"
|
||||||
|
::msgcat::mcset ru "The file looks like a image. Support not implemented yet." "Файл выглядит как изображение. Поддержка пока не реализована."
|
||||||
|
::msgcat::mcset ru "The file size to big. Open anyway?" "Файл большого размера. Открыть все равно?"
|
||||||
::msgcat::mcset ru "Find" "Найти"
|
::msgcat::mcset ru "Find" "Найти"
|
||||||
::msgcat::mcset ru "Found" "Найдено"
|
::msgcat::mcset ru "Found" "Найдено"
|
||||||
::msgcat::mcset ru "Find in files" "Найти в файлах"
|
::msgcat::mcset ru "Find in files" "Найти в файлах"
|
||||||
@@ -196,7 +200,7 @@
|
|||||||
::msgcat::mcset ru "Select directory" "Выбор директории"
|
::msgcat::mcset ru "Select directory" "Выбор директории"
|
||||||
::msgcat::mcset ru "Selected directory" "Директория"
|
::msgcat::mcset ru "Selected directory" "Директория"
|
||||||
::msgcat::mcset ru "Selection color" "Цвет выделения"
|
::msgcat::mcset ru "Selection color" "Цвет выделения"
|
||||||
::msgcat::mcset ru "Settings" "Установки"
|
::msgcat::mcset ru "Settings" "Настройки"
|
||||||
::msgcat::mcset ru "Statusbar" "Строка статуса"
|
::msgcat::mcset ru "Statusbar" "Строка статуса"
|
||||||
::msgcat::mcset ru "Show backup files" "Показывать временные файлы"
|
::msgcat::mcset ru "Show backup files" "Показывать временные файлы"
|
||||||
::msgcat::mcset ru "Show the Menu" "Показывать меню"
|
::msgcat::mcset ru "Show the Menu" "Показывать меню"
|
||||||
@@ -210,6 +214,7 @@
|
|||||||
::msgcat::mcset ru "Title normal" "Файл нормальный"
|
::msgcat::mcset ru "Title normal" "Файл нормальный"
|
||||||
::msgcat::mcset ru "Title modify" "Файл изменен"
|
::msgcat::mcset ru "Title modify" "Файл изменен"
|
||||||
::msgcat::mcset ru "Toolbar" "Панель инструментов"
|
::msgcat::mcset ru "Toolbar" "Панель инструментов"
|
||||||
|
::msgcat::mcset ru "Tools" "Инструменты"
|
||||||
::msgcat::mcset ru "User name" "Имя пользователя"
|
::msgcat::mcset ru "User name" "Имя пользователя"
|
||||||
::msgcat::mcset ru "Undo" "Отменить"
|
::msgcat::mcset ru "Undo" "Отменить"
|
||||||
::msgcat::mcset ru "Update" "Обновить"
|
::msgcat::mcset ru "Update" "Обновить"
|
||||||
|
|||||||
@@ -13,13 +13,16 @@ namespace eval NB {
|
|||||||
proc InsertItem {nb item type} {
|
proc InsertItem {nb item type} {
|
||||||
switch $type {
|
switch $type {
|
||||||
file {
|
file {
|
||||||
regsub -all {\.|/|\\|\s} $item "_" itemName
|
set titleFileName [file tail $item]
|
||||||
|
set item [string tolower $item]
|
||||||
|
regsub -all {\.|/|\\|\s|:} $item "_" itemName
|
||||||
|
# puts "$item -> $itemName"
|
||||||
if [winfo exists $nb.$itemName] {
|
if [winfo exists $nb.$itemName] {
|
||||||
set fm $nb.$itemName
|
set fm $nb.$itemName
|
||||||
} else {
|
} else {
|
||||||
set fm [ttk::frame $nb.$itemName]
|
set fm [ttk::frame $nb.$itemName]
|
||||||
pack $fm -side top -expand true -fill both
|
pack $fm -side top -expand true -fill both
|
||||||
$nb add $fm -text [file tail $item];# -image close_12x12 -compound right
|
$nb add $fm -text $titleFileName;# -image close_12x12 -compound right
|
||||||
$nb select $fm
|
$nb select $fm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,7 +33,7 @@ namespace eval NB {
|
|||||||
set fm [ttk::frame $nb.$item]
|
set fm [ttk::frame $nb.$item]
|
||||||
pack $fm -side top -expand true -fill both
|
pack $fm -side top -expand true -fill both
|
||||||
$nb add $fm -text Git;# -image close_12x12 -compound right
|
$nb add $fm -text Git;# -image close_12x12 -compound right
|
||||||
$nb select $fm
|
$nb select $fm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# puts "NB item - $fm"
|
# puts "NB item - $fm"
|
||||||
@@ -49,11 +52,16 @@ namespace eval NB {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if {[$w identify $x $y] == "close_button"} {
|
if {[$w identify $x $y] == "close_button"} {
|
||||||
FileOper::Close
|
# puts "NB::PressTab: w - $w"
|
||||||
|
FileOper::Close $w
|
||||||
} else {
|
} else {
|
||||||
set txt [$w select].frmText.t
|
set txt [$w select].frmText.t
|
||||||
if [winfo exists $txt] {
|
if {[winfo exists [$w select].frmText2] == 1} {
|
||||||
focus -force $txt.t
|
focus -force [$w select].frmText2.frame.text.t
|
||||||
|
} else {
|
||||||
|
if [winfo exists $txt] {
|
||||||
|
focus -force $txt.t
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +69,12 @@ namespace eval NB {
|
|||||||
proc NextTab {w step} {
|
proc NextTab {w step} {
|
||||||
global tree
|
global tree
|
||||||
set i [expr [$w index end] - 1]
|
set i [expr [$w index end] - 1]
|
||||||
|
# puts "NB::NextTab $w"
|
||||||
if {[$w select] eq ""} {
|
if {[$w select] eq ""} {
|
||||||
|
# puts "NB::NextTab no items availabels"
|
||||||
|
if {$w eq ".frmWork.nbEditor2"} {
|
||||||
|
.frmWork.panelNB forget .frmWork.nbEditor2
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set nbItemIndex [$w index [$w select]]
|
set nbItemIndex [$w index [$w select]]
|
||||||
@@ -73,13 +86,17 @@ namespace eval NB {
|
|||||||
$w select [expr $nbItemIndex + $step]
|
$w select [expr $nbItemIndex + $step]
|
||||||
}
|
}
|
||||||
set nbItem [string trimleft [$w select] "$w."]
|
set nbItem [string trimleft [$w select] "$w."]
|
||||||
# puts $nbItem
|
|
||||||
append treeItemName "file" "::" $nbItem
|
append treeItemName "file" "::" $nbItem
|
||||||
Tree::SelectItem $treeItemName
|
Tree::SelectItem $treeItemName
|
||||||
|
|
||||||
set txt [$w select].frmText.t
|
set txt [$w select].frmText.t
|
||||||
if [winfo exists $txt] {
|
DebugPuts "NextTab: [$w select]"
|
||||||
focus -force $txt.t
|
if {[winfo exists [$w select].frmText2] == 1} {
|
||||||
|
focus -force [$w select].frmText2.frame.text.t
|
||||||
|
} else {
|
||||||
|
if [winfo exists $txt] {
|
||||||
|
focus -force $txt.t
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,9 +195,19 @@ proc ResetModifiedFlag {w nbEditor} {
|
|||||||
# puts "ResetModifiedFlag: $lbl"
|
# puts "ResetModifiedFlag: $lbl"
|
||||||
$nbEditor tab $w -text $lbl
|
$nbEditor tab $w -text $lbl
|
||||||
}
|
}
|
||||||
proc SetModifiedFlag {w nbEditor} {
|
proc SetModifiedFlag {w nbEditor flag} {
|
||||||
global modified
|
global modified
|
||||||
#$w.frmText.t edit modified false
|
# ------------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/04e5c892ae06d3e013472d292cd4435804184f6b
|
||||||
|
if {$flag eq "force"} {
|
||||||
|
$w.frmText.t edit modified true
|
||||||
|
} else {
|
||||||
|
if {![$w.frmText.t edit modified]} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# ---------
|
||||||
set modified($w) "true"
|
set modified($w) "true"
|
||||||
set lbl [$nbEditor tab $w -text]
|
set lbl [$nbEditor tab $w -text]
|
||||||
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
|
# puts "SetModifiedFlag: $w; $modified($w); >$lbl<"
|
||||||
@@ -254,11 +264,13 @@ proc FindImage {ext} {
|
|||||||
|
|
||||||
namespace eval Help {
|
namespace eval Help {
|
||||||
proc About {} {
|
proc About {} {
|
||||||
global projman
|
global projman tcl_version tk_version
|
||||||
set msg "Tcl/Tk project Manager\n\n"
|
set msg "Tcl/Tk project Manager\n\n"
|
||||||
append msg "Version: " $projman(Version) "\n" \
|
append msg "Version: " $projman(Version) "\n" \
|
||||||
"Release: " $projman(Release) "\n" \
|
"Release: " $projman(Release) "\n" \
|
||||||
"Build: " $projman(Build) "\n\n" \
|
"Build: " $projman(Build) "\n" \
|
||||||
|
"Tcl Version: " $tcl_version "\n" \
|
||||||
|
"Tk Version: " $tk_version "\n\n" \
|
||||||
"Author: " $projman(Author) "\n" \
|
"Author: " $projman(Author) "\n" \
|
||||||
"Home page: " $projman(Homepage)
|
"Home page: " $projman(Homepage)
|
||||||
# foreach name [array names projman] {
|
# foreach name [array names projman] {
|
||||||
@@ -714,3 +726,451 @@ proc AddRecentEditedFolder {path} {
|
|||||||
}
|
}
|
||||||
.frmMenu.mnuFile.m.openRecent add command -label $path -command [list OpenRecentProject $path]
|
.frmMenu.mnuFile.m.openRecent add command -label $path -command [list OpenRecentProject $path]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ================== OLD ====================
|
||||||
|
proc launchBrowser {url} {
|
||||||
|
global tcl_platform
|
||||||
|
if {$tcl_platform(platform) eq "windows"} {
|
||||||
|
set command [list {*}[auto_execok start] {}]
|
||||||
|
if {[file isdirectory $url]} {
|
||||||
|
set url [file nativename [file join $url .]]
|
||||||
|
}
|
||||||
|
} elseif {$tcl_platform(os) eq "Darwin"} {
|
||||||
|
set command [list open]
|
||||||
|
} else {
|
||||||
|
set command [list xdg-open]
|
||||||
|
}
|
||||||
|
exec {*}$command $url &
|
||||||
|
}
|
||||||
|
## EXEC EXTERNAL BROWSER AND GOTO URL ##
|
||||||
|
proc GoToURL {url} {
|
||||||
|
global env tcl_platform
|
||||||
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
|
set pipe [open "|iexplore $url" "r"]
|
||||||
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
|
set pipe [open "|iexplore $url" "r"]
|
||||||
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
|
#$env(BROWSER)
|
||||||
|
#set pipe [open "|$env(BROWSER) $url" "r"]
|
||||||
|
launchBrowser $url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fileevent $pipe readable
|
||||||
|
fconfigure $pipe -buffering none -blocking no
|
||||||
|
}
|
||||||
|
## MAKING TAR ARCHIVE ##
|
||||||
|
proc MakeTGZ {} {
|
||||||
|
global activeProject tgzDir tgzNamed workDir projDir env tcl_platform
|
||||||
|
if {$activeProject == ""} {
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message [::msgcat::mc "Not found active project"]\
|
||||||
|
-type ok -icon warning\
|
||||||
|
-title [::msgcat::mc "Warning"]]
|
||||||
|
case $answer {
|
||||||
|
ok {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FileDialog tree save_all
|
||||||
|
set file [open [file join $workDir $activeProject.proj] r]
|
||||||
|
while {[gets $file line]>=0} {
|
||||||
|
scan $line "%s" keyWord
|
||||||
|
set string [string range $line [string first "\"" $line] [string last "\"" $line]]
|
||||||
|
set string [string trim $string "\""]
|
||||||
|
if {$keyWord == "ProjectDirName"} {
|
||||||
|
set dir "$string"
|
||||||
|
}
|
||||||
|
if {$keyWord == "ProjectVersion"} {
|
||||||
|
set version "$string"
|
||||||
|
}
|
||||||
|
if {$keyWord == "ProjectRelease"} {
|
||||||
|
set release "$string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close $file
|
||||||
|
set res [split $tgzNamed "-"]
|
||||||
|
set name [lindex $res 0]
|
||||||
|
set ver [lindex $res 1]
|
||||||
|
set rel [lindex $res 2]
|
||||||
|
if {$name == "projectName"} {
|
||||||
|
set name $activeProject
|
||||||
|
}
|
||||||
|
if {$ver == "version"} {
|
||||||
|
append name "-$version"
|
||||||
|
}
|
||||||
|
if {$rel == "release"} {
|
||||||
|
append name "-$release"
|
||||||
|
}
|
||||||
|
# multiplatform featuring #
|
||||||
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
|
append name ".zip"
|
||||||
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
|
append name ".zip"
|
||||||
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
|
append name ".tar.gz"
|
||||||
|
}
|
||||||
|
catch {cd $projDir} res
|
||||||
|
if {[file exists [file join $tgzDir $name]] == 1} {
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message "[::msgcat::mc "File already exists. Overwrite?"] \"$name\" ?"\
|
||||||
|
-type yesno -icon question -default yes\
|
||||||
|
-title [::msgcat::mc "Question"]]
|
||||||
|
case $answer {
|
||||||
|
yes {file delete [file join $tgzDir $name]}
|
||||||
|
no {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# multiplatform featuring #
|
||||||
|
if {$tcl_platform(platform) == "windows"} {
|
||||||
|
catch [exec pkzip -r -p [file join $tgzDir $name] [file join $activeProject *]] err
|
||||||
|
} elseif {$tcl_platform(platform) == "mac"} {
|
||||||
|
catch [exec zip -c [file join $tgzDir $name] $activeProject] err
|
||||||
|
} elseif {$tcl_platform(platform) == "unix"} {
|
||||||
|
catch [exec tar -czvf [file join $tgzDir $name] $activeProject] err
|
||||||
|
}
|
||||||
|
# message dialog #
|
||||||
|
set msg "[::msgcat::mc "Archive created in"] [file join $tgzDir $name]"
|
||||||
|
set icon info
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message "$msg"\
|
||||||
|
-type ok -icon $icon]
|
||||||
|
case $answer {
|
||||||
|
ok {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Процедура для проверки, находится ли редактирование в последней строке
|
||||||
|
proc IsLastLine {widget} {
|
||||||
|
set current_line [lindex [split [$widget index insert] .] 0]
|
||||||
|
set last_line [lindex [split [$widget index end-1c] .] 0]
|
||||||
|
return [expr {$current_line == $last_line}]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Процедура для проверки выделения в последней строке
|
||||||
|
proc IsSelectionInLastLine {widget} {
|
||||||
|
if {![$widget tag ranges sel]} {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
set last_line [lindex [split [$widget index end-1c] .] 0]
|
||||||
|
set sel_start_line [lindex [split [$widget index sel.first] .] 0]
|
||||||
|
set sel_end_line [lindex [split [$widget index sel.last] .] 0]
|
||||||
|
|
||||||
|
return [expr {$sel_start_line == $last_line && $sel_end_line == $last_line}]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Процедура-обертка для проверки последней строки
|
||||||
|
proc CheckLastLineAndRun {txt w filePath} {
|
||||||
|
# Проверяем, находится ли курсор в последней строке
|
||||||
|
set current_line [lindex [split [$txt index insert] .] 0]
|
||||||
|
set last_line [lindex [split [$txt index end-1c] .] 0]
|
||||||
|
|
||||||
|
if {$current_line == $last_line} {
|
||||||
|
# Разрешаем выполнение в последней строке
|
||||||
|
$txt insert insert "\n"
|
||||||
|
Run $w $filePath
|
||||||
|
} else {
|
||||||
|
# Запрещаем в других строках
|
||||||
|
bell
|
||||||
|
$txt mark set insert end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## MAKE PROJ PROCEDURE (RUNNING PROJECT) ##
|
||||||
|
proc Execute {filePath w activeEditor} {
|
||||||
|
global activeProject cfgVariables
|
||||||
|
if {$activeProject == ""} {
|
||||||
|
set answer [tk_messageBox\
|
||||||
|
-message "[::msgcat::mc "Not found active project"]"\
|
||||||
|
-type ok -icon warning\
|
||||||
|
-title [::msgcat::mc "Warning"]]
|
||||||
|
case $answer {
|
||||||
|
ok {return 0}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FileOper::Save
|
||||||
|
set file $filePath
|
||||||
|
set action run
|
||||||
|
# create array with file names #
|
||||||
|
frame $w.frame -borderwidth 2 -relief ridge -background $cfgVariables(backGround)
|
||||||
|
pack $w.frame -side top -fill both -expand true
|
||||||
|
|
||||||
|
set txt $w.frame.text
|
||||||
|
ctext $txt -yscrollcommand "$w.frame.yscroll set" -linemap 0 \
|
||||||
|
-bg $cfgVariables(backGround) -fg $cfgVariables(foreground) \
|
||||||
|
-relief sunken -wrap word -highlightthickness 0 -font $cfgVariables(font) \
|
||||||
|
-selectborderwidth 0 -selectbackground $cfgVariables(selectbg) -width 10 -height 10
|
||||||
|
|
||||||
|
scrollbar $w.frame.yscroll -relief sunken -borderwidth {1} -width {10} -takefocus 0 \
|
||||||
|
-command "$txt yview" -background $cfgVariables(backGround)
|
||||||
|
Highlight::ExecuteColorized $txt
|
||||||
|
|
||||||
|
pack $txt -side left -fill both -expand true
|
||||||
|
pack $w.frame.yscroll -side left -fill y
|
||||||
|
|
||||||
|
bind $txt <Return> [list Run $w $filePath]
|
||||||
|
bind $txt <Control-r> [list CloseExecuteDialog $w $activeEditor]
|
||||||
|
bind $txt <Control-Cyrillic_er> [list CloseExecuteDialog $w $activeEditor]
|
||||||
|
# focus -force $w.frmBtn.btnOk
|
||||||
|
# $noteBook raise $node
|
||||||
|
# insert debug data into text widget #
|
||||||
|
$txt tag configure bold -font $cfgVariables(fontBold)
|
||||||
|
$txt tag configure error -font $cfgVariables(fontBold) -foreground red
|
||||||
|
$txt tag add bold 0.0 0.end
|
||||||
|
|
||||||
|
$txt insert end "[::msgcat::mc "Enter command for execute file"] $filePath >\n"
|
||||||
|
set pos [$w.frame.text index insert]
|
||||||
|
set lineNum [lindex [split $pos "."] 0]
|
||||||
|
$w.frame.text insert 0.0 "======================================================================================\n"
|
||||||
|
|
||||||
|
# Added executor from config
|
||||||
|
set fileType [string toupper [string trimleft [file extension $filePath] "."]]
|
||||||
|
if {[info exists cfgVariables($fileType)] != 0 && $cfgVariables($fileType) ne ""} {
|
||||||
|
$w.frame.text insert end "$cfgVariables($fileType) %f"
|
||||||
|
}
|
||||||
|
unset fileType
|
||||||
|
# $w.frame.text insert end [string toupper [string trimleft [file extension $filePath] "."]]
|
||||||
|
# $w.frame.text insert end cfgVariables($fileType)
|
||||||
|
|
||||||
|
$w.frame.text tag add bold $lineNum.0 $lineNum.end
|
||||||
|
Highlight::ExecuteColorized $w.frame.text
|
||||||
|
|
||||||
|
# focus -force $w.frame.text
|
||||||
|
|
||||||
|
# Привязки событий для защиты от редактирования
|
||||||
|
# bind $txt <KeyPress> {
|
||||||
|
# if {![IsLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# bind $txt <KeyPress-Return> {
|
||||||
|
# # Разрешаем Enter только в последней строке
|
||||||
|
# if {![IsLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# } else {
|
||||||
|
# list Run $w $filePath
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# bind $txt <KeyPress-Return> [list CheckLastLineAndRun $txt $w $filePath]
|
||||||
|
#
|
||||||
|
# bind $txt <BackSpace> {
|
||||||
|
# if {[%W tag ranges sel] ne ""} {
|
||||||
|
# if {![IsSelectionInLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# } else {
|
||||||
|
# if {![IsLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# bind $txt <Delete> {
|
||||||
|
# if {[%W tag ranges sel] ne ""} {
|
||||||
|
# if {![IsSelectionInLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# } else {
|
||||||
|
# if {![IsLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# # Защита от вставки
|
||||||
|
# bind $txt <<Paste>> {
|
||||||
|
# if {[%W tag ranges sel] ne ""} {
|
||||||
|
# if {![IsSelectionInLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# } else {
|
||||||
|
# if {![IsLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
# # Защита от вырезания
|
||||||
|
# bind $txt <<Cut>> {
|
||||||
|
# if {[%W tag ranges sel] ne ""} {
|
||||||
|
# if {![IsSelectionInLastLine %W]} {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# } else {
|
||||||
|
# break
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
|
focus -force $w.frame.text.t
|
||||||
|
}
|
||||||
|
|
||||||
|
proc CloseExecuteDialog {w activeEditor} {
|
||||||
|
destroy $w
|
||||||
|
focus $activeEditor.frmText.t.t
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Run {w filePath} {
|
||||||
|
# Получаем индекс конца последней строки
|
||||||
|
set endIndex [$w.frame.text index "end-1c"]; # или "end-1l lineend"
|
||||||
|
|
||||||
|
# Получаем индекс начала последней строки
|
||||||
|
set startIndex [$w.frame.text index "end-1l linestart"]
|
||||||
|
|
||||||
|
set command [$w.frame.text get $startIndex $endIndex end]
|
||||||
|
# Заменяем знак %f на имя текущего файла
|
||||||
|
regsub -all "%f" $command "$filePath" fullCommand
|
||||||
|
$w.frame.text replace $startIndex $endIndex $fullCommand
|
||||||
|
|
||||||
|
# $w.frame.text insert "end-4l linestart"
|
||||||
|
cd [file dirname $filePath]
|
||||||
|
set pipe [open "|$fullCommand 2> [file join [file dirname $filePath] errors]" "r"]
|
||||||
|
set f [open [file join [file dirname $filePath] errors] "r"]
|
||||||
|
set processPID [pid $pipe]
|
||||||
|
|
||||||
|
bind $w.frame.text <Control-c> [list SendSignal $processPID "SIGINT"]
|
||||||
|
bind $w.frame.text <Control-z> [list SendSignal $processPID "SIGTSTP"]
|
||||||
|
bind $w.frame.text <Control-d> [list SendSignal $processPID "SIGKILL"]
|
||||||
|
|
||||||
|
# set pipe [open "|$command $filePath" "r"]
|
||||||
|
# set f [open [file join ~ tmp errors] "r"]
|
||||||
|
fileevent $pipe readable [list DebugInfo $w.frame.text $pipe $f]
|
||||||
|
fconfigure $pipe -buffering none -blocking no
|
||||||
|
}
|
||||||
|
|
||||||
|
## INSERT DEBUG INFORMATION INTO TEXT WIDGET ##
|
||||||
|
proc DebugInfo {widget file f} {
|
||||||
|
$widget configure -state normal
|
||||||
|
if {[eof $file]} {
|
||||||
|
catch [close $file] msg
|
||||||
|
if {$msg != ""} {
|
||||||
|
puts $msg
|
||||||
|
$widget insert "end-4l linestart" "[::msgcat::mc "Program failed"]: $msg\n";
|
||||||
|
} else {
|
||||||
|
# Highlight::ExecuteColorized $widget
|
||||||
|
puts $msg
|
||||||
|
$widget see "end-1l lineend"
|
||||||
|
$widget delete "end-1l lineend" end
|
||||||
|
# $widget insert end "\n-------------------------------------------------\n"
|
||||||
|
# $widget insert end "[::msgcat::mc "Program finished successfully"]\n"
|
||||||
|
}
|
||||||
|
Highlight::ExecuteColorized $widget
|
||||||
|
# close $f
|
||||||
|
} else {
|
||||||
|
# Highlight::ExecuteColorized $widget
|
||||||
|
$widget insert "end-4l linestart" "[read $file]"
|
||||||
|
}
|
||||||
|
while {[gets $f line]>=0} {
|
||||||
|
Highlight::ExecuteColorized $widget
|
||||||
|
$widget insert "end-4l linestart" "$line\n"
|
||||||
|
# puts $line
|
||||||
|
}
|
||||||
|
# close $f
|
||||||
|
$widget see end
|
||||||
|
$widget tag add error 0.0 0.end
|
||||||
|
# $widget configure -state disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
# Функция для отправки сигнала процессу
|
||||||
|
proc SendSignal {pid signal} {
|
||||||
|
global tcl_platform
|
||||||
|
|
||||||
|
if {$tcl_platform(platform) eq "unix"} {
|
||||||
|
# На Unix-системах
|
||||||
|
switch -- $signal {
|
||||||
|
"SIGINT" {catch {exec kill -INT $pid}} ; # Ctrl+C
|
||||||
|
"SIGTERM" {catch {exec kill -TERM $pid}} ; # Завершение
|
||||||
|
"SIGTSTP" {catch {exec kill -TSTP $pid}} ; # Ctrl+Z (приостановка)
|
||||||
|
"SIGKILL" {catch {exec kill -KILL $pid}} ; # Принудительное завершение
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# На Windows
|
||||||
|
switch -- $signal {
|
||||||
|
"SIGINT" - "SIGTERM" {
|
||||||
|
# Используем taskkill для завершения
|
||||||
|
catch {exec taskkill /PID $pid /T}
|
||||||
|
}
|
||||||
|
"SIGKILL" {
|
||||||
|
# Принудительное завершение на Windows
|
||||||
|
catch {exec taskkill /PID $pid /T /F}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Правка файла настроек
|
||||||
|
proc Settings {} {
|
||||||
|
global dir
|
||||||
|
|
||||||
|
FileOper::Edit [file join $dir(cfg) projman.ini]
|
||||||
|
# Config::read $dir(cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Определяем пути до программ для запуска исходников
|
||||||
|
proc ExecutorCommandPathSetting {fileType} {
|
||||||
|
global cfgVariables tcl_platform
|
||||||
|
# puts $cfgVariables($fileType)
|
||||||
|
if {[info exists cfgVariables($fileType)] == 1 && $cfgVariables($fileType) ne ""} {
|
||||||
|
if {$tcl_platform(platform) eq "windows"} {
|
||||||
|
set cmd "where $cfgVariables($fileType)"
|
||||||
|
} else {
|
||||||
|
set cmd "which $cfgVariables($fileType)"
|
||||||
|
}
|
||||||
|
DebugPuts "ExecutorCommandPathSetting $fileType"
|
||||||
|
DebugPuts [catch {exec {*}$cmd} executor_path]
|
||||||
|
DebugPuts "executor_path $executor_path"
|
||||||
|
if {[catch {exec {*}$cmd} executor_path]} {
|
||||||
|
DebugPuts "Программа $cfgVariables($fileType) для выполнения файлов $fileType не найдена в системе"
|
||||||
|
set cfgVariables($fileType) ""
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set full_path [string trim $executor_path]
|
||||||
|
set first_path [lindex [split $executor_path "\n"] 0]
|
||||||
|
|
||||||
|
# puts "Git найден: $first_path"
|
||||||
|
set cfgVariables($fileType) $first_path
|
||||||
|
DebugPuts "first_path $first_path"
|
||||||
|
}
|
||||||
|
if {[info exists cfgVariables($fileType)] == 0} {
|
||||||
|
set cfgVariables($fileType) ""
|
||||||
|
DebugPuts $cfgVariables($fileType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# -----------
|
||||||
|
# Thanks https://github.com/wandrien/
|
||||||
|
# https://github.com/wandrien/projman/commit/22f6e235c3532c20573d44ee7eaaaa1fb56ad544
|
||||||
|
proc SendEventToLatestTxtWidget {ev} {
|
||||||
|
global latestTxtWidget
|
||||||
|
if {$latestTxtWidget eq ""} {
|
||||||
|
return
|
||||||
|
} elseif {[winfo exists $latestTxtWidget] && [winfo class $latestTxtWidget] eq "Ctext"} {
|
||||||
|
event generate ${latestTxtWidget}.t $ev
|
||||||
|
} else {
|
||||||
|
set latestTxtWidget ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Cut {} { SendEventToLatestTxtWidget <<Cut>> }
|
||||||
|
proc Copy {} { SendEventToLatestTxtWidget <<Copy>> }
|
||||||
|
proc Paste {} { SendEventToLatestTxtWidget <<Paste>> }
|
||||||
|
proc Undo {} { SendEventToLatestTxtWidget <<Undo>> }
|
||||||
|
proc Redo {} { SendEventToLatestTxtWidget <<Redo>> }
|
||||||
|
# ------------
|
||||||
|
|
||||||
|
proc DebugPuts {msg} {
|
||||||
|
global cfgVariables
|
||||||
|
if ![info exists cfgVariables(debug)] {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if ![info exists cfgVariables(debugOut)] {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if {$cfgVariables(debug) eq "true"} {
|
||||||
|
if {$cfgVariables(debugOut) eq "stdout"} {
|
||||||
|
puts "$msg"
|
||||||
|
} elseif {$cfgVariables(debugOut) ne "" } {
|
||||||
|
set logFile [open $cfgVariables(debugOut) "a+"]
|
||||||
|
puts $logFile $::configDefault
|
||||||
|
close $logFile
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
220
lib/tools.tcl
Normal file
220
lib/tools.tcl
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
##################################################################
|
||||||
|
# tools.tcl - this file implements the logic of working
|
||||||
|
# with external tools.
|
||||||
|
##################################################################
|
||||||
|
# svk, 01/2026
|
||||||
|
##################################################################
|
||||||
|
|
||||||
|
namespace eval Tools {} {
|
||||||
|
variable toolsINISections
|
||||||
|
variable toolsVariables
|
||||||
|
}
|
||||||
|
|
||||||
|
set ::toolsDefault "\[VisualRegexp\]
|
||||||
|
commandString=tkregexp \"%s\"
|
||||||
|
description=A graphical front-end to write/debug regular expression
|
||||||
|
icon=
|
||||||
|
shortCut=
|
||||||
|
\[TkDIFF\]
|
||||||
|
commandString=tkdiff %f %f
|
||||||
|
description=TkDiff is a Tcl/Tk front-end to diff
|
||||||
|
icon=
|
||||||
|
shortCut=
|
||||||
|
"
|
||||||
|
# Создание файла настроек внешних инструментов
|
||||||
|
proc Tools::Create {dir} {
|
||||||
|
set toolsFile [open [file join $dir tools.ini] "w+"]
|
||||||
|
puts $toolsFile $::toolsDefault
|
||||||
|
close $toolsFile
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Tools::Read {dir} {
|
||||||
|
set ::toolsVariables ""
|
||||||
|
set toolsFile [ini::open [file join $dir tools.ini] "r"]
|
||||||
|
foreach section [ini::sections $toolsFile] {
|
||||||
|
foreach key [ini::keys $toolsFile $section] {
|
||||||
|
lappend ::toolsINIsections($section) $key
|
||||||
|
dict set ::toolsVariables $section $key [ini::value $toolsFile $section $key]
|
||||||
|
DebugPuts "Tools::Read: $toolsFile $section $key = [ini::value $toolsFile $section $key]"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ini::close $toolsFile
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Tools::Write {dir} {
|
||||||
|
set toolsFile [ini::open [file join $dir tools.ini] "w"]
|
||||||
|
foreach section [array names ::toolsINIsections] {
|
||||||
|
dict for {key value} [dict get $::toolsVariables $section] {
|
||||||
|
DebugPuts "Tools::write: $section $key = $value"
|
||||||
|
# ini::set $toolsFile $section $key [dict get $::toolsVariables $section $key]
|
||||||
|
ini::set $toolsFile $section $key $value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ini::commit $toolsFile
|
||||||
|
ini::close $toolsFile
|
||||||
|
}
|
||||||
|
|
||||||
|
# Добавление перменной в список
|
||||||
|
# если отсутствует нужная секция то она будет добавлена.
|
||||||
|
proc Tools::AddVariable {key value section} {
|
||||||
|
# Проверяем, существует ли уже такая переменная
|
||||||
|
if {[info exists ::toolsVariables($key)]} {
|
||||||
|
DebugPuts "The variable '$key' already exists: "
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
# Добавляем в массив переменных
|
||||||
|
# set ::toolsVariables($key) $value
|
||||||
|
dict set ::toolsVariables $section $key $value
|
||||||
|
# Добавляем в список ключей секции
|
||||||
|
if {[dict exists $::toolsVariables $key]} {
|
||||||
|
# Проверяем, нет ли уже такого ключа в секции
|
||||||
|
if {[lsearch -exact $::toolsINIsections($section) $key] == -1} {
|
||||||
|
lappend ::toolsINIsections($section) $key
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
set ::toolsINIsections($section) [list $key]
|
||||||
|
}
|
||||||
|
DebugPuts "Tools::AddVariable: The variable '$key' has been added to the '$section' array 'toolsVariables' with value '$value'"
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Проверяем наличие переменных в tools.ini на основе "эталонного" списка
|
||||||
|
# и выставляем значение по умолчанию если в конфиге переменной нет
|
||||||
|
proc Tools::CheckVariables {} {
|
||||||
|
set valList [split $::toolsDefault "\n"]
|
||||||
|
foreach item $valList {
|
||||||
|
if {[regexp -nocase -all -- {\[(\w+)\]} $item -> v1]} {
|
||||||
|
set section $v1
|
||||||
|
}
|
||||||
|
if {[regexp {^([^=]+)=(.*)$} $item -> key value]} {
|
||||||
|
# puts "$section $key $value >> [dict get $::toolsVariables $section $key]"
|
||||||
|
# if {[dict get $::toolsVariables $section $key] eq ""}
|
||||||
|
if ![dict exists $::toolsVariables $section $key] {
|
||||||
|
DebugPuts "Error in Tools::CheckVariables: variable $section $key not found"
|
||||||
|
Tools::AddVariable "$key" "$value" "$section"
|
||||||
|
# DebugPuts "Tools::CheckVariables: The variable toolsVariables $key setting to default value \"$value\""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach id [dict keys $::toolsVariables] {
|
||||||
|
DebugPuts "Tools::CheckVariables: config parameters for $id [dict get $::toolsVariables $id]!"
|
||||||
|
}
|
||||||
|
# DebugPuts "toolsVariables dict keys: [dict keys $::toolsVariables]"
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Tools::GetMenu {m} {
|
||||||
|
global cfgVariables toolsVariables
|
||||||
|
set count [$m index end]
|
||||||
|
if {$count != "none"} {
|
||||||
|
for {set i $count} {$i >= 0} {incr i -1} {
|
||||||
|
$m delete $i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach toolName [dict keys $toolsVariables] {
|
||||||
|
dict for {key value} [dict get $toolsVariables $toolName] {
|
||||||
|
DebugPuts "GetToolsMenu $key $value"
|
||||||
|
if {$key eq "commandString"} {
|
||||||
|
set cmd "$value"
|
||||||
|
}
|
||||||
|
if {$key eq "shortCut"} {
|
||||||
|
set shortCut "$value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if {[info exists cmd] == 1 && $cmd ne ""} {
|
||||||
|
if {[info exists shortCut] == 1 && $shortCut ne ""} {
|
||||||
|
$m add command -label $toolName -accelerator $shortCut -command [list Tools::Execute "$toolName"]
|
||||||
|
bind . <$shortCut> "[list Tools::Execute "$toolName"]; break"
|
||||||
|
} else {
|
||||||
|
$m add command -label $toolName -command [list Tools::Execute "$toolName"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$m add separator
|
||||||
|
$m add command -label "[::msgcat::mc "Settings"]" -command Tools::Settings
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Tools::CommandPathSettings {command} {
|
||||||
|
global tcl_platform
|
||||||
|
if [file exists $command] {return $command}
|
||||||
|
|
||||||
|
if {$tcl_platform(platform) eq "windows"} {
|
||||||
|
set cmd "where $command)"
|
||||||
|
} else {
|
||||||
|
set cmd "which $command"
|
||||||
|
}
|
||||||
|
DebugPuts [catch {exec {*}$cmd} toolsPath]
|
||||||
|
DebugPuts "executor_path $toolsPath"
|
||||||
|
if {[catch {exec {*}$cmd} toolsPath]} {
|
||||||
|
DebugPuts "Tools::CommandPathSettings: Программа $command не найдена в системе"
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
set fullPath [string trim $toolsPath]
|
||||||
|
set firstPath [lindex [split $toolsPath "\n"] 0]
|
||||||
|
|
||||||
|
DebugPuts "Tools::CommandPathSettings: executable path $fullPath"
|
||||||
|
return $fullPath
|
||||||
|
}
|
||||||
|
|
||||||
|
proc Tools::Execute {toolName} {
|
||||||
|
global cfgVariables toolsVariables tree
|
||||||
|
if ![dict exists $::toolsVariables $toolName commandString] {
|
||||||
|
DebugPuts "Tools::Execute: command for $toolName not found"
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
set command [dict get $::toolsVariables $toolName commandString]
|
||||||
|
DebugPuts "Tools::Execute: command for $toolName as $command"
|
||||||
|
}
|
||||||
|
# 7. Проверять команды на доступность в системе и подставлять полный путь к команде
|
||||||
|
# если в конфиге не указан полный путь.
|
||||||
|
# Проверем наличие внешгних программ в системе
|
||||||
|
set cmd [lindex [split $command " "] 0]
|
||||||
|
if [file exists $cmd] {
|
||||||
|
set fullCommand $command
|
||||||
|
} else {
|
||||||
|
set fullPathToExec [Tools::CommandPathSettings "$cmd"]
|
||||||
|
set fullCommand [lreplace [split $command " "] 0 0 $fullPathToExec]
|
||||||
|
}
|
||||||
|
if {$fullPathToExec eq ""} {
|
||||||
|
DebugPuts "Tools::Execute: $command not found"
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
DebugPuts "Tools::Execute: $fullPathToExec, $fullCommand"
|
||||||
|
}
|
||||||
|
# 2. Определять выделен ли текст в открытом редакторе
|
||||||
|
# 5. Заменяем %s на выделенный в редакторе текст
|
||||||
|
set selectedText [Editor::SelectionGet]
|
||||||
|
if {$selectedText ne ""} {
|
||||||
|
regsub -all "%s" $fullCommand "$selectedText" fullCommand
|
||||||
|
DebugPuts "Tools::Execute: selected text \"$selectedText\", command \"$fullCommand\""
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1. Определять текущий файл
|
||||||
|
# 3. Опеределять сколько файлов выделено в дереве
|
||||||
|
# 4. Заменяем знак %f на имя текущего файла (файлов)
|
||||||
|
# regsub -all "%f" $command "$filePath" fullCommand
|
||||||
|
set filesList [Tree::GetSelectedItemValues $tree]
|
||||||
|
if {$filesList ne ""} {
|
||||||
|
foreach file $filesList {
|
||||||
|
# Если больше нет %f для замены, выходим из цикла
|
||||||
|
if {![string match "*%f*" $fullCommand]} break
|
||||||
|
set fullCommand [regsub {%f} $fullCommand $file]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# 6. Заменяем %d на текущий каталог(и), если он выделен в дереве,
|
||||||
|
# и если не выделено то корневой открытый в дереве
|
||||||
|
DebugPuts "Tools::Execute: $fullCommand"
|
||||||
|
|
||||||
|
set pipe [open "|$fullCommand" "r"]
|
||||||
|
fileevent $pipe readable
|
||||||
|
fconfigure $pipe -buffering none -blocking no
|
||||||
|
}
|
||||||
|
|
||||||
|
# Правка файла настроек
|
||||||
|
proc Tools::Settings {} {
|
||||||
|
global dir
|
||||||
|
|
||||||
|
FileOper::Edit [file join $dir(cfg) tools.ini]
|
||||||
|
# Config::read $dir(cfg)
|
||||||
|
}
|
||||||
23
lib/tree.tcl
23
lib/tree.tcl
@@ -18,7 +18,8 @@ namespace eval Tree {
|
|||||||
# puts "$tree $parent $item $type $text"
|
# puts "$tree $parent $item $type $text"
|
||||||
switch $type {
|
switch $type {
|
||||||
file {
|
file {
|
||||||
regsub -all {\.|/|\\|\s} $item "_" subNode
|
regsub -all {\.|/|\\|\s|:} $item "_" subNode
|
||||||
|
set subNode [string tolower $subNode]
|
||||||
# puts "Inserted tree node: $subNode"
|
# puts "Inserted tree node: $subNode"
|
||||||
set fileExt [string trimleft [file extension $text] "."]
|
set fileExt [string trimleft [file extension $text] "."]
|
||||||
#set fileName [string trimleft [file extension $text] "."]
|
#set fileName [string trimleft [file extension $text] "."]
|
||||||
@@ -41,7 +42,8 @@ namespace eval Tree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
directory {
|
directory {
|
||||||
regsub -all {\.|/|\\|\s} $item "_" subNode
|
regsub -all {\.|/|\\|\s|:} $item "_" subNode
|
||||||
|
set subNode [string tolower $subNode]
|
||||||
# puts $subNode
|
# puts $subNode
|
||||||
if {[string match {*debian*} [string tolower [file tail $item]]]} {
|
if {[string match {*debian*} [string tolower [file tail $item]]]} {
|
||||||
set image [::FindImage debian]
|
set image [::FindImage debian]
|
||||||
@@ -97,6 +99,7 @@ namespace eval Tree {
|
|||||||
proc PressItem {tree} {
|
proc PressItem {tree} {
|
||||||
global nbEditor lexers editors activeProject
|
global nbEditor lexers editors activeProject
|
||||||
set id [$tree selection]
|
set id [$tree selection]
|
||||||
|
if {[llength $id] > 1} {return}
|
||||||
$tree tag remove selected
|
$tree tag remove selected
|
||||||
$tree item $id -tags selected
|
$tree item $id -tags selected
|
||||||
SetActiveProject [GetItemID $tree [GetUpperItem $tree $id]]
|
SetActiveProject [GetItemID $tree [GetUpperItem $tree $id]]
|
||||||
@@ -104,7 +107,7 @@ namespace eval Tree {
|
|||||||
set key [lindex [split $id "::"] 0]
|
set key [lindex [split $id "::"] 0]
|
||||||
if {$values eq "" || $key eq ""} {return}
|
if {$values eq "" || $key eq ""} {return}
|
||||||
|
|
||||||
# puts "$key $tree $values"
|
DebugPuts "$key $tree $values"
|
||||||
switch -regexp $key {
|
switch -regexp $key {
|
||||||
directory {
|
directory {
|
||||||
FileOper::ReadFolder $values
|
FileOper::ReadFolder $values
|
||||||
@@ -112,6 +115,7 @@ namespace eval Tree {
|
|||||||
}
|
}
|
||||||
file {
|
file {
|
||||||
set v [FileOper::Edit $values $nbEditor]
|
set v [FileOper::Edit $values $nbEditor]
|
||||||
|
DebugPuts $v
|
||||||
if {$v eq false} {
|
if {$v eq false} {
|
||||||
$tree delete $id
|
$tree delete $id
|
||||||
}
|
}
|
||||||
@@ -128,8 +132,10 @@ namespace eval Tree {
|
|||||||
$nbEditor select $nbItem
|
$nbEditor select $nbItem
|
||||||
set txt $nbItem.frmText.t
|
set txt $nbItem.frmText.t
|
||||||
set findString [dict get $lexers [dict get $editors $txt fileType] procFindString]
|
set findString [dict get $lexers [dict get $editors $txt fileType] procFindString]
|
||||||
|
DebugPuts "Tree::PressItem: $findString\n values: $values"
|
||||||
|
regsub -all {\*} $values {\\*} values
|
||||||
regsub -all {PROCNAME} $findString $values str
|
regsub -all {PROCNAME} $findString $values str
|
||||||
|
DebugPuts "Tree::PressItem: $str"
|
||||||
Editor::FindFunction $txt "$str"
|
Editor::FindFunction $txt "$str"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,5 +163,12 @@ namespace eval Tree {
|
|||||||
GetUpperItem $tree $parent
|
GetUpperItem $tree $parent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc GetSelectedItemValues {tree} {
|
||||||
|
set valuesList ""
|
||||||
|
foreach itemID [$tree selection] {
|
||||||
|
lappend valuesList [GetItemID $tree $itemID]
|
||||||
|
}
|
||||||
|
return $valuesList
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
84
openbsd/build-package-bsd.sh
Executable file
84
openbsd/build-package-bsd.sh
Executable file
@@ -0,0 +1,84 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# create-openbsd-pkg.sh
|
||||||
|
|
||||||
|
PKG_NAME="projman"
|
||||||
|
WORK_DIR=projman_openbsd
|
||||||
|
VERSION=$(grep Version ../projman.tcl | grep -oE '\b[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\b')
|
||||||
|
RELEASE=$(grep "# Release" ../projman.tcl | grep -oE '[0-9A-Za-z]+$')
|
||||||
|
BUILD_DATE=$(date +%d%m%Y%H%M%S)
|
||||||
|
TXT="# Build: ${BUILD_DATE}"
|
||||||
|
echo "$VERSION, $RELEASE, $BUILD_DATE"
|
||||||
|
|
||||||
|
PKG_VERSION="${VERSION}${RELEASE}"
|
||||||
|
PKG_FULLNAME="${PKG_NAME}-${PKG_VERSION}"
|
||||||
|
|
||||||
|
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin
|
||||||
|
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman
|
||||||
|
mkdir -p ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/man/man1
|
||||||
|
|
||||||
|
cp -r ../lib ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp -r ../theme ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../projman.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
cp ../changelog-gen.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/changeloggen
|
||||||
|
cp ../tkregexp.tcl ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/tkregexp
|
||||||
|
cp ../LICENSE ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../README.md ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../CHANGELOG ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../projman.desktop ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
cp ../projman.png ${WORK_DIR}/${PKG_FULLNAME}/usr/local/share/projman/
|
||||||
|
|
||||||
|
sed -i "/# Build:.*/c$TXT" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
# ./changelog-gen.tcl --project-name projman --project-version ${VERSION} --project-release ${RELEASE} --out-file debian/changelog --deb --last
|
||||||
|
|
||||||
|
sed -i "s+^set\ dir(lib)+set\ dir(lib)\ /usr/local/share/projman/lib ;#+g" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
sed -i "s+\[pwd\]+/usr/local/share/projman+g" ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
# cat > ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman << 'EOF'
|
||||||
|
# #!/bin/sh
|
||||||
|
# exec /usr/local/bin/wish8.6 "/usr/local/share/projman/projman.tcl" "$@"
|
||||||
|
# EOF
|
||||||
|
# chmod +x ${WORK_DIR}/${PKG_FULLNAME}/usr/local/bin/projman
|
||||||
|
|
||||||
|
cat > ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS << EOF
|
||||||
|
@name ${PKG_NAME}-${PKG_VERSION}
|
||||||
|
@version ${PKG_VERSION}
|
||||||
|
@depend lang/tk:tk-*:tcl-*
|
||||||
|
@depend devel/tcllib:tcllib-*:tcl-*
|
||||||
|
@depend devel/tklib:tklib-*:tcl-*
|
||||||
|
@comment Editor for Tcl/Tk and other languages.
|
||||||
|
@arch amd64
|
||||||
|
@ignore
|
||||||
|
@cwd /usr/local
|
||||||
|
EOF
|
||||||
|
|
||||||
|
(cd ${WORK_DIR}/${PKG_FULLNAME}/usr/local && find . -type f | sed 's/^\.\///') | while read file; do
|
||||||
|
echo "$file" >> ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS
|
||||||
|
done
|
||||||
|
|
||||||
|
cat >> ${WORK_DIR}/${PKG_FULLNAME}/+CONTENTS << 'EOF'
|
||||||
|
@exec mkdir -p /var/log/projman 2>/dev/null || true
|
||||||
|
@exec echo "Package ${PKG_NAME} installed successfully"
|
||||||
|
@unexec rm -rf /var/log/projman 2>/dev/null || true
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "ProjMan is a code editor writen in TCL/Tk" > ${WORK_DIR}/${PKG_FULLNAME}/+COMMENT
|
||||||
|
|
||||||
|
cat > ${WORK_DIR}/${PKG_FULLNAME}/+DESC << 'EOF'
|
||||||
|
ProjMan (also known as "Tcl/Tk Project Manager") is a feature-rich editor
|
||||||
|
for programming in Tcl/Tk and other languages.
|
||||||
|
|
||||||
|
It includes a source editor with syntax highlighting and
|
||||||
|
code navigation, a context-sensitive help system, Git support, a
|
||||||
|
pseudo-terminal, image viewer and much more.
|
||||||
|
|
||||||
|
Supported languages for highlighting and navigation:
|
||||||
|
Tcl/Tk, GO, Perl, Python, Ruby, Shell (BASH), Markdown, YAML (Ansible), Lua.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
(cd ${WORK_DIR}/${PKG_FULLNAME}/ && pwd && ls -1 && tar -czf ../../../../${PKG_FULLNAME}.tgz .)
|
||||||
|
|
||||||
|
echo "Package created: ${PKG_FULLNAME}.tgz"
|
||||||
|
|
||||||
|
rm -rf ${WORK_DIR}
|
||||||
48
projman.tcl
48
projman.tcl
@@ -9,8 +9,8 @@ exec wish8.6 "$0" -- "$@"
|
|||||||
# Home page: https://nuk-svk.ru
|
# Home page: https://nuk-svk.ru
|
||||||
######################################################
|
######################################################
|
||||||
# Version: 2.0.0
|
# Version: 2.0.0
|
||||||
# Release: alpha18
|
# Release: beta4
|
||||||
# Build: 27102025193106
|
# Build: 13022026112625
|
||||||
######################################################
|
######################################################
|
||||||
|
|
||||||
# определим текущую версию, релиз и т.д.
|
# определим текущую версию, релиз и т.д.
|
||||||
@@ -34,7 +34,6 @@ while {[gets $f line] >=0} {
|
|||||||
}
|
}
|
||||||
close $f
|
close $f
|
||||||
|
|
||||||
|
|
||||||
package require msgcat
|
package require msgcat
|
||||||
package require inifile
|
package require inifile
|
||||||
package require ctext
|
package require ctext
|
||||||
@@ -43,6 +42,24 @@ package require fileutil
|
|||||||
# package require Thread
|
# package require Thread
|
||||||
package require fileutil::magic::filetype
|
package require fileutil::magic::filetype
|
||||||
|
|
||||||
|
# Определим установлен ли пакет Img для расширенной поддержки изображений
|
||||||
|
proc PackagePresent {pkg} {
|
||||||
|
# puts $pkg
|
||||||
|
foreach item [package names] {
|
||||||
|
# puts [string match -nocase Img $item]
|
||||||
|
if {[string match -nocase Img $item] == 1} {
|
||||||
|
# puts "The $pkg package was found"
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[PackagePresent "Img"] eq "true"} {
|
||||||
|
package require Img
|
||||||
|
} else {
|
||||||
|
puts "Img not present"
|
||||||
|
}
|
||||||
|
|
||||||
# Устанавливаем текущий каталог
|
# Устанавливаем текущий каталог
|
||||||
set dir(root) [pwd]
|
set dir(root) [pwd]
|
||||||
set dir(doc) [file join $dir(root) doc]
|
set dir(doc) [file join $dir(root) doc]
|
||||||
@@ -52,7 +69,7 @@ if { $::argc > 0 } {
|
|||||||
foreach arg $::argv {
|
foreach arg $::argv {
|
||||||
lappend opened $arg
|
lappend opened $arg
|
||||||
}
|
}
|
||||||
puts $opened
|
# puts $opened
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -80,7 +97,7 @@ source [file join $dir(lib) config.tcl]
|
|||||||
foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
|
foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
|
||||||
if {[file tail $modFile] ne "gui.tcl" && [file tail $modFile] ne "config.tcl"} {
|
if {[file tail $modFile] ne "gui.tcl" && [file tail $modFile] ne "config.tcl"} {
|
||||||
source $modFile
|
source $modFile
|
||||||
puts "Loading module $modFile"
|
# puts "Loading module $modFile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,26 +106,36 @@ set dir(theme) "[file join $dir(root) theme]"
|
|||||||
foreach modFile [lsort [glob -nocomplain [file join $dir(theme) *]]] {
|
foreach modFile [lsort [glob -nocomplain [file join $dir(theme) *]]] {
|
||||||
if [file isdirectory $modFile] {
|
if [file isdirectory $modFile] {
|
||||||
source $modFile/[file tail $modFile].tcl
|
source $modFile/[file tail $modFile].tcl
|
||||||
puts "Loading theme $modFile.tcl"
|
# puts "Loading theme $modFile.tcl"
|
||||||
} elseif {[file extension $modFile] eq ".tcl"} {
|
} elseif {[file extension $modFile] eq ".tcl"} {
|
||||||
source $modFile
|
source $modFile
|
||||||
puts "Loading theme $modFile"
|
# puts "Loading theme $modFile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# загружаем пользовательский конфиг, если он отсутствует, то копируем дефолтный
|
# загружаем пользовательский конфиг, если он отсутствует или пустой, то копируем дефолтный
|
||||||
if {[file exists [file join $dir(cfg) projman.ini]] ==0} {
|
if {[file exists [file join $dir(cfg) projman.ini]] == 0 || [file size [file join $dir(cfg) projman.ini]] == 0} {
|
||||||
Config::create $dir(cfg)
|
Config::create $dir(cfg)
|
||||||
}
|
}
|
||||||
Config::read $dir(cfg)
|
Config::read $dir(cfg)
|
||||||
|
Config::CheckVariables
|
||||||
|
|
||||||
|
# загружаем пользовательский конфиг для инстурментов, если он отсутствует или пустой, то копируем дефолтный
|
||||||
|
if {[file exists [file join $dir(cfg) tools.ini]] == 0 || [file size [file join $dir(cfg) tools.ini]] == 0} {
|
||||||
|
Tools::Create $dir(cfg)
|
||||||
|
}
|
||||||
|
# Читаем настройки для внешних инструментов
|
||||||
|
Tools::Read $dir(cfg)
|
||||||
|
Tools::CheckVariables
|
||||||
|
Tools::Write $dir(cfg)
|
||||||
|
|
||||||
::msgcat::mclocale $cfgVariables(locale)
|
::msgcat::mclocale $cfgVariables(locale)
|
||||||
|
|
||||||
if [::msgcat::mcload [file join $dir(lib) msgs]] {
|
if [::msgcat::mcload [file join $dir(lib) msgs]] {
|
||||||
puts "Load locale messages... OK"
|
puts "Load locale messages... OK"
|
||||||
}
|
}
|
||||||
puts "Setting the locale... [::msgcat::mclocale]"
|
DebugPuts "Setting the locale... [::msgcat::mclocale]"
|
||||||
|
|
||||||
source [file join $dir(lib) gui.tcl]
|
source [file join $dir(lib) gui.tcl]
|
||||||
|
|
||||||
@@ -149,4 +176,3 @@ if [info exists opened] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ cp projman.tcl projman
|
|||||||
sed -i "s+^set\ dir(lib)+set\ dir(lib)\ /usr/share/projman/lib ;#+g" projman
|
sed -i "s+^set\ dir(lib)+set\ dir(lib)\ /usr/share/projman/lib ;#+g" projman
|
||||||
sed -i "s+\[pwd\]+/usr/share/projman+g" projman
|
sed -i "s+\[pwd\]+/usr/share/projman+g" projman
|
||||||
|
|
||||||
|
./changelog-gen.tcl --project-name projman --project-version ${VERSION} --project-release ${RELEASE} --out-file redhat/projman.spec --rpm --last
|
||||||
|
|
||||||
CUR_DIR=$(pwd)
|
CUR_DIR=$(pwd)
|
||||||
|
|
||||||
cd ../
|
cd ../
|
||||||
@@ -31,12 +33,12 @@ cp redhat/projman.spec ${RPM_BUILD_DIR}/SPECS/projman.spec
|
|||||||
sed -i "s/.*Version:.*/Version:\t${VERSION}/" ${RPM_BUILD_DIR}/SPECS/projman.spec
|
sed -i "s/.*Version:.*/Version:\t${VERSION}/" ${RPM_BUILD_DIR}/SPECS/projman.spec
|
||||||
sed -i "s/.*Release:.*/Release:\t${RELEASE}/" ${RPM_BUILD_DIR}/SPECS/projman.spec
|
sed -i "s/.*Release:.*/Release:\t${RELEASE}/" ${RPM_BUILD_DIR}/SPECS/projman.spec
|
||||||
|
|
||||||
rpmbuild -ba "${RPM_BUILD_DIR}/SPECS/projman.spec"
|
fakeroot rpmbuild -ba "${RPM_BUILD_DIR}/SPECS/projman.spec"
|
||||||
|
|
||||||
# cp ${RPM_BUILD_DIR}/RPMS/noarch/projman-${VERSION}-${RELEASE}.noarch.rpm /files/
|
cp ${RPM_BUILD_DIR}/RPMS/noarch/projman-${VERSION}-${RELEASE}.noarch.rpm ../
|
||||||
# cp ${RPM_BUILD_DIR}/SRPMS/projman-${VERSION}-${RELEASE}.src.rpm /files/
|
cp ${RPM_BUILD_DIR}/SRPMS/projman-${VERSION}-${RELEASE}.src.rpm ../
|
||||||
|
|
||||||
rm -v projman
|
rm -v projman
|
||||||
rm -r -v ${RPM_BUILD_DIR}/SPECS/projman.spec
|
rm -r -v ${RPM_BUILD_DIR}/SPECS/projman.spec
|
||||||
rm -r -v ${RPM_BUILD_DIR}/SOURCES/projman-${VERSION}-${RELEASE}.tar.gz
|
rm -r -v ${RPM_BUILD_DIR}/SOURCES/projman-${VERSION}-${RELEASE}.tar.gz
|
||||||
rm -r -v ${RPM_BUILD_DIR}/BUILD/projman
|
#rm -r -v ${RPM_BUILD_DIR}/BUILD/projman
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ License: GPL
|
|||||||
Group: Development/Tcl
|
Group: Development/Tcl
|
||||||
Url: https://nuk-svk.ru
|
Url: https://nuk-svk.ru
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
Source: %name-%version-%release.tar.gz
|
Source: %{name}-%{version}-%{release}.tar.gz
|
||||||
Requires: tcl, tk, tklib, tcllib
|
Requires: tcl, tk, tklib, tcllib
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -16,40 +16,226 @@ This a editor for programming in TCL/Tk (and other language). It includes a file
|
|||||||
Интегрированная среда для программирования на Tcl/Tk. Включает в себя - менеджер проектов, полнофункциональный редактор, систему навигации по файлам и структуре файлов и многое другое.
|
Интегрированная среда для программирования на Tcl/Tk. Включает в себя - менеджер проектов, полнофункциональный редактор, систему навигации по файлам и структуре файлов и многое другое.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n %name
|
%setup -n %{name}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
# Пустая секция, если сборка не требуется
|
||||||
|
|
||||||
%install
|
%install
|
||||||
mkdir -p $RPM_BUILD_ROOT%_bindir
|
# Создаем директории
|
||||||
mkdir -p $RPM_BUILD_ROOT%_datadir/%name/lib/msgs
|
mkdir -p %{buildroot}%{_bindir}
|
||||||
mkdir -p $RPM_BUILD_ROOT%_datadir/%name/theme
|
mkdir -p %{buildroot}%{_datadir}/%{name}/lib/msgs
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_datarootdir}/applications
|
mkdir -p %{buildroot}%{_datadir}/%{name}/theme
|
||||||
|
mkdir -p %{buildroot}%{_datadir}/applications
|
||||||
|
mkdir -p %{buildroot}%{_iconsdir}/hicolor/48x48/apps
|
||||||
|
|
||||||
install -p -m755 projman $RPM_BUILD_ROOT%_bindir/%name
|
# Копируем исполняемые файлы
|
||||||
install -p -m755 tkregexp.tcl $RPM_BUILD_ROOT%_bindir/tkregexp
|
install -p -m755 projman %{buildroot}%{_bindir}/%{name}
|
||||||
|
install -p -m755 tkregexp.tcl %{buildroot}%{_bindir}/tkregexp
|
||||||
|
install -p -m755 changelog-gen.tcl %{buildroot}%{_bindir}/changeloggen
|
||||||
|
|
||||||
# install -p -m644 *.tcl $RPM_BUILD_ROOT%_datadir/%name/
|
# Копируем библиотеки и ресурсы
|
||||||
install -p -m644 lib/*.tcl $RPM_BUILD_ROOT%_datadir/%name/lib/
|
install -p -m644 lib/*.tcl %{buildroot}%{_datadir}/%{name}/lib/
|
||||||
install -p -m644 lib/msgs/*.* $RPM_BUILD_ROOT%_datadir/%name/lib/msgs/
|
install -p -m644 lib/msgs/*.* %{buildroot}%{_datadir}/%{name}/lib/msgs/
|
||||||
install -p -m644 theme/*.tcl $RPM_BUILD_ROOT%_datadir/%name/theme
|
install -p -m644 theme/*.tcl %{buildroot}%{_datadir}/%{name}/theme
|
||||||
install -p -m644 projman.desktop $RPM_BUILD_ROOT%{_datarootdir}/applications
|
|
||||||
|
|
||||||
|
# Копируем .desktop файл
|
||||||
|
install -p -m644 projman.desktop %{buildroot}%{_datadir}/applications/
|
||||||
|
|
||||||
|
# Копируем иконку в правильное место
|
||||||
|
install -p -m644 projman.png %{buildroot}%{_iconsdir}/hicolor/48x48/apps/projman.png
|
||||||
|
|
||||||
|
# Обновляем кэш иконок (опционально для Debian)
|
||||||
%post
|
%post
|
||||||
%update_menus
|
if [ $1 -eq 1 ] ; then
|
||||||
|
if [ -x /usr/bin/gtk-update-icon-cache ]; then
|
||||||
|
/usr/bin/gtk-update-icon-cache -q %{_iconsdir}/hicolor || :
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
%clean_menus
|
if [ $1 -eq 0 ] ; then
|
||||||
|
if [ -x /usr/bin/gtk-update-icon-cache ]; then
|
||||||
|
/usr/bin/gtk-update-icon-cache -q %{_iconsdir}/hicolor || :
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc INSTALL CHANGELOG TODO LICENSE README.md
|
%doc CHANGELOG TODO LICENSE README.md
|
||||||
%_bindir/%name
|
%{_bindir}/%{name}
|
||||||
%_bindir/tkregexp
|
%{_bindir}/tkregexp
|
||||||
%_datarootdir/applications/%name.desktop
|
%{_bindir}/changeloggen
|
||||||
%_datadir/%name
|
%{_datadir}/applications/projman.desktop
|
||||||
|
%{_datadir}/%{name}
|
||||||
|
%{_iconsdir}/hicolor/48x48/apps/projman.png
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Nov 28 2022 Sergey Kalinin <svk@nuk-svk.ru> 2.0.0
|
* Fri Feb 13 2026 svk <svk@nuk-svk.ru> 2.0.0-beta4
|
||||||
- Initial release
|
- Исправлено регулярное выражение для поиска переменных в коде на С.
|
||||||
|
- Добавил экранирование '*' в имени функции для поиска.
|
||||||
|
- Подкрректировал регулярки для работы с С.
|
||||||
|
- Исправил закрытие вкладки при отпускании кнопки мыши при нажатии на крестик.
|
||||||
|
- Добавил иконки для 'c' и 'h'. Добавил сочитание Alt-R в русской раскладке
|
||||||
|
- Добавил поддержку С (подсветка)
|
||||||
|
- Добавил копирование готовых пакетов
|
||||||
|
|
||||||
|
* Fri Feb 6 2026 svk <svk@nuk-svk.ru> 2.0.0-beta3
|
||||||
|
- Откорректировал сборку рпм
|
||||||
|
|
||||||
|
* Fri Feb 6 2026 svk <svk@nuk-svk.ru> 2.0.0-beta3
|
||||||
|
- Добавил сборку rpm. Исправил changelog-и
|
||||||
|
|
||||||
|
* Fri Feb 6 2026 svk <svk@nuk-svk.ru> 2.0.0-beta3
|
||||||
|
- changelog-gen: сделал вывод изменения в формате rpm.spec
|
||||||
|
- Исправил смену регистра в заголовках вкладок
|
||||||
|
- Добавил проверки в диалог FileOper::SaveFile
|
||||||
|
- Добавил диалог 'Сохранить как'
|
||||||
|
- Добавил проверку на наличие символа переменной.
|
||||||
|
- Исправил работу со списком переменных из всплывающего окна. Теперь там можно выбрать из списка стрелками и вставить по Enter.
|
||||||
|
- Вынес код связанный с обработкой подсказок при вводе переменных и процедур в отдельный модуль. Исправил недоработку при выборе варианта из списка и вставке его в текст. Исправил обработку клавиш Ввер Вниз Ввод Отмена в окне со списком вариантов.
|
||||||
|
|
||||||
|
* Tue Jan 27 2026 svk <svk@nuk-svk.ru> 2.0.0-beta2
|
||||||
|
- Добавлено подключение (bind) сочетания клавишь указанных в настройках инструментов.
|
||||||
|
- Добавлена динамическая генерация меню 'Инструменты'. Теперь новые внешние инструменты доступны сразу после сохранения файла настроек tools.ini в редакторе.
|
||||||
|
- 2-я бета
|
||||||
|
- Исправлена ошибка с некорректным определением виджета в процедуре получения выделенного текста.
|
||||||
|
- Добавлено редактирование настроек внешних инструментов. И пункт в меню 'Инструменты'->'Настройки'
|
||||||
|
- Исправление ошибки с запуском внешних программ.
|
||||||
|
- Добавлено определение путей до внешних программ при подключении к редактору.
|
||||||
|
- Сделана обработка шаблонов командной строки и запуск внешних инструментов.
|
||||||
|
- Добавлен tkregexp для установки в /usr/bin
|
||||||
|
- Добавлена сборка пакетов для openbsd
|
||||||
|
|
||||||
|
* Wed Jan 21 2026 svk <svk@nuk-svk.ru> 2.0.0-beta1
|
||||||
|
- Сделан вывод отладочной информации по запросу. Переделка кода.
|
||||||
|
- Добавлены процедуры проверки наличия параметров конфигурации
|
||||||
|
- Добавил фокус ввода на 'терминал' если он открыт во вкладке (при переключении вкладок).
|
||||||
|
- Исправил вставку кавычек при выделении текста
|
||||||
|
- Исправил ошибку при отправке сигналов несуществующему процессу.
|
||||||
|
- Уменьшил всплывающее меню: вынес менюшки Файл и Вид в подменю.
|
||||||
|
- Изменил команду загрузки пакета в репу
|
||||||
|
- Исправлено поведение при сочетании клавиш Control-y (повторение последнего действия)
|
||||||
|
- Исправлен флаг модификации при открытии файла
|
||||||
|
- Исправил закрытие вкладок редактора и сохранение файла при разделении экрана.
|
||||||
|
- Добавлены настройки путей к программам для выполнения редактируемых файлов для каждого поддержимаего типа. И использование этих настроек при выполнении файла.
|
||||||
|
- Добавил вывод информации о версиях tcl и tk
|
||||||
|
- Добавил вывод номера версии tcl/tl в О Программе
|
||||||
|
- Исправил сохранение и закрытие нового файла. Теперь при сохранении файл будет переоткрыт под новым именем.
|
||||||
|
- Добавил проверку пакета Img. И поправил проверку типов изображений
|
||||||
|
- Переделал сигналы и сочетния
|
||||||
|
- Добавлен перевод фокуса ввода на прежнее окно после закрытия диалога выполнения.
|
||||||
|
- Добавлена передача сигналов для закрытия запущенного процесса
|
||||||
|
- Добавлен диалог настроек
|
||||||
|
- Добавил псевдо-терминал
|
||||||
|
- Добавлен диалог при открытии файлов отличных от текстовых
|
||||||
|
- Поправил тему оформления
|
||||||
|
- Исправлена работа в windows
|
||||||
|
- Уменьшил колдичество выводимой отладочной информации
|
||||||
|
- Добавлено определение пути до git в зависимости от платформы.
|
||||||
|
- Исправлено создание файла конфигурации
|
||||||
|
- Исправлено создание файла конфигурации. Добавлены номера версий в вызов tclsh8.6 и wish8.6. Убрана зависимостить на Threads.
|
||||||
|
- Исправлено чтение структуры проекта при открытии из меню 'Открыть недавнее'
|
||||||
|
- Bugfix release
|
||||||
|
- Bug fix with varhelper
|
||||||
|
- Added the "Open Recent" menu. The "recentlyEditedFolders" option in the configuration file contains a list of recently opened directories. The procedures for working with this list have also been added.
|
||||||
|
- Косметические изменения.
|
||||||
|
- Исправлены ошибки при вставке кавычек
|
||||||
|
- changelog-gen.tcl: Добавлена генерация текстового журнала изменений
|
||||||
|
- build-deb-projman.sh: добавлена генерация changelog из git log
|
||||||
|
- changelog-gen.tcl: Вывод в файл вынесен в отдельную процедуру
|
||||||
|
- changelog-gen.tcl: Добавлено создание резервной копии выходного файла. Исправлен вывод в файл.
|
||||||
|
- changelog-gen.tcl: Добавлены опции командной строки
|
||||||
|
- Добавлен запуск changelog-gen при сборке пакета
|
||||||
|
- Добавлено чстение журнала начиная с определенной даты
|
||||||
|
- Генерация списка изменений для debian приведена к корректному виду
|
||||||
|
- Исправлен фокус при создании нового файла. #3
|
||||||
|
- Исправлена неправильная замена выражение при поиске
|
||||||
|
- Реализовал базовые функции генератора журнала изменений
|
||||||
|
- Добавлена иконка для jinja template
|
||||||
|
- Исправил остатки слияния веток
|
||||||
|
- Исправлено некорректное определение типа файла при открытии.
|
||||||
|
- Исправил открытие файлов с разными путями (~/ ./ ../)
|
||||||
|
- Добавил изображений программы
|
||||||
|
- Исправлена ошибка при создании нового файла.
|
||||||
|
- Добавил пиктограммы файлов
|
||||||
|
- Исправил процедуру Files::CloseAll ('Закрыть всё')
|
||||||
|
- Добавлена поддержка Lua
|
||||||
|
- Исправлена процедура (рас)комментирования
|
||||||
|
- Исправил ошибку при выходе в процедуре (Congig::Write)
|
||||||
|
- Добавил раскраски в ruby
|
||||||
|
- Добавлена возможность многострочных комментариев
|
||||||
|
- В Ruby lexer добавлен поиск переменных коде.
|
||||||
|
- Немного почистил. Добавлен поиск переменных по питоньим исходникам (lexer)
|
||||||
|
- Изменения в подсветке для INI
|
||||||
|
- Добавил подсветку для Desktop и Spec файлов
|
||||||
|
- Добавил вывод отладочной инфы в процедуру
|
||||||
|
- Исправил подсветку комментариев в TCL
|
||||||
|
- Оптимизация процедур
|
||||||
|
- Добавлена подсветка и навигация по HTML. Исправлена подсветка XML
|
||||||
|
- Добавил иконку для изображений
|
||||||
|
- Добавил иконки для perl
|
||||||
|
- Исправлена подсветка и навигация по коду для Ruby
|
||||||
|
- Исправлено сохранение сессии в редакторе (открытие папки и файлов при следующем запуске)
|
||||||
|
- Добавлена новая секция UserSession
|
||||||
|
- Исправление ошибки при открытии файла
|
||||||
|
- Добавлена поддержка INI-файлов (подсветка
|
||||||
|
- Добавлена поддержка perl
|
||||||
|
- Добавил икогнку для файлов git
|
||||||
|
- Добавлены иконки для ключей и сертификатов. Изменен поиск иконки (вощзвращает теерь с размером)
|
||||||
|
- Реализован двухпанельный режим работы (вертиикальное разделение)
|
||||||
|
- Исправлена ошибка при открытии ansible.cfg
|
||||||
|
- Добавил деактивацию кнопки 'Создать репу' если не выбран активный проект (не открыто ни одного каталога/папки)
|
||||||
|
- Добавлены команды git init и git config (зачаток). Изменен диалог клонирования репозитория (добавлена кнопка Создать репозиторий)
|
||||||
|
- Исправил ошибку git при открытии файла или каталога если репозиторий не инициализирован (нет .git каталога внутри проекта)
|
||||||
|
- Добавил скриты сборки rpm
|
||||||
|
- Добавлено обрамление выделенного текста прии нажатии '_' в markdown
|
||||||
|
- Исправление подсветки
|
||||||
|
- Добавлена поддержка markdown (подсветка
|
||||||
|
- Исправлена ошибка с закрытием файлов в редакторе при закрытии папки
|
||||||
|
- Переделана процедура определения активного проекта. Исправлено определение ветки git. Теперь можно нормально работать в двух и более открытых проектах (каталогах/папках)
|
||||||
|
- Доделан вид диалога поиска по файлам
|
||||||
|
- Исправлен поиск имени функции
|
||||||
|
- Добавлен диалог клонирования репозитория
|
||||||
|
- Добавил разделитель
|
||||||
|
- Исправлено переключение вкладок при закрытии
|
||||||
|
- Исправлено закрытиие вкладки Git по нажатию соотв. кнопки в панели инструментов
|
||||||
|
- Добавлен пункт 'Закрыть всё'
|
||||||
|
- Исправлено соответствие открытого файла в редакторе и выделение этого файла в дереве
|
||||||
|
- Исправлено переключение отображения панели (лево/право) в без перезапуска программы.
|
||||||
|
- Украшательства интерфейса - Реакция на нажатие кнопки в панели инструментов теперь зависит от контекста
|
||||||
|
- Добавлено включение отключение отображения Меню
|
||||||
|
- Добавлено копирование текущей строки в буфер по Atl+Y
|
||||||
|
- Исправлена ошибка с отображением файловой панели
|
||||||
|
- Добавлены и исправлены функции отображения меню
|
||||||
|
- Добавлен параметр statusBarShow - показ строки статуса
|
||||||
|
- Добавлены переводы
|
||||||
|
- Добавлена проверка параметров вызова файл или просто строка
|
||||||
|
- Добавлен вывод сообщений об ошибке в диалоге
|
||||||
|
- Добавлено обновления списка файлов в дереве
|
||||||
|
- Добавлена процедура вывода информационного сообщения
|
||||||
|
- Добавлена команда Git::Reset (git reset _file_) на кнопке в диалоге. Для отмены 'git add'
|
||||||
|
- Добавлена кнопка Обновление в диалог работы с Git
|
||||||
|
- Исправление процедуры поиска наименования функции
|
||||||
|
- Фиксы диалога работы с Git (работа с выделенными файлами в списках)
|
||||||
|
- Фиксы и тесты работы с git
|
||||||
|
- Исправление выборанескольких файлов в диалоге Git
|
||||||
|
- Исправление рег. выражения чтения файлов командой git status
|
||||||
|
- Исправлено рег. выпражение определения mime типа файла
|
||||||
|
- Добавил очистку текстовых полей при добавлении файлов в коммит
|
||||||
|
- Исправрелдение Git::Commit (индексация всех файлов в проекте)
|
||||||
|
- Исправления глюков
|
||||||
|
- Украшательства строки статуса
|
||||||
|
- Добавлен просмотрщик изображений
|
||||||
|
- Добавил рамку кону ввода номера
|
||||||
|
- Добавлен диалог перехода по номеру строки Ctrl-G
|
||||||
|
- Добавлено определение типа файла
|
||||||
|
- Добавил удаление артефактов сборки пакета
|
||||||
|
- Новая сборка
|
||||||
|
- Добавлена подсветка имен файлов в выводе git show
|
||||||
|
- Небольшие правки в подсказках по переменным
|
||||||
|
- Исправлена подсветка SHELL переменных а YAML файлах (ansible
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
151
theme/black.tcl
151
theme/black.tcl
@@ -6,8 +6,8 @@
|
|||||||
#
|
#
|
||||||
# $Id: black.tcl,v 1.2 2009/10/25 19:21:30 oberdorfer Exp $
|
# $Id: black.tcl,v 1.2 2009/10/25 19:21:30 oberdorfer Exp $
|
||||||
|
|
||||||
package require Tk 8.4; # minimum version for Tile
|
package require Tk; # minimum version for Tile
|
||||||
package require tile 0.8; # depends upon tile
|
package require tile; # depends upon tile
|
||||||
|
|
||||||
|
|
||||||
namespace eval ttk {
|
namespace eval ttk {
|
||||||
@@ -39,6 +39,7 @@ namespace eval ttk::theme::black {
|
|||||||
-lightest "#ffffff"
|
-lightest "#ffffff"
|
||||||
-selectbg "#4a6984"
|
-selectbg "#4a6984"
|
||||||
-selectfg "#ffffff"
|
-selectfg "#ffffff"
|
||||||
|
-font "#c8c8c8"
|
||||||
}
|
}
|
||||||
if {[info commands ::ttk::style] ne ""} {
|
if {[info commands ::ttk::style] ne ""} {
|
||||||
set styleCmd ttk::style
|
set styleCmd ttk::style
|
||||||
@@ -46,78 +47,84 @@ namespace eval ttk::theme::black {
|
|||||||
set styleCmd style
|
set styleCmd style
|
||||||
}
|
}
|
||||||
|
|
||||||
$styleCmd theme create black -parent clam -settings {
|
$styleCmd theme create black -parent clam -settings {
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# Theme defaults
|
# Theme defaults
|
||||||
#
|
#
|
||||||
$styleCmd configure "." \
|
$styleCmd configure "." \
|
||||||
-background $colors(-frame) \
|
-background $colors(-frame) \
|
||||||
-foreground white \
|
-foreground white \
|
||||||
-bordercolor $colors(-darkest) \
|
-bordercolor $colors(-darkest) \
|
||||||
-darkcolor $colors(-dark) \
|
-darkcolor $colors(-dark) \
|
||||||
-lightcolor $colors(-lighter) \
|
-lightcolor $colors(-lighter) \
|
||||||
-troughcolor $colors(-darker) \
|
-troughcolor $colors(-darker) \
|
||||||
-selectbackground $colors(-selectbg) \
|
-selectbackground $colors(-selectbg) \
|
||||||
-selectforeground $colors(-selectfg) \
|
-selectforeground $colors(-selectfg) \
|
||||||
-selectborderwidth 0 \
|
-selectborderwidth 0 \
|
||||||
-font "{Droid Sans Mono} 9" \
|
-font "{Droid Sans Mono} 9" \
|
||||||
;
|
;
|
||||||
|
|
||||||
|
$styleCmd map "." \
|
||||||
|
-background [list disabled $colors(-frame) \
|
||||||
|
active $colors(-lighter)] \
|
||||||
|
-foreground [list disabled $colors(-disabledfg)] \
|
||||||
|
-selectbackground [list !focus $colors(-darkest)] \
|
||||||
|
-selectforeground [list !focus white] \
|
||||||
|
;
|
||||||
|
|
||||||
|
# ttk widgets.
|
||||||
|
$styleCmd configure TButton \
|
||||||
|
-width -8 -padding {5 1} -relief link
|
||||||
|
$styleCmd configure TMenubutton \
|
||||||
|
-relief flat -arrowsize 0
|
||||||
|
|
||||||
|
$styleCmd configure TCheckbutton \
|
||||||
|
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
||||||
|
$styleCmd configure TRadiobutton \
|
||||||
|
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
||||||
|
|
||||||
|
$styleCmd configure TEntry \
|
||||||
|
-fieldbackground gray20 -foreground $colors(-font) \
|
||||||
|
-padding {2 0} -border -1
|
||||||
|
$styleCmd configure TCombobox \
|
||||||
|
-fieldbackground white -foreground $colors(-font)\
|
||||||
|
-padding {2 0}
|
||||||
|
$styleCmd configure TSpinbox \
|
||||||
|
-fieldbackground white -foreground $colors(-font) \
|
||||||
|
-padding {2 0}
|
||||||
|
|
||||||
|
$styleCmd configure TNotebook \
|
||||||
|
-border -1
|
||||||
|
$styleCmd configure TNotebook.Tab \
|
||||||
|
-padding {6 2 6 2} \
|
||||||
|
-border -1
|
||||||
|
|
||||||
|
$styleCmd map TNotebook.Tab -background [list \
|
||||||
|
selected $colors(-lighter)]
|
||||||
|
|
||||||
|
# tk widgets.
|
||||||
|
$styleCmd map Menu \
|
||||||
|
-background [list active $colors(-dark)] \
|
||||||
|
-foreground [list disabled $colors(-lightest)] \
|
||||||
|
|
||||||
|
$styleCmd configure TreeCtrl \
|
||||||
|
-background gray30 -itembackground {gray60 gray50} \
|
||||||
|
-itemfill white -itemaccentfill yellow -border -1
|
||||||
|
|
||||||
|
$styleCmd map Treeview\
|
||||||
|
-background [list selected $colors(-lighter)] \
|
||||||
|
-foreground [list selected $colors(-selectfg)]
|
||||||
|
# -background [list selected $colors(-selectbg)] \
|
||||||
|
|
||||||
|
$styleCmd configure Treeview -fieldbackground gray25
|
||||||
|
|
||||||
$styleCmd map "." \
|
$styleCmd map Canvas \
|
||||||
-background [list disabled $colors(-frame) \
|
-background [list selected $colors(-lighter)] \
|
||||||
active $colors(-lighter)] \
|
-foreground [list selected $colors(-selectfg)] \
|
||||||
-foreground [list disabled $colors(-disabledfg)] \
|
-highlightbackground [list selected $colors(-lighter)]
|
||||||
-selectbackground [list !focus $colors(-darkest)] \
|
}
|
||||||
-selectforeground [list !focus white] \
|
# puts [ttk::style element names]
|
||||||
;
|
|
||||||
|
|
||||||
# ttk widgets.
|
|
||||||
$styleCmd configure TButton \
|
|
||||||
-width -8 -padding {5 1} -relief link
|
|
||||||
$styleCmd configure TMenubutton\
|
|
||||||
-relief flat -arrowsize 0
|
|
||||||
$styleCmd configure TCheckbutton \
|
|
||||||
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
|
||||||
$styleCmd configure TRadiobutton \
|
|
||||||
-indicatorbackground $colors(-lighter) -indicatormargin {1 1 4 1}
|
|
||||||
|
|
||||||
$styleCmd configure TEntry \
|
|
||||||
-fieldbackground gray20 -foreground black \
|
|
||||||
-padding {2 0} -border -1
|
|
||||||
$styleCmd configure TCombobox \
|
|
||||||
-fieldbackground white -foreground black \
|
|
||||||
-padding {2 0}
|
|
||||||
$styleCmd configure TSpinbox \
|
|
||||||
-fieldbackground white -foreground black \
|
|
||||||
-padding {2 0}
|
|
||||||
|
|
||||||
$styleCmd configure TNotebook \
|
|
||||||
-border -1
|
|
||||||
$styleCmd configure TNotebook.Tab \
|
|
||||||
-padding {6 2 6 2} \
|
|
||||||
-border -1
|
|
||||||
|
|
||||||
$styleCmd map TNotebook.Tab -background [list \
|
|
||||||
selected $colors(-lighter)]
|
|
||||||
|
|
||||||
# tk widgets.
|
|
||||||
$styleCmd map Menu \
|
|
||||||
-background [list active $colors(-lighter)] \
|
|
||||||
-foreground [list disabled $colors(-disabledfg)]
|
|
||||||
|
|
||||||
$styleCmd configure TreeCtrl \
|
|
||||||
-background gray30 -itembackground {gray60 gray50} \
|
|
||||||
-itemfill white -itemaccentfill yellow -border -1
|
|
||||||
|
|
||||||
$styleCmd map Treeview\
|
|
||||||
-background [list selected $colors(-lighter)] \
|
|
||||||
-foreground [list selected $colors(-selectfg)]
|
|
||||||
# -background [list selected $colors(-selectbg)] \
|
|
||||||
|
|
||||||
$styleCmd configure Treeview -fieldbackground gray25
|
|
||||||
}
|
|
||||||
puts [ttk::style element names]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# A few tricks for Tablelist.
|
# A few tricks for Tablelist.
|
||||||
|
|||||||
@@ -1365,5 +1365,3 @@ proc make-regexp::make-regexp {words} {
|
|||||||
set regexp
|
set regexp
|
||||||
}
|
}
|
||||||
#==============================================================================================
|
#==============================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user