Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
acf4e53
Create CI workflow for Linux environment
upupwrite Sep 4, 2026
4d1b255
Refactor CI to simplify test execution
upupwrite Sep 4, 2026
8d2d018
Refactor CI workflow for Linux builds and tests
upupwrite Sep 4, 2026
6f7582f
(LLVM assist)Standardize header file capitalization
upupwrite Sep 12, 2026
a4951f0
(LLVM-assist)Cross-platform modify
upupwrite Sep 12, 2026
13e3a2b
Fix undo after Ctrl+A + Backspace
upupwrite Sep 12, 2026
bfc05f5
Update ci-linux workflows
upupwrite Sep 12, 2026
4ebb5d3
Testing file fixed
upupwrite Sep 12, 2026
5f24b1b
Style support
upupwrite Sep 13, 2026
e7dc558
Update catch to catch_all head files
upupwrite Sep 13, 2026
7210e9a
Reset CatchTests dir
upupwrite Sep 13, 2026
0adc4ae
Disable ctest ensure compile pass
upupwrite Sep 13, 2026
90a307e
improve settingsdialog ui and so on
upupwrite Sep 13, 2026
b0d5998
Fixed: settingsdialog.cpp has took the empty work
upupwrite Sep 13, 2026
a344208
(LLM-assist)Fixed:MkEdit_Tests.cpp and improve
upupwrite Sep 24, 2026
39bffe8
Reset:settingsdialog.ui
upupwrite Sep 24, 2026
4ca4a29
Reset:settingsdialog.cpp settingsdialog.h
upupwrite Sep 24, 2026
7265e93
(LLM-assist)test: fix and complete Catch2 test suite for Remini
upupwrite Sep 24, 2026
ca0f4b0
(LLM-assist)github action fixed
upupwrite Sep 24, 2026
29518c6
Fixed:windowapi.cpp in windows sys
upupwrite Sep 24, 2026
1960689
test(MkEdit_Tests.cpp): Fixed some Erro
upupwrite Sep 24, 2026
aa794ee
Fixed:theme switch and theme setting persistence
upupwrite Sep 24, 2026
bf0e8db
(clang-format)auto format
upupwrite Sep 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BasedOnStyle: Google
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Allman
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
AccessModifierOffset: -4

76 changes: 56 additions & 20 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,40 @@ on:

jobs:
build:
# ---------------------------------------------------------------------
# IMPORTANT: do NOT use `windows-latest` here.
#
# As of late 2025 `windows-latest` points to the `windows-2025-vs2026`
# image, which ships MSVC 19.51. Qt 6.5.0's `qvarlengtharray.h` still
# uses `stdext::checked_array_iterator`, an API that was removed from
# newer MSVC STL versions, so every translation unit that includes a
# Qt header fails with:
#
# error C3861: 'stdext': identifier not found
# error C2065: 'stdext': undeclared identifier
#
# `windows-2022` runs VS 2022 (MSVC 19.4x), which is the toolchain
# Qt 6.5.0 was built and tested against.
# ---------------------------------------------------------------------
runs-on: windows-2022

runs-on: windows-latest
env:
QT_DIR: ${{ github.workspace }}\Remini\Qt\6.5.0\msvc2019_64

steps:
- name: Checkout Repo
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Download catch.hpp and setup Environment Variable
shell: pwsh
run: |
mkdir Catch2
cd Catch2
$url = "https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp"
$output = "catch.hpp"
Invoke-WebRequest -Uri $url -OutFile $output
echo "CATCH_INCLUDE_DIR=$(Get-Location)" >> $env:GITHUB_ENV
New-Item -ItemType Directory -Force -Path catch2 | Out-Null
Invoke-WebRequest `
-Uri "https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp" `
-OutFile catch2/catch.hpp
echo "CATCH_INCLUDE_DIR=$env:GITHUB_WORKSPACE" >> $env:GITHUB_ENV
cd ..

- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -33,22 +50,41 @@ jobs:
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
dir: '${{ github.workspace }}\Remini\'
dir: '${{ github.workspace }}\Remini'
cache: 'true'
cache-key-prefix: 'install-qt-action'
setup-python: 'false'
tools: 'tools_cmake'

- name: Configure CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -B="Build" -DQt6_DIR="D:\a\Remini\Remini\Remini\Qt\6.5.0\msvc2019_64"
shell: pwsh
run: |
cmake -S . -B Build -DCMAKE_BUILD_TYPE=Release -DQt6_DIR="$env:QT_DIR"

- name: Build the Qt project with CMake
run: cmake --build build --config Release
run: cmake --build Build --config Release

- name: Deploy main executable
shell: pwsh
run: |
& "$env:QT_DIR\bin\windeployqt.exe" `
--no-translations `
"Build\Release\Remini.exe"

