Conversation
…rArea implementation to separate files - Removed the old LineNumberArea.cpp file and added a new QLineNumberArea.cpp and QLineNumberArea.h. - Updated CMakeLists.txt to reflect the new file structure and include necessary headers.
- Implemented line numbering in QDiffTextBrowser by adding a QLineNumberArea. - Updated the constructor and added methods for calculating line number area width and handling paint events. - Refactored the header file to include necessary declarations and updated the namespace to QDiffX.
- Increase padding and improve styling for line numbers - Add dynamic font size adjustment based on widget height - Replace QTextBrowser with QDiffTextBrowser for both sides - Set initial content and geometry in main.cpp
Add functionality to display and highlight diff results with different colors for insertions, deletions and replacements. Store line operations in a map and apply appropriate formatting when rendering the text. Also includes basic setup for line number area connections and document properties.
…vent Add background color highlighting for lines based on their operation
…ants for better maintainability
…ghlighting and organize in static constants
- Add destructor to properly clean up line number area - Refactor line number painting to use visual position calculations - Add top/bottom margin constant and apply consistent spacing - Remove redundant comments and improve code clarity
…est on visual studio
Clean up source files by removing completed or no longer relevant TODO comments that were cluttering the code
…ove redundant line number calculation
…cause of the different Compatibility problems dmp has with other algorithms
…splay on the QDiffTextBroeser - Change visibility of diff_linesToChars and diff_charsToLines from protected/private to public - Remove unused diffCharByChar method - Fix line number calculation and newline handling in QDiffTextBrowser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces significant enhancements to the
QDiffTextBrowsercomponent and improves the internal diffing logic inDMPAlgorithmandDTLAlgorithm🔧 Key Changes
📘 QDiffTextBrowser Integration
QDiffTextBrowserclass based onQTextBrowserfor visual diff rendering.QLineNumberAreafor displaying line numbers.paintEvent⚙️ Diff Algorithm Updates
DMPAlgorithm.DTLAlgorithm.DMPto improve modularity.🛠 Build Improvements
LINE_NUMBER_TEXT_WIDTH_RATIO) to avoid magic numbers.