Compare commits

..

No commits in common. "local/libcosmic-path-patch" and "pre-1.6-merge-20260819" have entirely different histories.

46 changed files with 1275 additions and 1926 deletions

View file

@ -1,10 +1,8 @@
Replace this text with a description of your changes, and why these changes are important. Read and acknowledge the list below. PRs without a completed checkbox will be closed.
- [ ] I have disclosed use of any AI generated code in my commit messages.
- If you are using an LLM, and do not fully understand the changes it is making to the code base, do not create a PR.
- In our experience, AI generated code often results in overly complex code that lacks enough context for a proper fix or feature inclusion. This results in considerably longer code reviews. Due to this, AI authored or partially authored PRs may be closed without comment.
- [ ] I understand these changes in full and will be able to respond to review comments.
- [ ] My change is accurately described in the commit message.
- [ ] My contribution is tested and working as described.
- [ ] I have read the [Developer Certificate of Origin](https://developercertificate.org/) and certify my contribution under its conditions.
---
- I have not included any LLM (also known as AI) generated content in this PR, including code, comments, and descriptions.
- I understand these changes in full and will be able to respond to review comments.
- My change is accurately described in the commit message.
- My contribution is tested and working as described.
- I have read the [Developer Certificate of Origin](https://developercertificate.org/) and certify my contribution under its conditions.
- [ ] I have read and followed all of the above requirements. For more information, see our [contributor guide](https://github.com/pop-os/pop/blob/master/CONTRIBUTING.md).

View file

@ -1,47 +0,0 @@
name: Continuous integration
on:
push:
branches: [master]
pull_request:
env:
CARGO_TERM_COLOR: always
DEBIAN_FRONTEND: noninteractive
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: install toolchain
run: rustup toolchain install nightly --component rustfmt
- name: fmt
run: cargo +nightly fmt --all --check
clippy:
name: Clippy
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: install system dependencies
run: sudo apt-get update && sudo apt-get install -y pkg-config libglib2.0-dev libxkbcommon-dev libwayland-dev
- name: install toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
- name: clippy
run: cargo clippy --all-features --all-targets -- -D warnings
test:
name: Test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: install system dependencies
run: sudo apt-get update && sudo apt-get install -y pkg-config libglib2.0-dev libxkbcommon-dev libwayland-dev
- name: install toolchain
run: rustup show
- uses: Swatinem/rust-cache@v2
- name: test
run: cargo test --all-features

View file

@ -1,14 +0,0 @@
# From https://github.com/mheap/require-checklist-action, license MIT
name: Require Checklist
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
job1:
runs-on: ubuntu-latest
steps:
- uses: mheap/require-checklist-action@v2
with:
requireChecklist: true

1804
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "cosmic-edit"
version = "1.10.0"
version = "1.3.0"
authors = ["Jeremy Soller <jeremy@system76.com>"]
edition = "2024"
license = "GPL-3.0-only"

View file

@ -1,70 +0,0 @@
cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
# Compile with debug profile
[no-cd]
build-debug *args:
cargo build {{args}}
# Compile with release profile
[no-cd]
build-release *args: (build-debug '--release' args)
# Compile with a vendored tarball
[no-cd]
build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
# Check for errors and linter warnings
[no-cd]
check *args:
cargo clippy --all-features {{args}} -- -W clippy::pedantic
# Runs a check with JSON message format for IDE integration
[no-cd]
check-json: (check '--message-format=json')
# Remove Cargo build artifacts
[no-cd]
clean:
cargo clean
# Also remove .cargo and vendored dependencies
[no-cd]
clean-dist: clean
rm -rf .cargo vendor vendor.tar target
# Run the application for testing purposes
[no-cd]
run *args:
cargo run {{args}}
# Run `cargo test`
[no-cd]
test *args:
cargo test {{args}}
# Vendor Cargo dependencies locally
[no-cd]
vendor:
#!/usr/bin/env bash
mkdir -p .cargo
cargo vendor --locked | head -n -1 > .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
echo >> .cargo/config.toml
echo '[env]' >> .cargo/config.toml
if [ -n "${SOURCE_DATE_EPOCH}" ]
then
source_date="$(date -d "@${SOURCE_DATE_EPOCH}" "+%Y-%m-%d")"
echo "VERGEN_GIT_COMMIT_DATE = \"${source_date}\"" >> .cargo/config.toml
fi
if [ -n "${SOURCE_GIT_HASH}" ]
then
echo "VERGEN_GIT_SHA = \"${SOURCE_GIT_HASH}\"" >> .cargo/config.toml
fi
tar pcf vendor.tar .cargo vendor
rm -rf .cargo vendor
# Extracts vendored dependencies
[no-cd]
vendor-extract:
rm -rf vendor
tar pxf vendor.tar

48
debian/changelog vendored
View file

@ -1,51 +1,3 @@
cosmic-edit (1.10.0) noble; urgency=medium
* Epoch 1.10.0 version update
-- Michael Murphy <michael@mmurphy.dev> Mon, 05 Oct 2026 21:19:33 +0200
cosmic-edit (1.9.0) noble; urgency=medium
* Epoch 1.9.0 version update
-- Michael Murphy <michael@mmurphy.dev> Mon, 14 Sep 2026 21:54:06 +0200
cosmic-edit (1.8.0) noble; urgency=medium
* Epoch 1.8.0 version update
-- Jeremy Soller <jeremy@system76.com> Wed, 02 Sep 2026 08:14:30 -0600
cosmic-edit (1.7.0) noble; urgency=medium
* Epoch 1.7.0 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 25 Aug 2026 09:19:59 -0600
cosmic-edit (1.6.0) noble; urgency=medium
* Epoch 1.6.0 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 18 Aug 2026 07:13:06 -0600
cosmic-edit (1.5.0) noble; urgency=medium
* Epoch 1.5.0 version update
-- Jeremy Soller <jeremy@system76.com> Tue, 28 Jul 2026 09:13:50 -0600
cosmic-edit (1.4.0) noble; urgency=medium
* Epoch 1.4.0 version update
-- Jeremy Soller <jeremy@system76.com> Mon, 20 Jul 2026 14:35:49 -0600
cosmic-edit (1.3.0) noble; urgency=medium
* Epoch 1.3.0 version update
-- Jeremy Soller <jeremy@system76.com> Sun, 12 Jul 2026 13:20:55 -0600
cosmic-edit (1.2.0) noble; urgency=medium
* Epoch 1.2.0 version update

5
debian/rules vendored
View file

@ -1,12 +1,15 @@
#!/usr/bin/make -f
export DESTDIR = debian/cosmic-edit
export VENDOR ?= 1
%:
dh $@
override_dh_auto_clean:
ischroot || just vendor
if ! ischroot && test "${VENDOR}" = "1"; then \
just vendor; \
fi
override_dh_auto_build:
just build-vendored

View file

@ -1,6 +1,4 @@
tar-ignore=.github
tar-ignore=target/.rustc_info.json
tar-ignore=target/CACHEDIR.TAG
tar-ignore=target/debug
tar-ignore=target/release
tar-ignore=.vscode
tar-ignore=vendor
tar-ignore=target

View file

@ -49,7 +49,7 @@ settings = الإعدادات
### Appearance
appearance = المظهر
theme = السمة
theme = النسق
match-desktop = طابق سطح المكتب
dark = داكن
light = فاتح
@ -96,7 +96,7 @@ document-type = نوع المستند...
encoding = الترميز...
menu-git-management = إدارة Git...
print = اطبع
quit = إنهِ
quit = أنهِ
## Edit

View file

@ -1,5 +1,3 @@
cancel = Cancel·lar
quit = Surt
settings = Configuració
save = Desa
undo = Desfés

View file

@ -71,9 +71,9 @@ automatic-indentation = Automatické odsazení
tab-width = Šířka tabulátoru: { $tab_width }
convert-indentation-to-spaces = Převést odsazení na mezery
convert-indentation-to-tabs = Převést odsazení na tabulátory
word-wrap = Zalamování řádků
word-wrap = Zalamování slov
show-line-numbers = Zobrazit čísla řádků
highlight-current-line = Zvýraznit aktuální řádek
highlight-current-line = Zvýraznění aktuálního řádku
syntax-highlighting = Zvýraznění syntaxe...
menu-settings = Nastavení...
menu-keyboard-shortcuts = Klávesové zkratky...

View file

@ -1,91 +0,0 @@
save = Gem
cancel = Afbryd
quit = Afslut
cosmic-text-editor = COSMIC-teksteditor
new-document = Nyt dokument
open-project = Åbn project
repository = Pakkearkiv
todo = TODO
document-statistics = Dokument-statistikker
word-count = Antal ord
character-count = Tegn
character-count-no-spaces = Tegn (uden mellemrum)
line-count = Linjer
appearance = Udseende
git-management = Git-håndtering
theme = Tema
git-management-description = Git.håndtering er et udvikler-værktøj, som bruges til versionskontrol-operationer.
match-desktop = Følg skrivebordets indstillinger
git-management-loading = Indlæser Git-håndtering...
dark = Mørkt
stage = Bered
light = Lyst
staged-changes = Forberedte ændringer
file = Fil
unstage = Fjern fra forberedelse
unstaged-changes = Uforberedte ændringer
project-search = Projektsøgning
prompt-save-changes-title = Gem ændringer før lukning?
close-file = Luk fil
prompt-unsaved-changes = Du har ugemte ændringer. Hvis du fortsætter uden at gemme, vil disse ændringer gå tabt.
discard = Kassér ændringer
save-all = Gem alle
default-zoom-step = Zoom-trin
syntax-dark = Syntaks mørk
syntax-light = Syntaks lys
default-font = Standard skrifttype
default-font-size = Standard skriftstørrelse
keyboard-shortcuts = Tastaturgenveje
enable-vim-bindings = Aktivér Vim-bindinger
find-placeholder = Find...
find-previous = Find forrige
find-next = Find næste
replace-placeholder = Erstat...
replace = Erstat
replace-all = Erstat alle
case-sensitive = Forskel på store og små bogstaver
use-regex = Anvend regex
wrap-around = Omslut
new-file = Ny fil
new-window = Nyt vindue
open-file = Åbn fil...
open-recent-file = Åbn seneste fil
menu-open-project = Åbn projekt...
open-recent-project = Åbn seneste projekt
close-project = Luk projekt
edit = Redigér
save-as = Gem som...
copy = Kopiér
revert-all-changes = Tilbagefør alle ændringer
paste = Indsæt
menu-document-statistics = Dokument-statistikker...
select-all = Vælg alle
document-type = Dokumenttype...
find = Find
encoding = Kodning...
menu-git-management = Git-håndtering...
print = Udskriv
view = Vis
undo = Fortryd
redo = Omgør
cut = Klip
find-in-project = Find i projekt...
menu-settings = Indstillinger...
spell-check = Stavekontrol...
zoom-in = Zoom ind
default-size = Standardstørrelse
zoom-out = Zoom ud
indentation = Indrykning
automatic-indentation = Automatisk Indrykning
tab-width = Fanebladsbredde: { $tab_width }
convert-indentation-to-spaces = Konvertér indryk til mellemrum
convert-indentation-to-tabs = Konvertér indryk til tabulaturer
comment = Teksteditor til COSMIC-skrivebordet
menu-keyboard-shortcuts = Tastaturgenveje…
word-wrap = Tekstombrydning
show-line-numbers = Vis linjenumre
highlight-current-line = Fremhæv aktuel linje
syntax-highlighting = Syntaksfremhævning…
menu-about = Om COSMIC Teksteditor…
support = Support
settings = Indstillinger

View file

@ -21,7 +21,7 @@ line-count = Zeilen
git-management = Git-Verwaltung
git-management-description = Git-Verwaltung ist ein Entwicklerwerkzeug, das für die Versionskontrolle eingesetzt wird.
git-management-loading = Git-Verwaltung wird geladen ...
git-management-loading = Git-Verwaltung wird geladen...
stage = Vormerken
staged-changes = Vorgemerkte Änderungen
unstage = Nicht vormerken
@ -50,8 +50,8 @@ theme = Thema
match-desktop = An Desktop anpassen
dark = Dunkel
light = Hell
syntax-dark = Dunkle Syntax
syntax-light = Helle Syntax
syntax-dark = Syntax dunkel
syntax-light = Syntax hell
default-font = Standardschriftart
default-font-size = Standardschriftgröße
default-zoom-step = Zoomstufen
@ -61,10 +61,10 @@ default-zoom-step = Zoomstufen
keyboard-shortcuts = Tastenkombinationen
enable-vim-bindings = Vim-Kombinationen aktivieren
# Suchen
find-placeholder = Suchen ...
find-placeholder = Suchen...
find-previous = Vorherigen suchen
find-next = Nächsten suchen
replace-placeholder = Ersetzen ...
replace-placeholder = Ersetzen...
replace = Ersetzen
replace-all = Alles ersetzen
case-sensitive = Groß-/Kleinschreibung beachten
@ -79,19 +79,19 @@ wrap-around = Umlaufen
file = Datei
new-file = Neue Datei
new-window = Neues Fenster
open-file = Datei öffnen ...
open-file = Datei öffnen...
open-recent-file = Letzte Datei öffnen
close-file = Datei schließen
menu-open-project = Projekt öffnen ...
menu-open-project = Projekt öffnen...
open-recent-project = Letztes Projekt öffnen
close-project = Projekt schließen
save = Speichern
save-as = Speichern unter ...
save-as = Speichern unter...
revert-all-changes = Alle Änderungen rückgängig machen
menu-document-statistics = Dokument-Statistiken ...
document-type = Dokumententyp ...
encoding = Kodierung ...
menu-git-management = Git-Verwaltung ...
menu-document-statistics = Dokument-Statistiken...
document-type = Dokumententyp...
encoding = Kodierung...
menu-git-management = Git-Verwaltung...
print = Drucken
quit = Beenden
@ -105,8 +105,8 @@ copy = Kopieren
paste = Einfügen
select-all = Alles auswählen
find = Suchen
find-in-project = Im Projekt suchen ...
spell-check = Rechtschreibprüfung ...
find-in-project = Im Projekt suchen...
spell-check = Rechtschreibprüfung...
## Ansicht
@ -125,10 +125,10 @@ convert-indentation-to-tabs = Einrückung in Tabulatoren umwandeln
word-wrap = Zeilenumbruch
show-line-numbers = Zeilennummern anzeigen
highlight-current-line = Aktuelle Zeile hervorheben
syntax-highlighting = Syntaxhervorhebung ...
menu-settings = Einstellungen ...
menu-keyboard-shortcuts = Tastenkombinationen ...
menu-about = Über COSMIC Texteditor ...
repository = Repositorium
syntax-highlighting = Syntaxhervorhebung...
menu-settings = Einstellungen...
menu-keyboard-shortcuts = Tastenkombinationen...
menu-about = Über COSMIC Texteditor...
repository = Repository
support = Unterstützung
comment = Texteditor für den COSMIC Desktop

View file

@ -45,7 +45,7 @@ menu-document-statistics = Στατιστικά εγγράφου...
document-type = Τύπος εγγράφου...
encoding = Κωδικοποίηση...
print = Εκτύπωση
quit = Τερματισμός
quit = Έξοδος
## Edit

View file

@ -1,91 +0,0 @@
save = Save
quit = Quit
cancel = Cancel
settings = Settings
appearance = Appearance
theme = Theme
match-desktop = Match desktop
dark = Dark
file = File
close-file = Close file
syntax-light = Syntax light
cosmic-text-editor = COSMIC Text Editor
comment = Text editor for the COSMIC desktop
new-document = New document
open-project = Open project
todo = TODO
repository = Repository
support = Support
document-statistics = Document statistics
word-count = Word count
character-count = Characters
character-count-no-spaces = Characters (without spaces)
line-count = Lines
git-management = Git management
git-management-description = Git management is a developer tool used for version control operations.
keyboard-shortcuts = Keyboard shortcuts
replace = Replace
git-management-loading = Loading Git management...
stage = Stage
staged-changes = Staged changes
unstage = Unstage
unstaged-changes = Unstaged changes
project-search = Project search
prompt-save-changes-title = Save changes before closing?
prompt-unsaved-changes = You have unsaved changes. If you continue without saving, these changes will be lost.
discard = Discard changes
save-all = Save all
syntax-dark = Syntax dark
default-font = Default font
default-font-size = Default font size
default-zoom-step = Zoom steps
enable-vim-bindings = Enable Vim bindings
find-placeholder = Find...
find-previous = Find previous
find-next = Find next
replace-placeholder = Replace...
replace-all = Replace all
case-sensitive = Case sensitive
use-regex = Use regex
wrap-around = Wrap around
new-file = New file
new-window = New window
open-file = Open file...
open-recent-file = Open recent file
menu-open-project = Open project...
open-recent-project = Open recent project
close-project = Close project
save-as = Save as...
revert-all-changes = Revert all changes
menu-document-statistics = Document statistics...
document-type = Document type...
encoding = Encoding...
menu-git-management = Git management...
print = Print
light = Light
edit = Edit
undo = Undo
redo = Redo
cut = Cut
copy = Copy
paste = Paste
select-all = Select all
find = Find
find-in-project = Find in project...
spell-check = Spell check...
view = View
zoom-in = Zoom in
default-size = Default size
zoom-out = Zoom out
indentation = Indentation
automatic-indentation = Automatic Indentation
tab-width = Tab width: { $tab_width }
convert-indentation-to-spaces = Convert indentation to spaces
convert-indentation-to-tabs = Convert indentation to tabs
menu-keyboard-shortcuts = Keyboard shortcuts...
word-wrap = Word wrap
show-line-numbers = Show line numbers
highlight-current-line = Highlight current line
syntax-highlighting = Syntax highlighting...
menu-settings = Settings...
menu-about = About COSMIC Text Editor...

View file

@ -31,7 +31,7 @@ settings = Asetukset
appearance = Ulkoasu
theme = Teema
match-desktop = Sama kuin työpöytä
match-desktop = Sovita työpöytään
dark = Tumma
light = Vaalea
syntax-dark = Tumma syntaksi

View file

@ -1,91 +0,0 @@
save = Gardar
cancel = Cancelar
cosmic-text-editor = Editor de Texto de COSMIC
comment = Editor de texto para o escritorio COSMIC
new-document = Novo documento
open-project = Abrir proxecto
todo = TODO
repository = Repositorio
support = Soporte
document-statistics = Estadisticas do documento
word-count = Reconto de palabras
character-count = Carácteres
character-count-no-spaces = Carácter (sen espazos)
line-count = Liñas
git-management = Xestion de Git
git-management-description = A xestión de Git é unha ferramenta de desenvolvemento utilizada para operacións de control de versións.
git-management-loading = Cargando a xestión de Git...
stage = Etapa
staged-changes = Cambios preparados
unstage = Sen preparar
unstaged-changes = Cambios sen preparar
project-search = Buscar proxecto
prompt-save-changes-title = Gardar os cambios antes de pechar?
prompt-unsaved-changes = Tes cambios sen gardar. Se continúas sen gardalos, estes cambios perderanse.
discard = Descartar cambios
save-all = Gardar todo
settings = Axustes
appearance = Apariencia
theme = Tema
match-desktop = Axustar ao escritorio
dark = Escuro
light = Claro
syntax-dark = Sintaxe escura
syntax-light = Sintaxe clara
default-font = Fonte por defecto
default-font-size = Tamaño de fonte por defecto
default-zoom-step = Pasos do zoom
keyboard-shortcuts = Atallos de teclado
enable-vim-bindings = Activar as asociacións de teclas de Vim
find-placeholder = Atopar…
find-previous = Atopar antes
find-next = Atopar seguinte
replace-placeholder = Remplazar…
replace = Remplazar
replace-all = Remplazar todo
case-sensitive = Distinguir maiúsculas e minúsculas
use-regex = Usar expresións regulares
wrap-around = Buscar de comezo a fin
file = Ficheiro
new-file = Novo ficheiro
new-window = Nova xanela
open-file = Abrir ficheiro…
open-recent-file = Abrir ficheiro recente
close-file = Pechar ficheiro
menu-open-project = Abrir proxecto…
open-recent-project = Abrir proxecto recente
close-project = Pechar proxecto
save-as = Gardar como…
revert-all-changes = Desvotar todos os cambios
menu-document-statistics = Estatísticas do documento...
document-type = Tipo de documento…
encoding = Codificación...
menu-git-management = Xestión de Git...
print = Imprimir
quit = Pechar
edit = Editar
undo = Desfacer
redo = Refacer
cut = Cortar
copy = Copiar
paste = Pegar
select-all = Seleccionar todo
find = Atopar
find-in-project = Atopar en proxecto…
spell-check = Corrección ortográfica...
view = Ver
zoom-in = Aumentar Zoom
default-size = Tamaño por defecto
zoom-out = Afastar Zoom
indentation = Sangría
automatic-indentation = Sangría automatica
tab-width = Largura da tabulación:{ $tab_width }
convert-indentation-to-spaces = Converter a sangria en espazos
convert-indentation-to-tabs = Converter a sangría en tabulacións
word-wrap = Axuste de liña
show-line-numbers = Amosar o numero de liñas
highlight-current-line = Subrayar a liña actual
syntax-highlighting = Realce da sintaxe...
menu-settings = Axustes...
menu-keyboard-shortcuts = Atallos de teclado…
menu-about = Sobre Editor de Texto COSMIC…

View file

@ -1,7 +1,7 @@
cosmic-text-editor = कॉस्मिक टेक्स्ट एडिटर
new-document = नया दस्तावेज़
open-project = प्रोजेक्ट खोलें
todo = कार्य-सूची
todo = करने के लिए
# Context Pages
@ -13,41 +13,41 @@ todo = कार्य-सूची
document-statistics = दस्तावेज़ आँकड़े
word-count = शब्दों की संख्या
character-count = अक्षर
character-count-no-spaces = अक्षर (बिना स्थान के)
character-count = अक्षरों की संख्या
character-count-no-spaces = अक्षरों की संख्या (स्पेस के बिना)
line-count = पंक्तियाँ
## Git management
git-management = गिट प्रबंधन
git-management-description = गिट प्रबंधन एक डेवलपर उपकरण है जिसका उपयोग संस्करण नियंत्रण संचालन के लिए किया जाता है।
git-management-loading = गिट प्रबंधन लोड हो रहा है..।
stage = स्टेज करें
staged-changes = स्टेज किए गए बदलाव
unstage = अनस्टेज करें
unstaged-changes = अनस्टेज किए गए बदलाव
git-management = Git प्रबंधन
git-management-description = Git प्रबंधन एक डेवलपर टूल है जो संस्करण नियंत्रण कार्यों के लिए उपयोग किया जाता है।
git-management-loading = Git प्रबंधन लोड हो रहा है...
stage = स्टेज
staged-changes = स्टेज पर बदली गई चीज़ें
unstage = स्टेज से हटाएँ
unstaged-changes = बिना स्टेज की गई चीज़ें
## Project search
project-search = परियोजना खोज
project-search = प्रोजेक्ट खोज
## Prompt save changes
prompt-save-changes-title = बंद करने से पहले बदलाव सहेजें?
prompt-unsaved-changes = आपके पास अनसहेजे बदलाव हैं। यदि आप बिना सहेजे जारी रखते हैं, तो ये बदलाव नष्ट हो जाएँगे।
cancel = रद्द करें
discard = बदलावों को खारिज करें
save-all = सभी सहेजें
prompt-save-changes-title = बिना सहेजे हुए बदलाव
prompt-unsaved-changes = आपके पास बिना सहेजे हुए बदलाव हैं। सहेजना है?
cancel = रद्द करो
discard = बदलाव को खारिज करें
save-all = सब कुछ सहेजें
## Settings
settings = सेटिंग्स
settings = सेटिंग
### Appearance
appearance = रुप-रंग
theme = प्रसंग
match-desktop = डेस्कटॉप से मेल खाएँ
appearance = दिखावट
theme = थीम
match-desktop = डेस्कटॉप से मेल करें
dark = डार्क
light = लाइट
syntax-dark = सिंटैक्स डार्क
@ -60,14 +60,14 @@ default-font-size = डिफ़ॉल्ट फ़ॉन्ट आकार
keyboard-shortcuts = कीबोर्ड शॉर्टकट्स
enable-vim-bindings = Vim बाइंडिंग्स सक्षम करें
# Find
find-placeholder = खोजें..।
find-placeholder = खोजें...
find-previous = पिछला खोजें
find-next = अगला खोजें
replace-placeholder = बदलें..।
replace-placeholder = बदलें...
replace = बदलें
replace-all = सब कुछ बदलें
case-sensitive = अक्षर संवेदनशील
use-regex = रिगैक्स का उपयोग करें
case-sensitive = केस-सेंसिटिव
use-regex = Regex का उपयोग करें
# Menu
@ -77,34 +77,34 @@ use-regex = रिगैक्स का उपयोग करें
file = फ़ाइल
new-file = नई फ़ाइल
new-window = नई विंडो
open-file = फ़ाइल खोलें..।
open-file = फ़ाइल खोलें...
open-recent-file = हाल की फ़ाइल खोलें
close-file = फ़ाइल बंद करें
menu-open-project = परियोजना खोलें..।
open-recent-project = हालिया परियोजना खोलें
close-project = परियोजना बंद करें
menu-open-project = प्रोजेक्ट खोलें...
open-recent-project = हाल का प्रोजेक्ट खोलें
close-project = प्रोजेक्ट बंद करें
save = सहेजें
save-as = इस रूप में सहेजें..।
save-as = इस रूप में सहेजें...
revert-all-changes = सभी बदलावों को पलटें
menu-document-statistics = दस्तावेज़ आँकड़े..।
document-type = दस्तावेज़ प्रकार..।
encoding = एनकोडिंग..।
menu-git-management = गिट प्रबंधन..।
print = छापें
quit = बाहर जाएँ
menu-document-statistics = दस्तावेज़ आँकड़े...
document-type = दस्तावेज़ प्रकार...
encoding = एन्कोडिंग...
menu-git-management = Git प्रबंधन...
print = प्रिंट करें
quit = बंद करें
## Edit
edit = संपादन
edit = संपादित करें
undo = पूर्ववत करें
redo = फिर से करें
cut = काटें
copy = कॉपी करें
paste = चिपकाएँ
select-all = सभी चुनें
paste = पेस्ट करें
select-all = सब कुछ चुनें
find = खोजें
find-in-project = परियोजना में खोजें..।
spell-check = वर्तनी जाँच..।
find-in-project = प्रोजेक्ट में खोजें...
spell-check = वर्तनी की जांच...
## View
@ -116,19 +116,13 @@ indentation = इंडेंटेशन
automatic-indentation = स्वचालित इंडेंटेशन
tab-width = टैब चौड़ाई: { $tab_width }
convert-indentation-to-spaces = इंडेंटेशन को स्पेस में बदलें
convert-indentation-to-tabs = इंडेंटेशन को टैब में बदलें
word-wrap = शब्द लपेटन
convert-indentation-to-tabs = इंडेंटेशन को टैब्स में बदलें
word-wrap = वर्ड रैप
show-line-numbers = पंक्ति संख्या दिखाएँ
highlight-current-line = वर्तमान पंक्ति को हाइलाइट करें
syntax-highlighting = सिंटैक्स हाइलाइटिंग..।
menu-settings = सेटिंग्स..।
menu-keyboard-shortcuts = कीबोर्ड शॉर्टकट्स..।
menu-about = कॉस्मिक टेक्स्ट एडिटर के बारे में..।
syntax-highlighting = सिंटैक्स हाइलाइटिंग...
menu-settings = सेटिंग्स...
menu-keyboard-shortcuts = कीबोर्ड शॉर्टकट्स...
menu-about = कॉस्मिक टेक्स्ट एडिटर के बारे में...
repository = रिपॉजिटरी
support = समर्थन
comment = कॉस्मिक डेस्कटॉप के लिए टेक्स्ट एडिटर
default-zoom-step = ज़ूम चरण
wrap-around = लपेटें
zoom-in = बड़ा करें
default-size = मूल आकार
zoom-out = छोटा करें
support = सहायता

View file

@ -53,14 +53,14 @@ dark = Sötét
light = Világos
syntax-dark = Sötét szintaxis
syntax-light = Világos szintaxis
default-font = Alapértelmezett betűkészlet
default-font = Alapértelmezett betűtípus
default-font-size = Alapértelmezett betűméret
default-zoom-step = Nagyítási mérték
### Keyboard shortcuts
keyboard-shortcuts = Gyorsbillentyűk
enable-vim-bindings = Vim-billentyűkombinációk engedélyezése
enable-vim-bindings = Vim billentyűkombinációk engedélyezése
# Find
find-placeholder = Keresés…
find-previous = Előző találat

View file

@ -18,7 +18,7 @@ appearance = Tampilan
git-management = Pengelolaan Git
theme = Tema
git-management-description = Pengelolaan Git adalah alat pengembang yang digunakan untuk operasi pengendalian versi.
match-desktop = Cocok desktop
match-desktop = Cocokkan desktop
menu-settings = Pengaturan...
git-management-loading = Memuat pengelolaan Git...
staged-changes = Perubahan yang bertahap

View file

@ -1,8 +1,8 @@
cosmic-text-editor = Editor di testo COSMIC
comment = Editor di testo per il desktop COSMIC
cosmic-text-editor = COSMIC Text Editor
comment = Editor di testo di COSMIC
new-document = Nuovo documento
open-project = Apri progetto
todo = A fare
todo = TODO
# Context Pages
@ -15,15 +15,15 @@ support = Supporto
## Document statistics
document-statistics = Statistiche documento
word-count = Conteggio delle parole
word-count = Conteggio parole
character-count = Caratteri
character-count-no-spaces = Caratteri (senza spazi)
line-count = Linee
line-count = Righe
## Git management
git-management = Gestione Git
git-management-description = Gestione Git è uno strumento per sviluppatori, usato per le operazioni di controllo di versione.
git-management-description = Gestione Git è uno strumento per sviluppatori, usato per le operazioni di controllo versione.
git-management-loading = Caricamento Gestione Git...
stage = Prepara modifiche
staged-changes = Modifiche preparate
@ -35,8 +35,8 @@ project-search = Ricerca nel progetto
## Prompt save changes
prompt-save-changes-title = Salvare le modifiche prima di chiudere?
prompt-unsaved-changes = Sono presenti modifiche non salvate. Se continui senza salvare, queste modifiche andranno perse.
prompt-save-changes-title = Modifiche non salvate
prompt-unsaved-changes = Hai delle modifiche non salvate. Vuoi salvarle?
cancel = Annulla
discard = Ignora modifiche
save-all = Salva tutto
@ -49,7 +49,7 @@ settings = Impostazioni
appearance = Aspetto
theme = Tema
match-desktop = Abbina al desktop
match-desktop = Sistema
dark = Scuro
light = Chiaro
syntax-dark = Sintassi scura
@ -89,8 +89,8 @@ close-project = Chiudi progetto
save = Salva
save-as = Salva come...
revert-all-changes = Annulla tutte le modifiche
menu-document-statistics = Statistiche di documento...
document-type = Tipo di documento...
menu-document-statistics = Statistiche documento...
document-type = Tipo documento...
encoding = Codifica...
menu-git-management = Gestione Git...
print = Stampa

View file

@ -1,9 +1,9 @@
cancel = Semmet
cancel = Sefsex
undo = Ssemmet
save = Sekles
quit = Ffeɣ
quit = Tuffɣa
replace = Semselsi
support = Tallelt
support = Tallalt
settings = Iɣewwaṛen
appearance = Timeẓri
theme = Asentel
@ -16,7 +16,7 @@ default-size = Tiddi tamezwert
zoom-out = Asemẓi
view = Wali
menu-settings = Iɣewwaṛen…
match-desktop = Semṣada akked tnarit
match-desktop = Amṣada d tnarit
file = Afaylu
new-window = Asfaylu amaynut
edit = Ẓreg

View file

@ -5,11 +5,11 @@ replace = Алмастыру
repository = Репозиторий
support = Қолдау
settings = Баптаулар
appearance = Сыртқы көрініс
theme = Тема
match-desktop = Жұмыс үстеліне сәйкес болу
dark = Қою
light = Ашық
appearance = Сыртқы түрі
theme = Тақырып
match-desktop = Жұмыс үстеліне сәйкес келу
dark = Қараңғы
light = Жарық
file = Файл
new-window = Жаңа терезе
quit = Шығу

View file

@ -1,91 +0,0 @@
save = Tomar bike
cancel = Têk bibe
undo = Vegerîne
cosmic-text-editor = Edîtorê nivîsê ya COSMIC
stage = Ast
settings = Sazkarî
appearance = Xuyang
theme = Rûkar
dark = Tarî
light = Ronî
support = Piştgirî
quit = Biqedîne
find-placeholder = Bibîne...
copy = Jê bigire
paste = Pê ve bike
match-desktop = Bi sermaseyê re li hev bîne
select-all = Hemûyan hilbijêre
zoom-in = Nêzîk bike
default-size = Mezinahiya berdest
zoom-out = Dûr bike
file = Pel
default-zoom-step = Gavên nêzîkbûnê
keyboard-shortcuts = Kurteriyên kilîtdankê
menu-keyboard-shortcuts = Kurteriyên kilîtdankê...
find-previous = Yê paş bibîne
find-next = Yê pêş bibîne
new-window = Çarçoveya nû
edit = Biguhêrîne
view = Dîtin
menu-settings = Sazkarî...
close-file = Pelê bigire
cut = Jê bike
new-document = Pelbenda nû
open-project = Projeyê veke
line-count = Rêz
repository = Embar
print = Çap bike
replace = Biguhêrîne
find = Bibîne
comment = Edîtorê nivîsê ji bo sermaseya COSMIC
todo = Erk
document-statistics = Amarên pelbendê
word-count = Jimara peyvan
character-count = Tîp
character-count-no-spaces = Tîp (bê valahî)
git-management = Rêveberiya Gitê
git-management-description = Rêveberiya Gitê amûreke pêşvebiran e ku ji bo pêvajoyên kontrolkirina guhertoyan tê bikaranîn.
git-management-loading = Rêveberiya Gitê tê barkirin...
staged-changes = Guhertinên amedekirî
unstage = Ji amedekariyê derxîne
unstaged-changes = Guhertinên ne amedekirî
project-search = Lêgerîna projeyê
prompt-save-changes-title = Berî girtinê guhertinan tomar bike?
prompt-unsaved-changes = Guhertinên te yên netomarkirî hene. Ku tu bê tomarkirinê bidomînî, ev guhertin wê winda bibin.
discard = Guhertinan paşguh bike
save-all = Hemûyan tomar bike
syntax-dark = Syntaxa tarî
syntax-light = Rêzamana ronî
default-font = Cûrenivîsa berdest
default-font-size = Mezinahiya cûrenivîsê ya berdest
enable-vim-bindings = Girêdanên Vim çalak bike
replace-placeholder = Biguhêrîne...
replace-all = Hemûyan biguhêrîne
case-sensitive = Hestiyar e li hember tîpên mezin/biçûk
use-regex = Regexê bi kar bîne
wrap-around = Pêçana dorhêlê
new-file = Pela nû
open-file = Pelê veke...
open-recent-file = Pelê dawî veke
menu-open-project = Projeyê veke...
open-recent-project = Projeya dawî veke
close-project = Projeyê bigire
save-as = Tomar bike wekî...
revert-all-changes = Hemû guhertinan vegerîne
menu-document-statistics = Amarên pelbendê...
document-type = Cûreyê pelbendê...
encoding = Tê kodkirin...
menu-git-management = Rêveberiya Gitê...
redo = Dûbare bike
find-in-project = Di projeyê de bibîne...
spell-check = Kontrola rastnivîsê...
indentation = Valahiya destpêkê
automatic-indentation = Valahiya destpêkê ya xweber
tab-width = Ferehiya rûgerê: { $tab_width }
convert-indentation-to-spaces = Indentationê vegerîne valahiyan
convert-indentation-to-tabs = Valahiya destpêkê biguhêrîne bo rûgeran
word-wrap = Pêçana peyvan
show-line-numbers = Jimarên rêzan nîşan bide
highlight-current-line = Rêza heyî ronî bike
syntax-highlighting = Ronîkirina syntaxê...
menu-about = Di derbarê edîtorê nivîsê ya COSMIC de...

View file

@ -14,7 +14,7 @@ line-count = Eilučių skaičius
## Settings
settings = Nuostatai
settings = Nuostatos
## Appearance
@ -45,7 +45,7 @@ menu-document-statistics = Apie dokumentą...
document-type = Dokumento tipas...
encoding = Koduotė...
print = Spausdinti
quit = Išjungti
quit = Išeiti
## Edit
@ -74,7 +74,7 @@ word-wrap = Žodžių kėlimas
show-line-numbers = Rodyti eilučių numerius
highlight-current-line = Paryškinti dabartinę eilutę
syntax-highlighting = Sintaksės tikrinimas...
menu-settings = Nuostatai...
menu-settings = Nuostatos...
menu-keyboard-shortcuts = Spartieji klavišai...
menu-about = Apie COSMIC Rašyklę...
cancel = Atšaukti

View file

@ -1,13 +1 @@
settings = Configuracion
appearance = Aparéncia
theme = Tèma
match-desktop = Assortir al burèu
dark = Escur
light = Clar
file = Fichièr
close-file = Tampar lo fichièr
cancel = Anullar
repository = Depaus
menu-settings = Configuracion...
quit = Quitar
replace = Remplaçar
settings = Paramètres

View file

@ -3,11 +3,11 @@ support = ਸਹਿਯੋਗ
settings = ਸੈਟਿੰਗਾਂ
appearance = ਦਿੱਖ
theme = ਥੀਮ
match-desktop = ਡੈਸਕਟਾਪ ਨਾਲ ਮਿਲਾਓ
match-desktop = ਡੈਸਕਟਾਪ ਨਾਲ ਮਿਲਦਾ
dark = ਗੂੜ੍ਹਾ
light = ਫਿੱਕਾ
light = ਹਲਕਾ
default-zoom-step = ਜ਼ੂਮ ਸਟੈਪ
quit = ਸਮਾਪਤ
quit = ਬਾਹਰ
edit = ਸੋਧੋ
copy = ਕਾਪੀ ਕਰੋ
paste = ਚੇਪੋ

View file

@ -1,5 +1,5 @@
cosmic-text-editor = Edytor Tekstu COSMIC
comment = Edytor tekstu dla środowiska COSMIC
comment = Edytor tekstu pulpitu COSMIC
new-document = Nowy dokument
open-project = Otwórz projekt
todo = TODO
@ -64,7 +64,7 @@ default-zoom-step = Stopniowanie powiększania
keyboard-shortcuts = Skróty klawiszowe
enable-vim-bindings = Włącz tryb Vim
# Find
find-placeholder = Wyszukaj…
find-placeholder = Szukaj…
find-previous = Znajdź poprzedni
find-next = Znajdź następny
replace-placeholder = Zastąp…
@ -95,7 +95,7 @@ document-type = Typ dokumentu…
encoding = Kodowanie…
menu-git-management = Zarządzanie git…
print = Drukuj
quit = Zakończ
quit = Zamknij
## Edit
@ -106,8 +106,8 @@ cut = Wytnij
copy = Kopiuj
paste = Wklej
select-all = Zaznacz wszystko
find = Wyszukaj
find-in-project = Wyszukaj w projekcie…
find = Szukaj
find-in-project = Szukaj w projekcie…
spell-check = Sprawdź ortografię…
## View

View file

@ -94,7 +94,7 @@ document-type = Tipo de documento...
encoding = Codificação...
menu-git-management = Gerenciamento do Git...
print = Imprimir
quit = Encerrar
quit = Sair
## Edit

View file

@ -94,7 +94,7 @@ document-type = Тип документа...
encoding = Кодировка...
menu-git-management = Управление Git...
print = Печать
quit = Завершить
quit = Выйти
## Edit

View file

@ -1,2 +0,0 @@
cancel = ᱵᱟᱹᱛᱤᱞ
save = ᱥᱟᱧᱪᱟᱣ

View file

@ -119,7 +119,7 @@ word-wrap = Radbrytning
show-line-numbers = Visa radnummer
highlight-current-line = Markera aktuell rad
syntax-highlighting = Syntaxmarkering...
menu-settings = Inställningar...
menu-settings = Inställningar…
menu-keyboard-shortcuts = Tangentbordsgenvägar...
menu-about = Om COSMIC Textredigerare…
cosmic-text-editor = COSMIC Textredigerare

View file

@ -1,6 +0,0 @@
cancel = ยกเลิก
settings = การตั้งค่า
dark = มืด
light = สว่าง
replace = แทนที่
appearance = ลักษณะ

View file

@ -90,7 +90,7 @@ document-type = Тип документа...
encoding = Кодування...
menu-git-management = Керування Git...
print = Друкувати
quit = Завершити
quit = Вийти
## Edit

View file

@ -1,5 +1,5 @@
cosmic-text-editor = COSMIC 文字編輯器
new-document = 新文件
new-document = 新建文件
open-project = 開啟專案
todo = 待辦事項
@ -71,8 +71,8 @@ use-regex = 使用正規表示式
## File
file = 檔案
new-file = 新增檔案
new-window = 新增視窗
new-file = 新建檔案
new-window = 新建視窗
open-file = 開啟檔案...
open-recent-file = 開啟最近使用的檔案
close-file = 關閉檔案
@ -87,7 +87,7 @@ document-type = 文件類型...
encoding = 編碼...
menu-git-management = Git 管理...
print = 列印
quit = 結束
quit = 退出
## Edit
@ -124,7 +124,7 @@ stage = 暫存
unstage = 取消暫存
cancel = 取消
save-all = 全部儲存
repository = 軟體庫
repository = 軟體庫源
support = 支援
default-zoom-step = 縮放步進
zoom-in = 放大

View file

@ -1,3 +0,0 @@
[toolchain]
channel = "1.93"
components = ["clippy", "rustfmt"]

View file

@ -112,8 +112,17 @@ impl Config {
}
}
#[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize, Default)]
#[derive(Clone, CosmicConfigEntry, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct ConfigState {
pub recent_files: VecDeque<PathBuf>,
pub recent_projects: VecDeque<PathBuf>,
}
impl Default for ConfigState {
fn default() -> Self {
Self {
recent_files: VecDeque::new(),
recent_projects: VecDeque::new(),
}
}
}

View file

@ -124,7 +124,7 @@ impl GitRepository {
msg.push_str("\nstderr> ");
msg.push_str(line);
}
Err(io::Error::other(msg))
Err(io::Error::new(io::ErrorKind::Other, msg))
}
}

