From 4b0cb97279c04dd33526a2dafb0d337ce3aa41f2 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Mon, 28 Feb 2022 18:32:42 -0500 Subject: [PATCH 01/11] Fix C language --- src/NotepadNext/languages/c.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NotepadNext/languages/c.lua b/src/NotepadNext/languages/c.lua index 776c6d4a3..03fe6ec65 100644 --- a/src/NotepadNext/languages/c.lua +++ b/src/NotepadNext/languages/c.lua @@ -1,6 +1,6 @@ local L = {} -L.lexer = "c" +L.lexer = "cpp" L.extensions = { "c", From 3c60af7610347a5187c230301698a608a653fe3a Mon Sep 17 00:00:00 2001 From: dail8859 Date: Mon, 28 Feb 2022 18:55:26 -0500 Subject: [PATCH 02/11] Fix installer not adding correct components This triggers the selection change manually after the memento sections are restored so that the hidden sections get set appropriately --- installer/installer.nsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installer/installer.nsi b/installer/installer.nsi index 3ce648872..5da957b45 100644 --- a/installer/installer.nsi +++ b/installer/installer.nsi @@ -99,7 +99,11 @@ Function .onInit ${endif} !insertmacro MULTIUSER_INIT + ${MementoSectionRestore} + + # Trigger the selection change manually so that the hidden sections get set appropriately + Call .onSelChange FunctionEnd Function .onInstSuccess From bd0a8d967ad84954a44d97cc973713ad83b8ea01 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Fri, 4 Mar 2022 15:57:46 -0500 Subject: [PATCH 03/11] Fix Qt version check --- src/NotepadNext.pro | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/NotepadNext.pro b/src/NotepadNext.pro index 7c4f04ee0..f100162e5 100644 --- a/src/NotepadNext.pro +++ b/src/NotepadNext.pro @@ -17,11 +17,7 @@ include(Version.pri) -lessThan(QT_MAJOR_VERSION, 5) { - lessThan(QT_MINOR_VERSION, 13) { - error(Qt v5.13.x is required) - } -} +!versionAtLeast(QT_VERSION, 5.15):error("Qt v5.15 or greater is required") TEMPLATE = subdirs From abcba3b0feed296be26e917682ff48b19abce63c Mon Sep 17 00:00:00 2001 From: dail8859 Date: Fri, 4 Mar 2022 15:03:10 -0500 Subject: [PATCH 04/11] Update build.yml --- .github/workflows/build.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b915a01e2..bbf76de29 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,16 @@ on: [push, pull_request] jobs: build-linux: + strategy: + matrix: + config: + - + qt_version: "5.15.2" + modules: "" + - + qt_version: "6.2.2" + modules: "qt5compat" + runs-on: ubuntu-latest steps: @@ -27,7 +37,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: NotepadNext-Linux + name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }} path: ${{ github.workspace }}/build-linux/NotepadNext/NotepadNext build-windows: From b92c2dcec1923fc104715e09f206fc18cda8b95c Mon Sep 17 00:00:00 2001 From: dail8859 Date: Sat, 5 Mar 2022 13:21:13 -0500 Subject: [PATCH 05/11] Actually build with Qt6.2 on Linux --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bbf76de29..afdf8afe6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: qt_version: "5.15.2" modules: "" - - qt_version: "6.2.2" + qt_version: "6.2.3" modules: "qt5compat" runs-on: ubuntu-latest @@ -24,7 +24,8 @@ jobs: - name: Install Qt uses: jurplel/install-qt-action@v2 with: - version: "5.15.2" + version: ${{ matrix.config.qt_version }} + modules: ${{ matrix.config.modules }} - name: Compile run: | @@ -48,7 +49,7 @@ jobs: qt_version: "5.15.2" modules: "" - - qt_version: "6.2.2" + qt_version: "6.2.3" modules: "qt5compat" runs-on: windows-latest From 4aaa763be6f0a2a26188da26b78d0634a39d04b8 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Sat, 5 Mar 2022 14:02:51 -0500 Subject: [PATCH 06/11] Try to fix Linux build for Qt6 --- src/ads.pri | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ads.pri b/src/ads.pri index 24273b3c8..be7cc1c77 100644 --- a/src/ads.pri +++ b/src/ads.pri @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with Notepad Next. If not, see . -QT += core gui widgets gui-private +QT += core gui widgets windows { # MinGW @@ -73,9 +73,9 @@ SOURCES += \ unix:!macx { HEADERS += $$PWD/ads/src/linux/FloatingWidgetTitleBar.h SOURCES += $$PWD/ads/src/linux/FloatingWidgetTitleBar.cpp - INCLUDEPATH += $$PWD/ads/src/linux - QT += x11extras LIBS += -lxcb + QT += gui-private } + INCLUDEPATH += $$PWD/ads/src/ From dc0a45d28a8ff2208f1576f841076780d22db793 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Sun, 6 Mar 2022 16:51:09 -0500 Subject: [PATCH 07/11] Update build.yml --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afdf8afe6..80a80d3b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,9 @@ jobs: with: version: ${{ matrix.config.qt_version }} modules: ${{ matrix.config.modules }} + + - name: Setup + run: sudo apt-get install libxkbcommon-dev - name: Compile run: | From ee2d5f4442902f6a453a7900d5b7af1387e580a3 Mon Sep 17 00:00:00 2001 From: FollowerOfBigboss <78658591+FollowerOfBigboss@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:09:58 +0300 Subject: [PATCH 08/11] Use all cpu cores for compilation (#73) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80a80d3b1..a0fdd50fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: mkdir build-linux cd build-linux qmake ../src/NotepadNext.pro - make + make -j$(nproc) - name: Upload artifact uses: actions/upload-artifact@v2 From 1d5fb91e96589f2fa510a4ec1d9127bf709dd233 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Sat, 12 Mar 2022 12:37:13 -0500 Subject: [PATCH 09/11] Conditionally turn off folding margins Closes #40 --- src/NotepadNext/NotepadNextApplication.cpp | 1 + src/NotepadNext/languages/markdown.lua | 2 ++ src/NotepadNext/languages/text.lua | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/NotepadNext/NotepadNextApplication.cpp b/src/NotepadNext/NotepadNextApplication.cpp index 8f2206f99..e6b591f97 100644 --- a/src/NotepadNext/NotepadNextApplication.cpp +++ b/src/NotepadNext/NotepadNextApplication.cpp @@ -214,6 +214,7 @@ void NotepadNextApplication::setEditorLanguage(ScintillaNext *editor, const QStr editor.UseTabs = (L.tabSettings or "tabs") == "tabs" editor.TabWidth = L.tabSize or 4 + editor.MarginWidthN[2] = L.disableFoldMargin and 0 or 16 if L.styles then for name, style in pairs(L.styles) do editor.StyleFore[style.id] = style.fgColor diff --git a/src/NotepadNext/languages/markdown.lua b/src/NotepadNext/languages/markdown.lua index 35e9bdd42..38bcb1ab5 100644 --- a/src/NotepadNext/languages/markdown.lua +++ b/src/NotepadNext/languages/markdown.lua @@ -2,6 +2,8 @@ local L = {} L.lexer = "markdown" +L.disableFoldMargin = true + L.extensions = { "md", "markdown", diff --git a/src/NotepadNext/languages/text.lua b/src/NotepadNext/languages/text.lua index 70035ca64..b1f0930d6 100644 --- a/src/NotepadNext/languages/text.lua +++ b/src/NotepadNext/languages/text.lua @@ -3,6 +3,8 @@ local L = {} L.name = "Text" L.lexer = "null" +L.disableFoldMargin = true + L.extensions = { "", "txt", From 23052a36b7dac901b5b179e85a9bec8ffc043dc1 Mon Sep 17 00:00:00 2001 From: dail8859 Date: Mon, 14 Mar 2022 19:20:09 -0400 Subject: [PATCH 10/11] Build AppImage for Linux (#75) --- .github/workflows/build.yml | 15 +++++++++++++-- README.md | 8 ++++---- deploy/linux/NotepadNext.desktop | 9 +++++++++ doc/Building.md | 24 ++++++++++++++++++++---- icon/{nn.svg => NotepadNext.svg} | 0 src/NotepadNext.pro | 4 ++++ src/NotepadNext/NotepadNext.pro | 14 ++++++++++++++ 7 files changed, 64 insertions(+), 10 deletions(-) create mode 100644 deploy/linux/NotepadNext.desktop rename icon/{nn.svg => NotepadNext.svg} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0fdd50fb..0baf43813 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,11 +38,22 @@ jobs: qmake ../src/NotepadNext.pro make -j$(nproc) + - name: Build AppImage + run: | + cd build-linux + make install INSTALL_ROOT=AppDir + cd NotepadNext + wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" + chmod +x linuxdeploy*.AppImage + export OUTPUT=NotepadNext-x86_64.AppImage + ./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin qt --output appimage + - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }} - path: ${{ github.workspace }}/build-linux/NotepadNext/NotepadNext + name: NotepadNext-Linux-Qt${{ matrix.config.qt_version }}-AppImage + path: ${{ github.workspace }}/build-linux/NotepadNext/NotepadNext-x86_64.AppImage build-windows: strategy: diff --git a/README.md b/README.md index a7983e8d1..3da4dc606 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ -A cross-platform, reimplementation of Notepad++. +A cross-platform, reimplementation of Notepad++. Releases are available for Windows and Linux. Though the application overall is stable and usable, it should not be considered safe for critically important work. @@ -16,11 +16,11 @@ There are numerous bugs and half working implementations. Pull requests are grea ![screenshot](/doc/screenshot.png) # Development -Current development is done using Visual Studio 2019 and Qt v5.15. Other platforms/compilers have not been tested but should be usable with minor modifications. +Current development is done using Visual Studio 2019 and Qt v5.15 on Windows. This is known to build successfully on Ubuntu 21.10. Other Linux distributions are likely to work as well. Other platforms/compilers have not been tested but should be usable with minor modifications. -If you are familiar with building C++ Qt desktop applications, then this should be as simple as opening `src/NotepadNext.pro` and build/run the project. +If you are familiar with building C++ Qt desktop applications with Qt Creator, then this should be as simple as opening `src/NotepadNext.pro` and build/run the project. -If you are new to building C++ Qt desktop applications, there is a more detailed guide [here](/doc/Building.md) +If you are new to building C++ Qt desktop applications, there is a more detailed guide [here](/doc/Building.md). # License diff --git a/deploy/linux/NotepadNext.desktop b/deploy/linux/NotepadNext.desktop new file mode 100644 index 000000000..0eb5c1ea3 --- /dev/null +++ b/deploy/linux/NotepadNext.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Exec=NotepadNext +Comment=A cross-platform, reimplementation of Notepad++ +Type=Application +Icon=NotepadNext +Name=Notepad Next +StartupNotify=true +Terminal=false +Categories=Qt;TextEditor;Utility; diff --git a/doc/Building.md b/doc/Building.md index c21d14daa..153585312 100644 --- a/doc/Building.md +++ b/doc/Building.md @@ -2,7 +2,9 @@ To build Notepad Next you will need a compatible C++ compiler, the Qt libraries, and the Notepad Next source code. -This document specifically describes how to build Notepad Next using Microsoft's Visual Studio 2019 compiler. Other compilers and operating systems have not been tested, but should be possible with minor changes to the project files and source code. +# Windows + +This section specifically describes how to build Notepad Next using Microsoft's Visual Studio 2019 compiler. ## Installing Visual Studio 2019 @@ -22,7 +24,7 @@ This document specifically describes how to build Notepad Next using Microsoft's * `Developer and Design Tools` > `Qt Creator CDB Debugger Support` * `Developer and Design Tools` > `Debugging Tools for Windows` -# Cloning the Notepad Next Repository +## Cloning the Notepad Next Repository 1. In a command prompt (or git shell, powershell, etc) run: 1. `git clone --recurse-submodules https://github.com/dail8859/NotepadNext.git` @@ -30,9 +32,23 @@ This document specifically describes how to build Notepad Next using Microsoft's 1. `git checkout dev` -# Building/Running Notepad Next +## Building/Running Notepad Next 1. Open `src/NotepadNext.pro` with Qt Creator 1. Configure the project for 'Desktop Qt 5.15.2 MSVC2019 64bit' 1. Press `Ctrl+R` -1. Qt Creator will build and run the project. \ No newline at end of file +1. Qt Creator will build and run the project. + +# Linux + +Using a fresh Ubuntu 21.10 setup, the following script will install the needed dependencies and build the executable: + +``` +sudo apt install qtbase5-dev qt5-qmake qtbase5-dev-tools qtbase5-private-dev libqt5x11extras5-dev build-essential git +git clone --recurse-submodules https://github.com/dail8859/NotepadNext.git +cd NotepadNext +mkdir build +cd build +qmake ../src/NotepadNext.pro +make -j$(nproc) +``` \ No newline at end of file diff --git a/icon/nn.svg b/icon/NotepadNext.svg similarity index 100% rename from icon/nn.svg rename to icon/NotepadNext.svg diff --git a/src/NotepadNext.pro b/src/NotepadNext.pro index f100162e5..4195c9e0d 100644 --- a/src/NotepadNext.pro +++ b/src/NotepadNext.pro @@ -23,7 +23,9 @@ TEMPLATE = subdirs SUBDIRS = NotepadNext +# Extra Windows targets win32 { + # Package up the EXE with all the other needed files package.target = package package.commands = \ xcopy $$shell_path($${OUT_PWD}/NotepadNext/NotepadNext.exe) $$shell_path($${OUT_PWD}/package/) /Y && \ @@ -36,10 +38,12 @@ win32 { package.commands += windeployqt --release --no-translations --no-system-d3d-compiler --no-compiler-runtime --no-angle --no-opengl-sw $$shell_path($${OUT_PWD}/package/NotepadNext.exe) } + # Zip it up zip.target = zip zip.depends = package zip.commands = 7z a -tzip $$quote(NotepadNext-v$${APP_VERSION}.zip) $$shell_path(./package/*) -x!libssl-1_1-x64.dll -x!libcrypto-1_1-x64.dll + # Build the Installer installer.target = installer installer.depends = package installer.commands = makensis /V4 $$shell_path($${OUT_PWD}/../installer/installer.nsi) diff --git a/src/NotepadNext/NotepadNext.pro b/src/NotepadNext/NotepadNext.pro index abaffc6a4..60e8a97c4 100644 --- a/src/NotepadNext/NotepadNext.pro +++ b/src/NotepadNext/NotepadNext.pro @@ -187,3 +187,17 @@ OBJECTS_DIR = build/obj MOC_DIR = build/moc RCC_DIR = build/qrc UI_DIR = build/ui + +unix { + target.path = /usr/bin + INSTALLS += target + + desktopfile.path = /usr/share/applications/ + desktopfile.files += ../../deploy/linux/NotepadNext.desktop + INSTALLS += desktopfile + + iconscalable.path = /usr/share/icons/hicolor/scalable/mimetypes/ + iconscalable.files = ../../icon/NotepadNext.svg + INSTALLS += iconscalable +} + From 3b256666f7ea9ae44fd6fa9bc0f863b42e0d7f7a Mon Sep 17 00:00:00 2001 From: dail8859 Date: Thu, 17 Mar 2022 19:56:38 -0400 Subject: [PATCH 11/11] Prepare v0.4.9 release --- src/Version.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Version.pri b/src/Version.pri index 60c26b930..9da8cbe64 100644 --- a/src/Version.pri +++ b/src/Version.pri @@ -15,5 +15,5 @@ # along with Notepad Next. If not, see . -!defined(APP_VERSION, var):APP_VERSION = "0.4.8" +!defined(APP_VERSION, var):APP_VERSION = "0.4.9" APP_COPYRIGHT = "Copyright 2019-2022 Justin Dailey"