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
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ and the project uses [Semantic Versioning](https://semver.org/).
- Automatic updates — the updater plugin and keys must be bundled, so this
has to be decided before the first release that should support it

## [0.6.1] — 2026-09-22

### Fixed
- **Mouse, keyboard and Vim selections are reliably visible on every line.**
The opaque active-line highlight previously covered CodeMirror's selection
layer, making a drag within the current line appear broken even though the
text was selected. Rui now removes that covering highlight while a selection
exists and enforces a clear selection/background contrast in light, dark and
imported Omarchy themes.

## [0.6.0] — 2026-09-04

### Changed
Expand Down Expand Up @@ -970,7 +980,8 @@ Erste Veröffentlichung.
- Builds sind unsigniert, SmartScreen warnt beim ersten Start
- Sinnvolle Dateigrösse bei rund 25 MB gedeckelt

[Unveröffentlicht]: https://github.com/jli-software/Rui/compare/v0.6.0...HEAD
[Unveröffentlicht]: https://github.com/jli-software/Rui/compare/v0.6.1...HEAD
[0.6.1]: https://github.com/jli-software/Rui/compare/v0.6.0...v0.6.1
[0.6.0]: https://github.com/jli-software/Rui/compare/v0.5.4...v0.6.0
[0.5.4]: https://github.com/jli-software/Rui/compare/v0.5.3...v0.5.4
[0.5.3]: https://github.com/jli-software/Rui/compare/v0.5.2...v0.5.3
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rui",
"private": true,
"version": "0.6.0",
"version": "0.6.1",
"description": "A lean text editor for snippets and notes",
"license": "MIT",
"author": "Jonas Gaiching",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rui"
version = "0.6.0"
version = "0.6.1"
description = "A lean text editor for snippets and notes"
authors = ["Jonas Gaiching"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Rui",
"version": "0.6.0",
"version": "0.6.1",
"identifier": "ch.gaiching.rui",
"build": {
"beforeDevCommand": "npm run dev",
Expand Down
9 changes: 9 additions & 0 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ export class RuiEditor {
// nichts mitläuft, das dieser Editor nicht braucht.
history(),
drawSelection(),
// The active-line background lives in the document layer, while
// CodeMirror draws selections behind it. Mark non-empty selections
// on the editor root so the theme can stop the active line from
// covering a same-line mouse or Vim selection.
EditorView.editorAttributes.of((view) => ({
class: view.state.selection.ranges.some((range) => !range.empty)
? "cm-has-selection"
: "",
})),
dropCursor(),
rectangularSelection(),
crosshairCursor(),
Expand Down
14 changes: 11 additions & 3 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ function highlightStyle(p: Palette) {

/** Erzeugt das komplette CodeMirror-Theme aus einer Palette. */
export function editorTheme(p: Palette, dark: boolean): Extension {
// CodeMirror's drawn selection is a layer behind the document. Keep the
// colour visibly distinct even when an imported palette provides a shade
// too close to the editor background.
const selection = ensureContrast(p.selection, p.bg, 2, p.text);
const view = EditorView.theme(
{
"&": {
Expand All @@ -405,9 +409,13 @@ export function editorTheme(p: Palette, dark: boolean): Extension {
},
"&.cm-focused .cm-selectionBackgroundPrimary, .cm-selectionBackground, .cm-content ::selection":
{
backgroundColor: `${p.selection} !important`,
backgroundColor: `${selection} !important`,
},
".cm-activeLine": { backgroundColor: p.activeLine },
// `.cm-activeLine` is part of the content layer and therefore covers
// CodeMirror's selection layer when both are opaque. That made a drag
// confined to the active line look as if no selection had happened.
"&.cm-has-selection .cm-activeLine": { backgroundColor: "transparent" },
".cm-gutters": {
backgroundColor: p.bg,
color: p.gutter,
Expand All @@ -430,9 +438,9 @@ export function editorTheme(p: Palette, dark: boolean): Extension {
outline: `1px solid ${p.accent}`,
},
".cm-nonmatchingBracket": { color: p.danger },
".cm-selectionMatch": { backgroundColor: p.selection },
".cm-selectionMatch": { backgroundColor: selection },
".cm-searchMatch": {
backgroundColor: p.selection,
backgroundColor: selection,
outline: `1px solid ${p.border}`,
},
".cm-searchMatch.cm-searchMatch-selected": {
Expand Down