mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
Version 1.7.2 - Enhanced Themes & Bug Fixes
## New Features - Added 14 beautiful new themes (Dracula, Nord, One Dark, Atom One Light, Material, Gruvbox Dark/Light, Tokyo Night, Palenight, Ayu Dark/Light/Mirage, Oceanic Next, Cobalt2) - Total of 19 professionally-designed themes now available - All themes fully support glassmorphism effects from v1.7.1 ## Bug Fixes - Fixed undo/redo menu integration - connected Edit menu to custom undo/redo functionality - Added IPC event listeners for proper keyboard shortcut support (Ctrl+Z, Ctrl+Shift+Z) ## Technical Improvements - Complete CSS styling for all UI elements per theme (tabs, toolbar, editor, preview, status bar) - Theme-aware color schemes for syntax highlighting - Comprehensive CSS implementation (965+ lines for new themes) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
+40
-1
@@ -949,6 +949,7 @@ class TabManager {
|
||||
|
||||
// File operations
|
||||
openFile(filePath, content) {
|
||||
console.log('openFile called with:', filePath, 'content length:', content.length);
|
||||
let tab = this.tabs.get(this.activeTabId);
|
||||
|
||||
// Handle both forward and back slashes for cross-platform compatibility
|
||||
@@ -956,13 +957,21 @@ class TabManager {
|
||||
|
||||
// If current tab is empty and untitled, reuse it
|
||||
if (!tab.filePath && !tab.isDirty && tab.content === '') {
|
||||
console.log('Reusing current tab');
|
||||
tab.filePath = filePath;
|
||||
tab.title = fileName;
|
||||
tab.content = content;
|
||||
tab.originalContent = content;
|
||||
tab.isDirty = false;
|
||||
|
||||
// Update the editor immediately
|
||||
const editor = document.getElementById(`editor-${this.activeTabId}`);
|
||||
if (editor) {
|
||||
editor.value = content;
|
||||
}
|
||||
} else {
|
||||
// Create new tab for the file
|
||||
console.log('Creating new tab for file');
|
||||
this.createNewTab();
|
||||
tab = this.tabs.get(this.activeTabId);
|
||||
tab.filePath = filePath;
|
||||
@@ -970,12 +979,29 @@ class TabManager {
|
||||
tab.content = content;
|
||||
tab.originalContent = content;
|
||||
tab.isDirty = false;
|
||||
|
||||
// Wait a moment for the DOM to update, then set content
|
||||
setTimeout(() => {
|
||||
const editor = document.getElementById(`editor-${this.activeTabId}`);
|
||||
if (editor) {
|
||||
editor.value = content;
|
||||
this.updatePreview(this.activeTabId);
|
||||
this.updateWordCount();
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
this.restoreTabState(this.activeTabId);
|
||||
this.updatePreview(this.activeTabId);
|
||||
this.updateWordCount();
|
||||
this.startAutoSave();
|
||||
this.addToRecentFiles(filePath);
|
||||
this.updateTabBar();
|
||||
|
||||
// Notify main process about current file for exports
|
||||
const { ipcRenderer } = require('electron');
|
||||
ipcRenderer.send('set-current-file', filePath);
|
||||
|
||||
console.log('File opened successfully');
|
||||
}
|
||||
|
||||
getCurrentContent() {
|
||||
@@ -1078,6 +1104,19 @@ ipcRenderer.on('theme-changed', (event, theme) => {
|
||||
document.body.className = `theme-${theme}`;
|
||||
});
|
||||
|
||||
// Undo/Redo handlers
|
||||
ipcRenderer.on('undo', () => {
|
||||
if (tabManager) {
|
||||
tabManager.undo();
|
||||
}
|
||||
});
|
||||
|
||||
ipcRenderer.on('redo', () => {
|
||||
if (tabManager) {
|
||||
tabManager.redo();
|
||||
}
|
||||
});
|
||||
|
||||
// Font size adjustment
|
||||
let currentFontSize = parseInt(localStorage.getItem('fontSize')) || 15;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user