Skip to content

Commit 60c335e

Browse files
committed
Better performance (for heads and inline image extensions), GUI
optimization and settings bug fix.
1 parent e70882f commit 60c335e

33 files changed

+2098
-959
lines changed

.gitignore

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
.DS_Store
22

3-
re2/CMakeFiles/
4-
re2/Makefile
5-
re2/install_manifest.txt
6-
re2/cmake_install.cmake
7-
re2/CMakeCache.txt
3+
## User settings
4+
xcuserdata/
5+
jpcre2.xcodeproj/xcuserdata/
6+
pcre2.xcodeproj/xcuserdata/*
7+
8+
highlight-wrapper/GoUtils/.idea/
89

910
/*/.idea/
1011

.gitmodules

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[submodule "highlight-wrapper/highlight"]
22
path = highlight-wrapper/highlight
33
url = https://gitlab.com/saalen/highlight.git
4-
[submodule "re2"]
5-
path = re2
6-
url = https://github.com/google/re2.git
4+
[submodule "jpcre2"]
5+
path = jpcre2
6+
url = https://github.com/jpcre2/jpcre2
7+
[submodule "pcre2"]
8+
path = pcre2
9+
url = https://github.com/PhilipHazel/pcre2

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Changelog
22

33

4+
### 1.0.10 (35)
5+
New features:
6+
- Better performance for heads extension.
7+
- Better performance for inline images on raw html fragments.
8+
- Option for automatic saving of settings changes.
9+
- GUI optimization.
10+
Bugfix:
11+
- Fixed settings save.
12+
413
### 1.0.9 (34)
514
New features:
615
- Experimental support for defining the size of the Quick Look window.

MakefileJPCRE

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
.DEFAULT_GOAL := all
2+
3+
SPACE := $(null) $(null)
4+
CURRENT_DIR := $(subst $(SPACE),"\\ ",$(CURDIR))
5+
6+
ifeq ($(BUILT_PRODUCTS_DIR),)
7+
BUILD_DIR=${CURRENT_DIR}/build
8+
else
9+
BUILD_DIR=${BUILT_PRODUCTS_DIR}
10+
endif
11+
12+
ifeq ($(ONLY_ACTIVE_ARCH),)
13+
ONLY_ACTIVE_ARCH=NO
14+
endif
15+
16+
CXX=clang++
17+
CFLAGS=-I "${CURRENT_DIR}"
18+
19+
bold := $(shell tput bold 2> /dev/null)
20+
normal := $(shell tput sgr0 2> /dev/null)
21+
22+
ifndef NATIVE_ARCH
23+
NATIVE_ARCH := $(shell uname -m)
24+
# $(error NATIVE_ARCH is not set)
25+
endif
26+
27+
CFLAGS+= -I "${BUILD_DIR}/pcre2-${NATIVE_ARCH}"
28+
29+
jpcre_files =
30+
31+
ifeq ($(NATIVE_ARCH),x86_64)
32+
libpcre_files += ${BUILD_DIR}/pcre2-x86_64/lib/libpcre2-32.a
33+
else
34+
libpcre_files += ${BUILD_DIR}/pcre2-arm64/lib/libpcre2-32.a
35+
endif
36+
37+
ifeq ($(ONLY_ACTIVE_ARCH),NO)
38+
ifeq ($(NATIVE_ARCH),x86_64)
39+
# build arm code
40+
libpcre_files += ${BUILD_DIR}/pcre2-arm64/lib/libpcre2-32.a
41+
else
42+
# build intel code
43+
libpcre_files += ${BUILD_DIR}/pcre2-x86_64/lib/libpcre2-32.a
44+
endif
45+
endif
46+
47+
clean:
48+
@echo "${bold}Cleaning libpcre…${normal}"
49+
${MAKE} clean
50+
51+
@rm -r "${BUILD_DIR}/jpcre2.hpp" 2> /dev/null
52+
@echo ""
53+
54+
libpcre2: ${BUILD_DIR}/libpcre2-32.a
55+
configure: ${CURRENT_DIR}/configure
56+
57+
${CURRENT_DIR}/configure:
58+
@echo "${bold}Generating the configure tool…${normal}"
59+
./autogen.sh
60+
61+
62+
${BUILD_DIR}/jpcre2/include/jpcre2.hpp: | configure
63+
@echo "${bold}Building jpcre2.hpp…${normal}"
64+
./configure CFLAGS="-I${BUILD_DIR}/pcre2-${NATIVE_ARCH}/include" CXXFLAGS="-I${BUILD_DIR}/pcre2-${NATIVE_ARCH}/include" --prefix="${BUILD_DIR}/jpcre2" --enable-cpp11
65+
${MAKE} clean
66+
${MAKE}
67+
${MAKE} install
68+
@echo ""
69+
70+
${BUILD_DIR}/jpcre2.hpp: ${BUILD_DIR}/jpcre2/include/jpcre2.hpp
71+
@echo "${bold}Creating jpcre2.hpp…${normal}"
72+
@rm -f "${BUILD_DIR}/jpcre2.hpp" > /dev/null
73+
ln "${BUILD_DIR}/jpcre2/include/jpcre2.hpp" "${BUILD_DIR}/jpcre2.hpp"
74+
@echo ""
75+
76+
jpcre2.hpp: ${BUILD_DIR}/jpcre2.hpp
77+
78+
all: jpcre2.hpp
79+
install: jpcre2.hpp
80+

