Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f6c4a5ab34 | |||
| 35ef74910d | |||
| b17672d440 |
@@ -4,7 +4,7 @@ project(kte)
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(KTE_VERSION "1.3.2")
|
set(KTE_VERSION "1.3.5")
|
||||||
|
|
||||||
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
# Default to terminal-only build to avoid SDL/OpenGL dependency by default.
|
||||||
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
# Enable with -DBUILD_GUI=ON when SDL2/OpenGL/Freetype are available.
|
||||||
|
|||||||
23
Command.cc
23
Command.cc
@@ -957,7 +957,9 @@ cmd_theme_set_by_name(const CommandContext &ctx)
|
|||||||
ltrim(name);
|
ltrim(name);
|
||||||
rtrim(name);
|
rtrim(name);
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
ctx.editor.SetStatus("theme: missing name");
|
// Show current theme when no argument provided
|
||||||
|
ctx.editor.SetStatus(
|
||||||
|
std::string("Current theme: ") + kte::CurrentThemeName());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (kte::ApplyThemeByName(name)) {
|
if (kte::ApplyThemeByName(name)) {
|
||||||
@@ -1011,7 +1013,12 @@ cmd_font_set_by_name(const CommandContext &ctx)
|
|||||||
return (char) std::tolower(c);
|
return (char) std::tolower(c);
|
||||||
});
|
});
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
ctx.editor.SetStatus("font: missing name");
|
// Show current font when no argument provided
|
||||||
|
auto ® = FontRegistry::Instance();
|
||||||
|
std::string current_font = reg.CurrentFontName();
|
||||||
|
if (current_font.empty())
|
||||||
|
current_font = "default";
|
||||||
|
ctx.editor.SetStatus(std::string("Current font: ") + current_font);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1062,7 +1069,17 @@ cmd_font_set_size(const CommandContext &ctx)
|
|||||||
ltrim(a);
|
ltrim(a);
|
||||||
rtrim(a);
|
rtrim(a);
|
||||||
if (a.empty()) {
|
if (a.empty()) {
|
||||||
ctx.editor.SetStatus("font-size: missing value");
|
// Show current font size when no argument provided
|
||||||
|
auto ® = FontRegistry::Instance();
|
||||||
|
float current_size = reg.CurrentFontSize();
|
||||||
|
if (current_size <= 0.0f) {
|
||||||
|
// Fallback to current ImGui font size if available
|
||||||
|
current_size = ImGui::GetFontSize();
|
||||||
|
if (current_size <= 0.0f)
|
||||||
|
current_size = 16.0f;
|
||||||
|
}
|
||||||
|
ctx.editor.SetStatus(
|
||||||
|
std::string("Current font size: ") + std::to_string((int) std::round(current_size)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
char *endp = nullptr;
|
char *endp = nullptr;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ enum class ThemeId {
|
|||||||
|
|
||||||
// Current theme tracking
|
// Current theme tracking
|
||||||
static inline auto gCurrentTheme = ThemeId::Nord;
|
static inline auto gCurrentTheme = ThemeId::Nord;
|
||||||
static inline std::size_t gCurrentThemeIndex = 0;
|
static inline std::size_t gCurrentThemeIndex = 6; // Nord index
|
||||||
|
|
||||||
// Forward declarations for helpers used below
|
// Forward declarations for helpers used below
|
||||||
static size_t ThemeIndexFromId(ThemeId id);
|
static size_t ThemeIndexFromId(ThemeId id);
|
||||||
|
|||||||
@@ -23,5 +23,6 @@
|
|||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>10.13</string>
|
<string>10.13</string>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
Reference in New Issue
Block a user