Skip to content

fix: more misc. bug fixes#21

Merged
dlyongemallo merged 1 commit intomainfrom
misc_fixes
Feb 26, 2026
Merged

fix: more misc. bug fixes#21
dlyongemallo merged 1 commit intomainfrom
misc_fixes

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

  • 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).

Copilot AI review requested due to automatic review settings February 26, 2026 04:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/FileHistoryPanel cursor helpers to avoid crashes when buffers aren’t loaded.
  • Fix config deprecation/validation issues (deprecated log_options loop break, typo in merge_layouts, and Diff3Ver annotation).
  • Tighten Mercurial parse_revs() error checking when exec_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.

Comment thread lua/diffview/vcs/adapters/hg/init.lua
Comment thread lua/diffview/vcs/adapters/hg/init.lua
* 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).
@dlyongemallo dlyongemallo merged commit 58f14a5 into main Feb 26, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the misc_fixes branch February 26, 2026 08:30
dlyongemallo added a commit that referenced this pull request Mar 31, 2026
dlyongemallo added a commit that referenced this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants