Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unlreleased

### Fixed

- Fixed selection to the right of code fence blocks (may break some snapshots)

## [8.2.5] - 2026-04-30

### Added
Expand Down
17 changes: 10 additions & 7 deletions src/textual/_compositor.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,13 +937,16 @@ def get_widget_and_offset_at(

from rich.cells import get_character_cell_size

offset: Offset | None = None
for segment in line:
end += segment.cell_length
style = segment.style
if style is not None and style._meta is not None:
meta = style.meta
if "offset" in meta:
offset_x, offset_y = style.meta["offset"]
offset_x, offset_y = meta["offset"]
if offset_y is None:
continue
offset_x2 = offset_x + len(segment.text)

if x < end and x >= start:
Expand All @@ -955,14 +958,14 @@ def get_widget_and_offset_at(
break
segment_cell_length += get_character_cell_size(character)
segment_offset += 1
return widget, (
None
if offset_y is None
else Offset(offset_x + segment_offset, offset_y)
)

offset = Offset(offset_x + segment_offset, offset_y)
break
start = end

return widget, (None if offset_y is None else Offset(offset_x2, offset_y))
if offset is None and offset_y is not None:
offset = Offset(offset_x2, offset_y)
return widget, offset

def find_widget(self, widget: Widget) -> MapGeometry:
"""Get information regarding the relative position of a widget in the Compositor.
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def set_content(self, content: Content) -> None:
self.query_one("#code-content", Label).update(content)

def compose(self) -> ComposeResult:
yield Label(self._highlighted_code, id="code-content")
yield Label(self._highlighted_code, id="code-content", expand=True)


NUMERALS = " ⅠⅡⅢⅣⅤⅥ"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading