Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [editor] Add encoding detection and conversion support #1008

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ Build-Depends:
libdtkcore5-bin,
libkf5syntaxhighlighting-dev,
libyaml-cpp-dev,
libcmark-dev
libcmark-dev,
libchardet-dev,
libuchardet-dev (>= 0.0.6),
libicu-dev
Standards-version: 3.9.8
Homepage: http://www.deepin.org

Expand Down
9 changes: 9 additions & 0 deletions src/plugins/codeeditor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ set(CMAKE_INCLUDE_CURRENT_DIR true)

add_definitions(-DLIBRARY_INSTALL_PREFIX="${LIBRARY_INSTALL_PREFIX}")

find_package(ICU COMPONENTS i18n uc REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CMARK REQUIRED libcmark)
pkg_check_modules(CHARDET REQUIRED chardet)
pkg_check_modules(UCHARDET REQUIRED uchardet)

FILE(GLOB_RECURSE PROJECT_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
Expand All @@ -31,6 +34,8 @@ add_library(${PROJECT_NAME}
target_include_directories(${PROJECT_NAME}
PUBLIC
${CMARK_INCLUDE_DIRS}
${CHARDET_INCLUDE_DIRS}
${UCHARDET_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
Expand All @@ -42,6 +47,10 @@ target_link_libraries(${PROJECT_NAME}
${PkgUserModules}
${DtkWidget_LIBRARIES}
${CMARK_LIBRARIES}
${CHARDET_LIBRARIES}
${UCHARDET_LIBRARIES}
ICU::i18n
ICU::uc
)

install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${PLUGIN_INSTALL_PATH})
2 changes: 1 addition & 1 deletion src/plugins/codeeditor/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "lexer/lexermanager.h"
#include "utils/editorutils.h"
#include "utils/resourcemanager.h"
#include "status/statusinfomanager.h"
#include "statusbar/statusinfomanager.h"
#include "symbol/symbollocator.h"
#include "symbol/symbolwidget.h"

Expand Down
1 change: 1 addition & 0 deletions src/plugins/codeeditor/codeeditor.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,6 @@
<file>icons/deepin/builtin/light/icons/arrow_14px.svg</file>
<file>icons/deepin/builtin/light/icons/breakpoint_14px.svg</file>
<file>icons/deepin/builtin/light/icons/disabled_breakpoint_14px.svg</file>
<file>encodes/encodes.ini</file>
</qresource>
</RCC>
Loading
Loading