View file

@ -11,7 +11,7 @@ use cosmic::{
cosmic_theme, executor,
font::Font,
iced::{
self, Alignment, Background, Color, Length, Limits, Subscription,
self, Alignment, Background, Color, Length, Limits, Point, Subscription,
advanced::graphics::text::font_system,
clipboard, event,
futures::{self, SinkExt},
@ -194,7 +194,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub enum Action {
Todo,
NoOp,
About,
CloseFile,
CloseProject(usize),
@ -245,7 +244,6 @@ impl Action {
fn message(&self, entity_opt: Option<Entity>) -> Message {
match self {
Self::Todo => Message::Todo,
Self::NoOp => Message::NoOp,
Self::About => Message::ToggleContextPage(ContextPage::About),
Self::CloseFile => Message::CloseFile,
Self::CloseProject(project_i) => Message::CloseProject(*project_i),
@ -328,7 +326,6 @@ impl PartialEq for WatcherWrapper {
}
}
#[allow(clippy::large_enum_variant)]
enum NewTab {
Tab(EditorTab),
Exists(Entity),
@ -374,7 +371,6 @@ pub enum Message {
Modifiers(Modifiers),
NewFile,
NewWindow,
NoOp,
NotifyEvent(notify::Event),
NotifyWatcher(WatcherWrapper),
OpenFile(PathBuf),
@ -404,7 +400,7 @@ pub enum Message {
SaveAsResult(segmented_button::Entity, DialogResult),
Scroll(f32),
SelectAll,
Surface(surface::Action<Message>),
Surface(surface::Action),
SystemThemeModeChange(cosmic_theme::ThemeMode),
SyntaxTheme(usize, bool),
TabActivate(segmented_button::Entity),
@ -413,7 +409,7 @@ pub enum Message {
TabClose(segmented_button::Entity),
TabCloseForce(segmented_button::Entity),
TabContextAction(segmented_button::Entity, Action),
TabContextMenu(segmented_button::Entity, bool),
TabContextMenu(segmented_button::Entity, Option<Point>),
TabNext,
TabPrev,
TabSetCursor(segmented_button::Entity, Cursor),
@ -530,7 +526,7 @@ impl App {
continue;
}
let entry_path = entry.path();
let node = match ProjectNode::new(entry_path) {
let node = match ProjectNode::new(&entry_path) {
Ok(ok) => ok,
Err(err) => {
log::error!(
@ -683,11 +679,11 @@ impl App {
//TODO: allow files to be open multiple times
let mut activate_opt = None;
for entity in self.tab_model.iter() {
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity)
&& tab.path_opt.as_ref() == Some(&canonical)
{
activate_opt = Some(entity);
break;
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity) {
if tab.path_opt.as_ref() == Some(&canonical) {
activate_opt = Some(entity);
break;
}
}
}
if let Some(entity) = activate_opt {
@ -735,10 +731,10 @@ impl App {
}
let entities: Vec<_> = self.tab_model.iter().collect();
for entity in entities {
if self.tab_model.is_active(entity)
&& let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity)
{
tab.set_config(&self.config);
if self.tab_model.is_active(entity) {
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
tab.set_config(&self.config);
}
}
}
}
@ -755,10 +751,10 @@ impl App {
}
fn save_config_state(&mut self) {
if let Some(ref config_state_handler) = self.config_state_handler
&& let Err(err) = self.config_state.write_entry(config_state_handler)
{
log::error!("failed to save config_state: {}", err);
if let Some(ref config_state_handler) = self.config_state_handler {
if let Err(err) = self.config_state.write_entry(config_state_handler) {
log::error!("failed to save config_state: {}", err);
}
}
}
@ -778,10 +774,10 @@ impl App {
Some(DialogPage::PromptSaveQuit(ref _entities)) => {
let mut unsaved = Vec::new();
for entity in self.tab_model.iter() {
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity)
&& tab.changed()
{
unsaved.push(entity);
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity) {
if tab.changed() {
unsaved.push(entity);
}
}
}
if unsaved.is_empty() {
@ -920,16 +916,16 @@ impl App {
}
'tabs: for entity in self.tab_model.iter() {
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity)
&& let Some(path) = &tab.path_opt
{
for (_, project_path) in self.projects.iter() {
if path.starts_with(project_path) {
// Do not watch tabs inside of already watched projects
continue 'tabs;
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity) {
if let Some(path) = &tab.path_opt {
for (_, project_path) in self.projects.iter() {
if path.starts_with(&project_path) {
// Do not watch tabs inside of already watched projects
continue 'tabs;
}
}
new_paths.insert((path.to_path_buf(), RecursiveMode::NonRecursive));
}
new_paths.insert((path.to_path_buf(), RecursiveMode::NonRecursive));
}
}
@ -1444,7 +1440,7 @@ impl Application for App {
let mut theme_names =
Vec::with_capacity(SYNTAX_SYSTEM.get().unwrap().theme_set.themes.len());
for theme_name in SYNTAX_SYSTEM.get().unwrap().theme_set.themes.keys() {
for (theme_name, _theme) in SYNTAX_SYSTEM.get().unwrap().theme_set.themes.iter() {
theme_names.push(theme_name.to_string());
}
@ -1463,7 +1459,7 @@ impl Application for App {
.comments(fl!("comment"))
.license("GPL-3.0-only")
.license_url("https://spdx.org/licenses/GPL-3.0-only")
.developers([("System76", "info@system76.com")])
.developers([("Jeremy Soller", "jeremy@system76.com")])
.links([
(fl!("repository"), "https://github.com/pop-os/cosmic-edit"),
(
@ -1653,7 +1649,9 @@ impl Application for App {
}
fn dialog(&self) -> Option<Element<'_, Self::Message>> {
let dialog = self.dialog_page_opt.as_ref()?;
let Some(ref dialog) = self.dialog_page_opt else {
return None;
};
let cosmic_theme::Spacing { space_xxs, .. } = self.core().system_theme().cosmic().spacing;
@ -1936,21 +1934,21 @@ impl Application for App {
return self.update_config();
}
Message::FindNext => {
if !self.find_search_value.is_empty()
&& let Some(Tab::Editor(tab)) = self.active_tab()
{
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
tab.search(&regex, true, self.config.find_wrap_around);
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
if !self.find_search_value.is_empty() {
if let Some(Tab::Editor(tab)) = self.active_tab() {
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
tab.search(&regex, true, self.config.find_wrap_around);
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
}
}
}
}
@ -1959,21 +1957,21 @@ impl Application for App {
return self.update_focus();
}
Message::FindPrevious => {
if !self.find_search_value.is_empty()
&& let Some(Tab::Editor(tab)) = self.active_tab()
{
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
tab.search(&regex, false, self.config.find_wrap_around);
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
if !self.find_search_value.is_empty() {
if let Some(Tab::Editor(tab)) = self.active_tab() {
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
tab.search(&regex, false, self.config.find_wrap_around);
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
}
}
}
}
@ -1982,27 +1980,27 @@ impl Application for App {
return self.update_focus();
}
Message::FindReplace => {
if !self.find_search_value.is_empty()
&& let Some(Tab::Editor(tab)) = self.active_tab()
{
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
//TODO: support captures
tab.replace(
&regex,
&self.find_replace_value,
self.config.find_wrap_around,
);
return self.update(Message::TabChanged(self.tab_model.active()));
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
if !self.find_search_value.is_empty() {
if let Some(Tab::Editor(tab)) = self.active_tab() {
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
//TODO: support captures
tab.replace(
&regex,
&self.find_replace_value,
self.config.find_wrap_around,
);
return self.update(Message::TabChanged(self.tab_model.active()));
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
}
}
}
}
@ -2011,27 +2009,27 @@ impl Application for App {
return self.update_focus();
}
Message::FindReplaceAll => {
if !self.find_search_value.is_empty()
&& let Some(Tab::Editor(tab)) = self.active_tab()
{
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
//TODO: support captures
{
let mut editor = tab.editor.lock().unwrap();
editor.set_cursor(cosmic_text::Cursor::new(0, 0));
if !self.find_search_value.is_empty() {
if let Some(Tab::Editor(tab)) = self.active_tab() {
//TODO: do not compile find regex on every search?
match self.config.find_regex(&self.find_search_value) {
Ok(regex) => {
//TODO: support captures
{
let mut editor = tab.editor.lock().unwrap();
editor.set_cursor(cosmic_text::Cursor::new(0, 0));
}
while tab.replace(&regex, &self.find_replace_value, false) {}
return self.update(Message::TabChanged(self.tab_model.active()));
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
}
while tab.replace(&regex, &self.find_replace_value, false) {}
return self.update(Message::TabChanged(self.tab_model.active()));
}
Err(err) => {
//TODO: put regex error in find box
log::warn!(
"failed to compile regex {:?}: {}",
self.find_search_value,
err
);
}
}
}
@ -2164,21 +2162,22 @@ impl Application for App {
}
}
}
Message::NoOp => {
// Do nothing
}
Message::NotifyEvent(event) => {
// Reload tabs that changed
let mut tab_reload = Vec::new();
for entity in self.tab_model.iter() {
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity)
&& let Some(path) = &tab.path_opt
&& event.paths.contains(path)
{
if tab.changed() {
log::warn!("file changed externally before being saved: {:?}", path);
} else {
tab_reload.push(entity);
if let Some(Tab::Editor(tab)) = self.tab_model.data::<Tab>(entity) {
if let Some(path) = &tab.path_opt {
if event.paths.contains(path) {
if tab.changed() {
log::warn!(
"file changed externally before being saved: {:?}",
path
);
} else {
tab_reload.push(entity);
}
}
}
}
}
@ -2276,7 +2275,7 @@ impl Application for App {
{
for (_, project_path) in self.projects.iter() {
for path in event.paths.iter() {
if let Ok(prefix) = path.strip_prefix(project_path) {
if let Ok(prefix) = path.strip_prefix(&project_path) {
// Manually ignore project .git folders
//TODO: use logic from ignore crate somehow?
if prefix.starts_with(".git") {
@ -2346,10 +2345,10 @@ impl Application for App {
{
let mut close = Vec::new();
for entity in self.tab_model.iter() {
if let Some(Tab::GitDiff(other_tab)) = self.tab_model.data::<Tab>(entity)
&& other_tab.diff.path == diff.path
{
close.push(entity);
if let Some(Tab::GitDiff(other_tab)) = self.tab_model.data::<Tab>(entity) {
if other_tab.diff.path == diff.path {
close.push(entity);
}
}
}
for entity in close {
@ -2667,10 +2666,10 @@ impl Application for App {
tab.path_opt = Some(paths.remove(0));
title_opt = Some(tab.title());
tab.save();
if let Some(path) = tab.path_opt.clone()
&& let Ok(canonical) = fs::canonicalize(&path)
{
self.add_to_recents(&canonical);
if let Some(path) = tab.path_opt.clone() {
if let Ok(canonical) = fs::canonicalize(&path) {
self.add_to_recents(&canonical);
}
}
}
if let Some(title) = title_opt {
@ -2708,7 +2707,9 @@ impl Application for App {
}
}
Message::Surface(a) => {
return cosmic::task::message(cosmic::Action::Surface(a));
return cosmic::task::message(cosmic::Action::Cosmic(
cosmic::app::Action::Surface(a),
));
}
Message::SystemThemeModeChange(_theme_mode) => {
return self.update_config();
@ -2787,9 +2788,7 @@ impl Application for App {
}
Message::TabCloseForce(entity) => {
// Activate closest item
if self.tab_model.active() == entity
&& let Some(position) = self.tab_model.position(entity)
{
if let Some(position) = self.tab_model.position(entity) {
if position > 0 {
self.tab_model.activate_position(position - 1);
} else {
@ -2816,15 +2815,15 @@ impl Application for App {
Message::TabContextAction(entity, action) => {
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
// Close context menu
tab.context_menu_open = false;
tab.context_menu = None;
// Run action's message
return self.update(action.message(None));
}
}
Message::TabContextMenu(entity, open) => {
Message::TabContextMenu(entity, position_opt) => {
if let Some(Tab::Editor(tab)) = self.tab_model.data_mut::<Tab>(entity) {
// Update context menu
tab.context_menu_open = open;
tab.context_menu = position_opt;
}
}
Message::TabNext => {
@ -2846,7 +2845,13 @@ impl Application for App {
.tab_model
.position(self.tab_model.active())
.and_then(|i| (i as usize).checked_sub(1))
.unwrap_or_else(|| self.tab_model.iter().count().saturating_sub(1));
.unwrap_or_else(|| {
self.tab_model
.iter()
.count()
.checked_sub(1)
.unwrap_or_default()
});
let entity = self.tab_model.iter().nth(pos);
if let Some(entity) = entity {
@ -3023,19 +3028,12 @@ impl Application for App {
}
fn header_start(&self) -> Vec<Element<'_, Message>> {
let has_selection = match self.active_tab() {
Some(Tab::Editor(tab)) => tab.editor.lock().unwrap().selection() != Selection::None,
Some(Tab::GitDiff(_)) => false,
None => false,
};
vec![menu_bar(
&self.core,
&self.config,
&self.config_state,
&self.key_binds,
&self.projects,
has_selection,
)]
}
@ -3080,25 +3078,23 @@ impl Application for App {
.on_focus(Message::FindFocused(false))
.on_auto_scroll(Message::AutoScroll)
.on_changed(Message::TabChanged(tab_id))
.has_context_menu(tab.context_menu_open)
.on_context_menu(move |open| Message::TabContextMenu(tab_id, open));
.has_context_menu(tab.context_menu.is_some())
.on_context_menu(move |position_opt| {
Message::TabContextMenu(tab_id, position_opt)
});
if self.config.highlight_current_line {
text_box = text_box.highlight_current_line();
}
if self.config.line_numbers {
text_box = text_box.line_numbers();
}
let has_selection = tab.editor.lock().unwrap().selection() != Selection::None;
let mut context_menu = widget::context_menu(
text_box,
Some(menu::context_menu(&self.key_binds, tab_id, has_selection)),
)
.on_close(Message::TabContextMenu(tab_id, false))
.on_surface_action(Message::Surface);
if let Some(window_id) = self.core().main_window_id() {
context_menu = context_menu.window_id(window_id);
let mut popover = widget::popover(text_box);
if let Some(point) = tab.context_menu {
popover = popover
.popup(menu::context_menu(&self.key_binds, tab_id))
.position(widget::popover::Position::Point(point));
}
tab_column = tab_column.push(context_menu);
tab_column = tab_column.push(popover);
if self.config.vim_bindings {
let status = {
let editor = tab.editor.lock().unwrap();

View file

@ -1,22 +1,21 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::widget::menu::Item as MenuItem;
use cosmic::widget::menu::action::MenuAction;
use cosmic::widget::menu::key_bind::KeyBind;
use cosmic::{
Element,
app::Core,
iced::{
Background, Border, Length, advanced::widget::text::Style as TextStyle, widget::column,
},
theme,
widget::{
self,
menu::{ItemHeight, ItemWidth},
responsive_menu_bar, segmented_button,
self, divider,
menu::{ItemHeight, ItemWidth, menu_button},
responsive_menu_bar, segmented_button, space,
},
};
use std::{
collections::HashMap,
path::{Path, PathBuf},
sync::LazyLock,
};
use std::{collections::HashMap, path::PathBuf, sync::LazyLock};
use crate::{Action, Config, ConfigState, Message, fl};
@ -64,7 +63,7 @@ fn truncate_middle(value: &str, max_chars: usize) -> String {
)
}
fn format_recent_menu_path(path: &Path, home_dir_opt: Option<&PathBuf>) -> String {
fn format_recent_menu_path(path: &PathBuf, home_dir_opt: Option<&PathBuf>) -> String {
const ELLIPSIS: &str = "...";
let display = if let Some(home_dir) = home_dir_opt {
@ -117,49 +116,65 @@ fn format_recent_menu_path(path: &Path, home_dir_opt: Option<&PathBuf>) -> Strin
truncate_middle(&display, RECENT_MENU_LABEL_MAX_CHARS)
}
/// A context menu action dispatched to the tab the menu was opened on.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct TabAction(pub segmented_button::Entity, pub Action);
impl MenuAction for TabAction {
type Message = Message;
fn message(&self) -> Message {
Message::TabContextAction(self.0, self.1)
}
}
pub fn context_menu(
pub fn context_menu<'a>(
key_binds: &HashMap<KeyBind, Action>,
entity: segmented_button::Entity,
has_selection: bool,
) -> Vec<widget::menu::Tree<Message>> {
let item =
|label: String, action: Action| MenuItem::Button(label, None, TabAction(entity, action));
let optional = |label: String, action: Action, enabled: bool| {
if enabled {
MenuItem::Button(label, None, TabAction(entity, action))
} else {
MenuItem::ButtonDisabled(label, None, TabAction(entity, action))
) -> Element<'a, Message> {
fn key_style(theme: &cosmic::Theme) -> TextStyle {
let mut color = theme.cosmic().background(false).component.on;
color.alpha *= 0.75;
TextStyle {
color: Some(color.into()),
..Default::default()
}
}
let menu_item = |menu_label, menu_action| {
let mut key = String::new();
for (key_bind, key_action) in key_binds.iter() {
if key_action == &menu_action {
key = key_bind.to_string();
break;
}
}
menu_button(vec![
widget::text(menu_label).into(),
space::horizontal().into(),
widget::text(key)
.class(theme::Text::Custom(key_style))
.into(),
])
.on_press(Message::TabContextAction(entity, menu_action))
};
let key_binds: HashMap<KeyBind, TabAction> = key_binds
.iter()
.map(|(key_bind, action)| (key_bind.clone(), TabAction(entity, *action)))
.collect();
widget::menu::items(
&key_binds,
vec![
item(fl!("undo"), Action::Undo),
item(fl!("redo"), Action::Redo),
MenuItem::Divider,
optional(fl!("cut"), Action::Cut, has_selection),
optional(fl!("copy"), Action::Copy, has_selection),
item(fl!("paste"), Action::Paste),
item(fl!("select-all"), Action::SelectAll),
],
)
widget::container(column!(
menu_item(fl!("undo"), Action::Undo),
menu_item(fl!("redo"), Action::Redo),
divider::horizontal::light(),
menu_item(fl!("cut"), Action::Cut),
menu_item(fl!("copy"), Action::Copy),
menu_item(fl!("paste"), Action::Paste),
menu_item(fl!("select-all"), Action::SelectAll),
))
.padding(1)
//TODO: move style to libcosmic
.style(|theme| {
let cosmic = theme.cosmic();
let component = &cosmic.background(false).component;
widget::container::Style {
icon_color: Some(component.on.into()),
text_color: Some(component.on.into()),
background: Some(Background::Color(component.base.into())),
border: Border {
radius: cosmic.radius_s().map(|x| x + 1.0).into(),
width: 1.0,
color: component.divider.into(),
},
..Default::default()
}
})
.width(Length::Fixed(240.0))
.into()
}
pub fn menu_bar<'a>(
@ -167,8 +182,7 @@ pub fn menu_bar<'a>(
config: &Config,
config_state: &ConfigState,
key_binds: &HashMap<KeyBind, Action>,
projects: &[(String, PathBuf)],
has_selection: bool,
projects: &Vec<(String, PathBuf)>,
) -> Element<'a, Message> {
//TODO: port to libcosmic
let menu_tab_width = |tab_width: u16| {
@ -261,16 +275,8 @@ pub fn menu_bar<'a>(
MenuItem::Button(fl!("undo"), None, Action::Undo),
MenuItem::Button(fl!("redo"), None, Action::Redo),
MenuItem::Divider,
if has_selection {
MenuItem::Button(fl!("cut"), None, Action::Cut)
} else {
MenuItem::ButtonDisabled(fl!("cut"), None, Action::NoOp)
},
if has_selection {
MenuItem::Button(fl!("copy"), None, Action::Copy)
} else {
MenuItem::ButtonDisabled(fl!("copy"), None, Action::NoOp)
},
MenuItem::Button(fl!("cut"), None, Action::Cut),
MenuItem::Button(fl!("copy"), None, Action::Copy),
MenuItem::Button(fl!("paste"), None, Action::Paste),
MenuItem::Button(fl!("select-all"), None, Action::SelectAll),
MenuItem::Divider,

View file

@ -29,15 +29,15 @@ impl ProjectNode {
let path = fs::canonicalize(path)?;
let name = path
.file_name()
.ok_or(io::Error::other(format!(
"path {:?} has no file name",
path
)))?
.ok_or(io::Error::new(
io::ErrorKind::Other,
format!("path {:?} has no file name", path),
))?
.to_str()
.ok_or(io::Error::other(format!(
"path {:?} is not valid UTF-8",
path
)))?
.ok_or(io::Error::new(
io::ErrorKind::Other,
format!("path {:?} is not valid UTF-8", path),
))?
.to_string();
Ok(if path.is_dir() {
Self::Folder {

View file

@ -54,10 +54,10 @@ impl ProjectSearchResult {
}
};
if let Some(file_type) = entry.file_type()
&& file_type.is_dir()
{
continue;
if let Some(file_type) = entry.file_type() {
if file_type.is_dir() {
continue;
}
}
let entry_path = entry.path();

View file

@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::{iced::advanced::graphics::text::font_system, widget::icon};
use cosmic::{
iced::{Point, advanced::graphics::text::font_system},
widget::icon,
};
use cosmic_files::mime_icon::{FALLBACK_MIME_ICON, mime_for_path, mime_icon};
use cosmic_text::{Attrs, Buffer, Cursor, Edit, Selection, Shaping, SyntaxEditor, ViEditor, Wrap};
use regex::Regex;
@ -25,7 +28,6 @@ fn editor_text(editor: &ViEditor<'static, 'static>) -> String {
})
}
#[allow(clippy::large_enum_variant)]
pub enum Tab {
Editor(EditorTab),
GitDiff(GitDiffTab),
@ -49,7 +51,7 @@ pub struct EditorTab {
pub path_opt: Option<PathBuf>,
attrs: Attrs<'static>,
pub editor: Mutex<ViEditor<'static, 'static>>,
pub context_menu_open: bool,
pub context_menu: Option<Point>,
pub zoom_adj: i8,
}
@ -73,7 +75,7 @@ impl EditorTab {
path_opt: None,
attrs,
editor: Mutex::new(ViEditor::new(editor)),
context_menu_open: false,
context_menu: None,
zoom_adj,
};
@ -314,7 +316,7 @@ impl EditorTab {
.filter_map(|m| {
if cursor.line != start_line
|| m.start() >= cursor.index
|| m.start() < cursor.index && wrapped
|| m.start() < cursor.index && wrapped == true
{
Some((m.start(), m.len()))
} else {
@ -391,7 +393,7 @@ impl EditorTab {
if cursor.line != start_line
|| m.start() > cursor.index
|| m.start() == cursor.index && current_selection == Selection::None
|| m.start() < cursor.index && wrapped
|| m.start() < cursor.index && wrapped == true
{
Some((m.start(), m.end()))
} else {
@ -434,7 +436,7 @@ impl EditorTab {
if cursor.line != start_line
|| m.start() < cursor.index
|| m.start() == cursor.index && current_selection == Selection::None
|| m.start() > cursor.index && wrapped
|| m.start() > cursor.index && wrapped == true
{
Some((m.start(), m.end()))
} else {

View file

@ -51,7 +51,7 @@ pub struct TextBox<'a, Message> {
on_focus: Option<Message>,
click_timing: Duration,
has_context_menu: bool,
on_context_menu: Option<Box<dyn Fn(bool) -> Message + 'a>>,
on_context_menu: Option<Box<dyn Fn(Option<Point>) -> Message + 'a>>,
highlight_current_line: bool,
line_numbers: bool,
}
@ -107,7 +107,10 @@ where
self
}
pub fn on_context_menu(mut self, on_context_menu: impl Fn(bool) -> Message + 'a) -> Self {
pub fn on_context_menu(
mut self,
on_context_menu: impl Fn(Option<Point>) -> Message + 'a,
) -> Self {
self.on_context_menu = Some(Box::new(on_context_menu));
self
}
@ -317,8 +320,9 @@ where
editor.with_buffer(|buffer| {
let mut layout_lines = 0;
for line in buffer.lines.iter() {
if let Some(layout) = line.layout_opt() {
layout_lines += layout.len()
match line.layout_opt() {
Some(layout) => layout_lines += layout.len(),
None => (),
}
}
@ -754,7 +758,7 @@ where
match editor.buffer_ref() {
cosmic_text::BufferRef::Arc(buffer) => {
renderer.fill_raw(Raw {
buffer: Arc::downgrade(buffer),
buffer: Arc::downgrade(&buffer),
position: pos,
color: Color::from_rgba(1.0, 1.0, 1.0, 1.0),
clip_bounds,
@ -821,7 +825,7 @@ where
let scrollbar_color = if pressed {
// pressed_state_color, 0.5
cosmic_theme
.background(theme.transparent)
.background(false)
.component
.pressed
.without_alpha()
@ -830,7 +834,7 @@ where
} else if hover {
// hover_state_color, 0.2
cosmic_theme
.background(theme.transparent)
.background(false)
.component
.hover
.without_alpha()
@ -917,7 +921,7 @@ where
let scrollbar_color = if pressed {
// pressed_state_color, 0.5
cosmic_theme
.background(theme.transparent)
.background(false)
.component
.pressed
.without_alpha()
@ -926,7 +930,7 @@ where
} else if hover {
// hover_state_color, 0.2
cosmic_theme
.background(theme.transparent)
.background(false)
.component
.hover
.without_alpha()
@ -1085,22 +1089,22 @@ where
Named::Backspace => {
delete_modifiers(&mut editor, Motion::LeftWord, *modifiers);
editor.action(Action::Backspace);
editor.set_redraw(true);
shell.capture_event();
}
Named::Delete => {
delete_modifiers(&mut editor, Motion::RightWord, *modifiers);
editor.action(Action::Delete);
editor.set_redraw(true);
shell.capture_event();
}
Named::Tab if !modifiers.control() && !modifiers.alt() => {
if modifiers.shift() {
editor.action(Action::Unindent);
} else {
editor.action(Action::Indent);
Named::Tab => {
if !modifiers.control() && !modifiers.alt() {
if modifiers.shift() {
editor.action(Action::Unindent);
} else {
editor.action(Action::Indent);
}
shell.capture_event();
}
shell.capture_event();
}
_ => (),
},
@ -1149,7 +1153,7 @@ where
InputMethodEvent::Commit(text) => {
if state.is_focused {
editor.start_change();
editor.insert_string(text, None);
editor.insert_string(&text, None);
editor.finish_change();
shell.capture_event();
}
@ -1171,13 +1175,13 @@ where
let y = y_logical * scale_factor;
// Do this first as the horizontal scrollbar is on top of the buffer
if let Some(scrollbar_h_rect) = state.scrollbar_h_rect.get()
&& scrollbar_h_rect.contains(Point::new(x_logical, y_logical))
{
state.dragging = Some(Dragging::ScrollbarH {
start_x: x,
start_scroll: editor.with_buffer(|buffer| buffer.scroll()),
});
if let Some(scrollbar_h_rect) = state.scrollbar_h_rect.get() {
if scrollbar_h_rect.contains(Point::new(x_logical, y_logical)) {
state.dragging = Some(Dragging::ScrollbarH {
start_x: x,
start_scroll: editor.with_buffer(|buffer| buffer.scroll()),
});
}
}
if matches!(state.dragging, Some(Dragging::ScrollbarH { .. })) {
@ -1204,7 +1208,7 @@ where
ClickKind::Single
};
let maybe_anchor = if state.modifiers.shift() {
*state.shift_anchor.lock().unwrap()
state.shift_anchor.lock().unwrap().clone()
} else {
None
};
@ -1261,9 +1265,14 @@ where
// Update context menu state
if let Some(on_context_menu) = &self.on_context_menu {
shell.publish((on_context_menu)(
!self.has_context_menu && matches!(button, Button::Right),
));
shell.publish((on_context_menu)(if self.has_context_menu {
None
} else {
match button {
Button::Right => Some(p),
_ => None,
}
}));
}
shell.capture_event();
@ -1385,9 +1394,11 @@ where
shell.capture_event();
}
}
Event::Window(WindowEvent::RedrawRequested(_now)) if state.is_focused => {
state.caret_position = editor.cursor_position().unwrap_or(state.caret_position);
shell.request_input_method(&self.input_method(state, scale_factor, layout));
Event::Window(WindowEvent::RedrawRequested(_now)) => {
if state.is_focused {
state.caret_position = editor.cursor_position().unwrap_or(state.caret_position);
shell.request_input_method(&self.input_method(state, scale_factor, layout));
}
}
_ => (),
}
@ -1401,10 +1412,6 @@ where
shell.publish(on_changed.clone());
}
}
if editor.redraw() {
shell.request_redraw();
}
}
}