Merged
Conversation
Owner
dlyongemallo
commented
Feb 26, 2026
- Fix get_style() returning only the first matching style attribute instead of all of them (e.g. "bold" instead of "bold,strikethrough").
- Fix inverted guard conditions in FilePanel and FileHistoryPanel get_item_at_cursor/get_dir_at_cursor that could crash when the panel buffer wasn't loaded.
- Fix unconditional break in deprecated config warning loop that prevented "multi_file" from ever being checked.
- Fix HgAdapter.parse_revs error check that silently skipped failures when exec_sync returned nil.
- Fix typo: merge_layuots -> merge_layouts in config validation
- Fix Diff3Ver type annotation (was incorrectly Diff3Hor).
There was a problem hiding this comment.
Pull request overview
This PR addresses several small but impactful correctness issues across Diffview’s highlighting utilities, panel cursor helpers, config validation, and Mercurial revision parsing—primarily fixing incorrect guard logic and improving parsing/validation behavior.
Changes:
- Fix
hl.get_style()to return all matching style attributes (comma-separated) instead of only the first match. - Correct inverted guard conditions in
FilePanel/FileHistoryPanelcursor helpers to avoid crashes when buffers aren’t loaded. - Fix config deprecation/validation issues (deprecated
log_optionsloop break, typo inmerge_layouts, andDiff3Verannotation). - Tighten Mercurial
parse_revs()error checking whenexec_sync()fails.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/diffview/vcs/adapters/hg/init.lua | Adjusts parse_revs() error checks when exec_sync() fails. |
| lua/diffview/scene/views/file_history/file_history_panel.lua | Fixes guard condition for get_item_at_cursor() to prevent crashes. |
| lua/diffview/scene/views/diff/file_panel.lua | Fixes guard conditions for cursor-based lookup helpers to prevent crashes. |
| lua/diffview/hl.lua | Fixes style attribute aggregation to return all matching styles. |
| lua/diffview/config.lua | Fixes deprecated config warning loop and corrects layout validation variable naming typo. |
| lua/diffview/actions.lua | Fixes Diff3Ver type annotation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Fix get_style() returning only the first matching style attribute instead of all of them (e.g. "bold" instead of "bold,strikethrough"). * Fix inverted guard conditions in FilePanel and FileHistoryPanel get_item_at_cursor/get_dir_at_cursor that could crash when the panel buffer wasn't loaded. * Fix unconditional break in deprecated config warning loop that prevented "multi_file" from ever being checked. * Fix HgAdapter.parse_revs error check that silently skipped failures when exec_sync returned nil. * Fix typo: merge_layuots -> merge_layouts in config validation * Fix Diff3Ver type annotation (was incorrectly Diff3Hor).
0191fe5 to
559b8fe
Compare
dlyongemallo
added a commit
that referenced
this pull request
Mar 31, 2026
dlyongemallo
added a commit
that referenced
this pull request
Mar 31, 2026
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.