- name: Run test
# ---------------------------------------------------------------------
# Test target name is `CatchTests` (defined in CatchTests/CMakeLists.txt
# via `project(CatchTests)` + `add_executable(${PROJECT_NAME} ...)`),
# NOT `ReminiTests`. `Remini` is the main application target.
#
# On the MSVC generator the binaries land in
# Build/<target>/Release/<target>.exe
# hence the `Build\CatchTests\Release` working directory below.
# ---------------------------------------------------------------------
- name: Run tests
shell: pwsh
working-directory: ${{ github.workspace }}\Build\CatchTests\Release
run: |
echo "Workspace path is ${{ github.workspace }}"
cd D:\a\Remini\Remini\Build\CatchTests\Release\
${{ github.workspace }}\Remini\Qt\6.5.0\msvc2019_64\bin\windeployqt.exe ReminiTests.exe
dir
.\ReminiTests.exe
Write-Host "Contents:"
Get-ChildItem
& "$env:QT_DIR\bin\windeployqt.exe" --no-translations CatchTests.exe
.\CatchTests.exe
78 changes: 78 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI Linux

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

jobs:
build:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
build_type: [Debug, Release]

# QApplication is constructed in CatchTests/main.cpp, so a headless
# environment needs the offscreen QPA plugin. Set it at the job level
# so every step (including configure / build) sees it.
env:
QT_QPA_PLATFORM: offscreen

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
pkg-config \
libx11-dev \
libxkbcommon-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
qt6-base-dev \
qt6-base-dev-tools \
qt6-tools-dev \
qt6-tools-dev-tools \
libqt6svg6-dev

# -------------------------------------------------------------------
# Install the Catch2 single-header.
#
# The test sources all use `#include <catch2/catch.hpp>`, and Linux
# filesystems are case-sensitive, so:
# * the directory MUST be named `catch2` (lowercase), and
# * CATCH_INCLUDE_DIR MUST point at the PARENT of `catch2/`
# (i.e. the repo root), because the compiler forms the full path
# as <CATCH_INCLUDE_DIR> + "/catch2/catch.hpp".
#
# Placing it at the repo root also works implicitly because
# CatchTests/CMakeLists.txt already adds ${CMAKE_SOURCE_DIR} to the
# include path; setting CATCH_INCLUDE_DIR makes it explicit.
# -------------------------------------------------------------------
- name: Install Catch2 single header
run: |
mkdir -p catch2
curl -fL -o catch2/catch.hpp \
https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp
echo "CATCH_INCLUDE_DIR=${GITHUB_WORKSPACE}" >> "$GITHUB_ENV"

- name: Configure (CMake)
run: |
cmake -S . -B build \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

# Ninja is a single-config generator; do NOT pass --config here.
# CMAKE_BUILD_TYPE was already provided at configure time.
- name: Build
run: cmake --build build --parallel

- name: Run tests
run: ctest --test-dir build --output-on-failure
107 changes: 56 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,87 +14,92 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

# X11 is required on Linux for the global-hotkey implementation.
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
endif()

set(PROJECT_SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
views_handler.h
views_handler.cpp
mkedit.h
mkedit.cpp
highlighter.h
highlighter.cpp
mktextdocument.h
mktextdocument.cpp
blockdata.h
blockdata.cpp
linedata.h
linedata.cpp
theme.h
navigationview.h
navigationview.cpp
navigationmodel.h
navigationmodel.cpp
formatdata.h
formatdata.cpp
textsearchworker.h
textsearchworker.cpp
appeventfilter.h
appeventfilter.cpp
resources/icons.qrc
startuptext.h
recentfilesdialog.h
recentfilesdialog.cpp
settingsdialog.h
settingsdialog.cpp
settingsdialog.ui
togglebutton.h
togglebutton.cpp
)
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
views_handler.h
views_handler.cpp
mkedit.h
mkedit.cpp
highlighter.h
highlighter.cpp
mktextdocument.h
mktextdocument.cpp
blockdata.h
blockdata.cpp
linedata.h
linedata.cpp
theme.h
navigationview.h
navigationview.cpp
navigationmodel.h
navigationmodel.cpp
formatdata.h
formatdata.cpp
textsearchworker.h
textsearchworker.cpp
appeventfilter.h
appeventfilter.cpp
resources/icons.qrc
startuptext.h
recentfilesdialog.h
recentfilesdialog.cpp
settingsdialog.h
settingsdialog.cpp
settingsdialog.ui
togglebutton.h
togglebutton.cpp

# Cross-platform: the .cpp contains #ifdef Q_OS_WIN / Q_OS_LINUX branches.
windowapi.h
windowapi.cpp
)

# Windows-only helper interface header.
if(WIN32)
list(APPEND PROJECT_SOURCES
iwindowapi.h
windowapi.h
windowapi.cpp
)
endif()

if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(Remini
MANUAL_FINALIZATION
${PROJECT_SOURCES}

)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET Remini APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
if(ANDROID)
add_library(Remini SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(Remini
${PROJECT_SOURCES}
)
endif()
endif()

# Add the test directory to the build process
add_subdirectory(CatchTests)

target_link_libraries(Remini PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)

# Run the tests as part of the build process
# Link X11 on Linux so windowapi.cpp can use XGrabKey / XGetInputFocus.
if(UNIX AND NOT APPLE)
target_link_libraries(Remini PRIVATE X11::X11)
endif()

enable_testing()

add_subdirectory(CatchTests)

add_test(NAME CatchTests COMMAND CatchTests)

set_target_properties(Remini PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
Expand Down
Loading
Loading