diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b915a01e2..0baf43813 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.3"
+ modules: "qt5compat"
+
runs-on: ubuntu-latest
steps:
@@ -14,7 +24,11 @@ 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: Setup
+ run: sudo apt-get install libxkbcommon-dev
- name: Compile
run: |
@@ -22,13 +36,24 @@ jobs:
mkdir build-linux
cd build-linux
qmake ../src/NotepadNext.pro
- make
+ 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
- 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:
@@ -38,7 +63,7 @@ jobs:
qt_version: "5.15.2"
modules: ""
-
- qt_version: "6.2.2"
+ qt_version: "6.2.3"
modules: "qt5compat"
runs-on: windows-latest
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/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
diff --git a/src/NotepadNext.pro b/src/NotepadNext.pro
index 7c4f04ee0..4195c9e0d 100644
--- a/src/NotepadNext.pro
+++ b/src/NotepadNext.pro
@@ -17,17 +17,15 @@
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
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 && \
@@ -40,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
+}
+
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/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",
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",
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"
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/