[PR #18376] Fix Empty WordDelimiters Handling in IsWordDelim and DelimiterClass #31517

Open
opened 2026-01-31 09:47:46 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/18376

State: closed
Merged: No


Summary of the Pull Request

This pull request addresses the handling of empty WordDelimiters lists to ensure stable and predictable behavior across all relevant functions.

References and Relevant Issues

N/A

Detailed Description of the Pull Request / Additional Comments

  • IsWordDelim function updates:

    • Added a condition to check if WordDelimiters is empty before proceeding with the standard logic.
    • Ensures that the function remains compatible with existing behavior while handling edge cases more effectively.
  • DelimiterClass function updates:

    • Similar logic applied to avoid unnecessary operations if WordDelimiters is empty.
    • Maintains compatibility and prevents errors related to uninitialized or empty delimiter lists.

These updates improve the stability of the codebase and align with best practices for handling potentially undefined states.

Validation Steps Performed

  • Verified the behavior of IsWordDelim and DelimiterClass with both empty and non-empty WordDelimiters.
  • Conducted manual testing to ensure there are no regressions or unexpected changes in functionality.

PR Checklist

  • Closes N/A
  • Tests added/passed: Verified functionality with both empty and non-empty WordDelimiters.
  • Documentation updated: No documentation updates required for this change.
  • Schema updated (if necessary): Not applicable.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/18376 **State:** closed **Merged:** No --- ### Summary of the Pull Request This pull request addresses the handling of empty WordDelimiters lists to ensure stable and predictable behavior across all relevant functions. ## References and Relevant Issues N/A ## Detailed Description of the Pull Request / Additional Comments - **`IsWordDelim` function updates:** - Added a condition to check if `WordDelimiters` is empty before proceeding with the standard logic. - Ensures that the function remains compatible with existing behavior while handling edge cases more effectively. - **`DelimiterClass` function updates:** - Similar logic applied to avoid unnecessary operations if `WordDelimiters` is empty. - Maintains compatibility and prevents errors related to uninitialized or empty delimiter lists. These updates improve the stability of the codebase and align with best practices for handling potentially undefined states. ## Validation Steps Performed - Verified the behavior of `IsWordDelim` and `DelimiterClass` with both empty and non-empty `WordDelimiters`. - Conducted manual testing to ensure there are no regressions or unexpected changes in functionality. ## PR Checklist - [x] Closes N/A - [x] Tests added/passed: Verified functionality with both empty and non-empty `WordDelimiters`. - [x] Documentation updated: No documentation updates required for this change. - [ ] Schema updated (if necessary): Not applicable.
claunia added the pull-request label 2026-01-31 09:47:46 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31517