MakefilePCRE

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
.DEFAULT_GOAL := all
2+
3+
SPACE := $(null) $(null)
4+
CURRENT_DIR := $(subst $(SPACE),"\\ ",$(CURDIR))
5+
6+
ifeq ($(BUILT_PRODUCTS_DIR),)
7+
BUILD_DIR=${CURRENT_DIR}/build
8+
else
9+
BUILD_DIR=${BUILT_PRODUCTS_DIR}
10+
endif
11+
12+
ifeq ($(ONLY_ACTIVE_ARCH),)
13+
ONLY_ACTIVE_ARCH=NO
14+
endif
15+
16+
CXX=clang++
17+
CFLAGS=
18+
LDFLAGS=
19+
20+
CFLAGS_x86_64=-target x86_64-apple-macos10.15
21+
CFLAGS_arm64=-target arm64-apple-macos11
22+
23+
LDFLAGS_x86_64=-target x86_64-apple-macos10.15
24+
LDFLAGS_arm64=-target arm64-apple-macos11
25+
26+
ifeq ($(CONFIGURATION),Debug)
27+
CFLAGS_x86_64+= -g
28+
CFLAGS_arm64+= -g
29+
else
30+
CFLAGS_x86_64+= -DNDEBUG
31+
CFLAGS_arm64+= -DNDEBUG
32+
endif
33+
34+
bold := $(shell tput bold 2> /dev/null)
35+
normal := $(shell tput sgr0 2> /dev/null)
36+
37+
ifndef NATIVE_ARCH
38+
NATIVE_ARCH := $(shell uname -m)
39+
# $(error NATIVE_ARCH is not set)
40+
endif
41+
42+
VALID_ARCHS = x86_64 arm64
43+
44+
libpcre_files =
45+
46+
ifeq ($(NATIVE_ARCH),x86_64)
47+
libpcre_files += ${BUILD_DIR}/pcre2-x86_64/lib/libpcre2-32.a
48+
else
49+
libpcre_files += ${BUILD_DIR}/pcre2-arm64/lib/libpcre2-32.a
50+
endif
51+
52+
ifeq ($(ONLY_ACTIVE_ARCH),NO)
53+
ifeq ($(NATIVE_ARCH),x86_64)
54+
# build arm code
55+
libpcre_files += ${BUILD_DIR}/pcre2-arm64/lib/libpcre2-32.a
56+
else
57+
# build intel code
58+
libpcre_files += ${BUILD_DIR}/pcre2-x86_64/lib/libpcre2-32.a
59+
endif
60+
endif
61+
62+
check_arch:
63+
# @echo NATIVE_ARCH IS $(NATIVE_ARCH)
64+
ifeq ($(filter $(NATIVE_ARCH),$(VALID_ARCHS)),)
65+
$(error "Current arch ${NATIVE_ARCH} is not supported! Valid archs are: ${VALID_ARCHS}.")
66+
endif
67+
ifeq ($(ONLY_ACTIVE_ARCH),NO)
68+
@echo "Building universal binary"
69+
else
70+
@echo "Building $(NATIVE_ARCH) architecture"
71+
endif
72+
@echo ""
73+
74+
clean:
75+
@echo "${bold}Cleaning libpcre…${normal}"
76+
${MAKE} clean
77+
78+
@rm -r "${BUILD_DIR}/pcre2-arm64/" 2> /dev/null
79+
@rm -r "${BUILD_DIR}/pcre2-x86_64/" 2> /dev/null
80+
@rm "${BUILD_DIR}/libpcre2-32.a" 2> /dev/null
81+
@rm "${BUILD_DIR}/pcre2.h" 2> /dev/null
82+
@echo ""
83+
84+
libpcre2: ${BUILD_DIR}/libpcre2-32.a
85+
configure: ${CURRENT_DIR}/configure
86+
87+
${CURRENT_DIR}/configure:
88+
@echo "${bold}Generating the configure tool…${normal}"
89+
./autogen.sh
90+
91+
${BUILD_DIR}/pcre2-arm64/lib/libpcre2-32.a: | configure
92+
@echo "${bold}Building libpcre2 for arm64 platform…${normal}"
93+
./configure CFLAGS="${CFLAGS_arm64}" LDFLAGS="${LDFLAGS_arm64}" --enable-jit --enable-pcre2-32 --enable-static --disable-shared --disable-pcre2-8 --prefix="${BUILD_DIR}/pcre2-arm64" --host arm64-apple-macos11
94+
${MAKE} clean
95+
${MAKE}
96+
${MAKE} install
97+
@echo ""
98+
99+
${BUILD_DIR}/pcre2-x86_64/lib/libpcre2-32.a: | configure
100+
@echo "${bold}Building libpcre2 for intel platform…${normal}"
101+
./configure CFLAGS="${CFLAGS_x86_64}" LDFLAGS="${LDFLAGS_x86_64}" --enable-jit --enable-pcre2-32 --enable-static --disable-shared --disable-pcre2-8 --prefix="${BUILD_DIR}/pcre2-x86_64" --host x86_64-apple-macos10.15
102+
${MAKE} clean
103+
${MAKE}
104+
${MAKE} install
105+
@echo ""
106+
107+
${BUILD_DIR}/libpcre2-32.a: ${libpcre_files}
108+
ifeq ($(ONLY_ACTIVE_ARCH),NO)
109+
@echo "${bold}Creating libpcre2 universal library…${normal}"
110+
lipo -create -output "${BUILD_DIR}/libpcre2-32.a" "${BUILD_DIR}/pcre2-x86_64/lib/libpcre2-32.a" "${BUILD_DIR}/pcre2-arm64/lib/libpcre2-32.a"
111+
else
112+
@echo "${bold}Creating libpcre2 library for ${NATIVE_ARCH}…${normal}"
113+
@rm -f "${BUILD_DIR}/libpcre2-32.a" > /dev/null
114+
ln "${BUILD_DIR}/pcre2-${NATIVE_ARCH}/lib/libpcre2-32.a" "${BUILD_DIR}/libpcre2-32.a"
115+
endif
116+
@echo ""
117+
118+
pcre2.h: ${BUILD_DIR}/pcre2.h
119+
120+
${BUILD_DIR}/pcre2.h: ${BUILD_DIR}/libpcre2-32.a
121+
@rm -f "${BUILD_DIR}/pcre2.h" > /dev/null
122+
ln "${BUILD_DIR}/pcre2-${NATIVE_ARCH}/include/pcre2.h" "${BUILD_DIR}/pcre2.h"
123+
124+
all: check_arch libpcre2 pcre2.h
125+
install: check_arch libpcre2 pcre2.h
126+

MakefileRe2

-96
This file was deleted.

0 commit comments

Comments
 (0)