Commit graph

286 commits

Author SHA1 Message Date
Jeremy Soller
6dbc5d5ef7
Merge pull request #503 from pop-os/new-buffer-zero-size
Set buffer size to zero on creation
2026-01-27 12:34:01 -07:00
Jeremy Soller
ad206c3115
Set buffer size to zero on creation to improve file load times and memory usage 2026-01-23 09:40:19 -07:00
Jeremy Soller
1c037f0a6e
Fix compilation with new cosmic_text 2026-01-22 09:54:18 -07:00
Frederic Laing
290be82696 implement shift press plus mouse click text selection 2025-12-31 13:03:54 -06:00
Ashley Wulber
20a278587a chore: update cosmic-text 2025-12-09 11:38:28 -07:00
Jeremy Soller
f0cb90733c
Fix horizontal scrolling with wheel or touchpad and improve scrollbar behavior 2025-11-11 18:42:59 -07:00
Jeremy Soller
449ff6b88c
Reload folder tree and git status using recursive watcher 2025-11-11 13:24:50 -07:00
Jeremy Soller
f0adef5fa0
Change text_box redraw log level to trace 2025-11-11 13:21:46 -07:00
Jeremy Soller
ec78c39a58
Show open project placeholder only if no projects open 2025-11-11 11:50:47 -07:00
Jeremy Soller
2e6487542c
Use ignore crate to build tree view 2025-11-11 11:49:22 -07:00
Jeremy Soller
b48e7b0865
Make context drawer inline 2025-11-10 07:44:29 -07:00
Jeremy Soller
0a3b248c67
Close git diff tabs with same path when new one is opened 2025-11-10 07:44:28 -07:00
Jeremy Soller
fbad8439ae
Remove extra line in project search 2025-11-10 07:44:27 -07:00
Jeremy Soller
392f6e6ab1
Clip text box 2025-11-06 16:49:17 -07:00
Jeremy Soller
966cc0f332
Draw most items with GPU, except for line numbers 2025-11-06 13:40:10 -07:00
Ashley Wulber
73446cdafc fix: focus find on window focus if text box did not have focus 2025-10-24 20:47:07 +02:00
Jeremy Soller
252d5a7953
Filter out changes from saves in EditorTab::reload, fixes #431 2025-10-17 08:12:58 -06:00
Jeremy Soller
bce1d2aebc
Allow opening of non-existant files, fixes #434 2025-10-14 09:58:44 -06:00
Jeremy Soller
117f00337d
Preserve newlines and get closest cursor on reload, fixes #390 2025-10-09 12:28:39 -06:00
aquiles
801c7fa68c Fix character counting in document statistics to use graphemes
- Add unicode-segmentation dependency for proper grapheme cluster support
- Replace chars() iteration with graphemes(true) for accurate character counting
- Fix counting of complex Unicode characters like emojis, combining characters, and multi-byte sequences
- Resolves TODO: 'do graphemes?' in document_statistics function

This change provides more accurate character counts for international text,
emojis with skin tones, combined characters, and other multi-codepoint graphemes.

Examples of improved accuracy:
- 👍🏾 now counts as 1 character instead of 2
- é (e + combining acute) counts as 1 character instead of 2
- 🧑‍💻 (person technologist) counts as 1 character instead of 4
2025-10-09 08:34:18 -06:00
aquiles
4bf88ae6ad Refactor: Extract monospace_attrs() helper to eliminate code duplication
- Add monospace_attrs() function in main.rs to centralize monospace font attributes creation
- Replace duplicated Attrs::new().family(Family::Monospace) calls in:
  * line_number.rs: LineNumberCache::get() method
  * main.rs: App::init() font enumeration
  * tab.rs: EditorTab::new() constructor
- Remove unused imports (Attrs, Family) from line_number.rs
- Resolves TODO comments about code repetition across modules

This change improves maintainability by having a single source of truth
for monospace font configuration.
2025-10-05 06:22:37 +00:00
Ashley Wulber
bde36a3c17
chore: update libcosmic 2025-10-03 15:02:53 -04:00
Jeremy Soller
099e32bdc0
Use modiifed_key instead of key, fixes #286 2025-09-16 08:57:37 -06:00
Vukašin Vojinović
d2b13f987d chore: update to icu 2.0
Reduces binary size by about 25 MB.
2025-09-15 23:51:07 +02:00
Vukašin Vojinović
ee4272112e chore: make dbus-config optional 2025-09-13 10:53:00 +02:00
Vukašin Vojinović
b380b1bf32 chore: update dependencies
Also switches to the `about` widget.
2025-09-11 19:36:09 +02:00
Vukašin Vojinović
e405b929c1 chore: Rust 2024 edition 2025-09-11 16:26:28 +02:00
Jeremy Soller
038d770200 Adjust scroll speeds 2025-09-07 19:57:47 -06:00
Jeremy Soller
1e2424861d
Update to latest cosmic-text 2025-09-07 19:45:52 -06:00
Andrew Yatsko
18f6bc4e74 fix(322): fix undo/redo after reverting all changes 2025-08-24 15:17:02 -04:00
Michael Aaron Murphy
a5ee0e75d8
improv: use new and improved FileNav style 2025-08-19 16:32:01 +02:00
Jeremy Soller
863f570b56
Fix compilation with new cosmic-files dialog API 2025-07-01 09:38:23 -06:00
Jeremy Soller
9758fe034e
Adjust shortcut text style 2025-06-27 11:40:59 -06:00
Ashley Wulber
c47c12fe17 feat: menubar popups 2025-06-18 14:38:52 -04:00
ellieplayswow
40a54654dc
feat(text_box): add CTRL+<backspace> and CTRL+<delete> keybinds (delete left/right word) (#353) 2025-05-12 08:12:48 -06:00
ellieplayswow
32cab6eef6
bugfix(text_box): ignoring tab key presses when alt is held (#348) 2025-05-07 19:34:58 -06:00
ellieplayswow
7fa83125ab
bugfix(replace): fix issue with regexes targeting empty lines replacing with nothing (#347) 2025-04-30 14:17:48 -06:00
Ashley Wulber
9336731c7d feat: responsive menu 2025-04-16 20:35:40 +02:00
Jeremy Soller
2fc1abe0b8
Update dependencies 2025-03-31 09:16:20 -06:00
Jeremy Soller
4b75c32bff Update default font 2025-02-20 11:13:10 -07:00
l-const
f97b4fe76c
perf: reduce disk io when updating config values. 2025-02-19 07:50:14 +02:00
l-const
f67a6b5a02 chore: remove forgotten eprintln. 2025-02-18 13:19:11 -07:00
l-const
5b71f5f850 (feat): Text zoom for cosmic-edit. 2025-02-18 12:43:00 -07:00
Jeremy Soller
04f2812f4e
Implement drag scroll, fixes #154 2025-02-05 15:28:38 -07:00
Hadi Chokr
8e7c6bcf68
Enable saving read-only/root files via pkexec (Fixes #249) (#304)
* Enable saving read-only/root files via pkexec (Fixes #249)

This update addresses the issue where users couldn't open Cosmic Edit as root. It allows users to save read-only or root files using pkexec for privilege escalation, all within the graphical interface of Cosmic Edit, eliminating the need to open the terminal.

Changes:

    Implemented pkexec functionality for saving read-only/root files.
    Added a confirmation dialog for file modifications.

This feature resolves issue #249 and streamlines the process, ensuring a smoother experience for users managing protected files directly within Cosmic Edit.

* Secure pkexec handling with piped stdin and escape safety

Enhanced permission handling by using `pkexec` with `tee` and piped stdin. This implementation avoids shell injection risks and ensures proper handling of special escape characters in the input. The approach securely writes text content to files with elevated privileges while maintaining robustness against potentially malicious inputs.

* Update tab.rs

* Log Errors but dont crash

* Update tab.rs

* Update tab.rs

* Clean up after child (sounds weird...)
2025-01-23 13:47:16 -07:00
Jeremy Soller
3effc64df5
Fix closing projects when open project button is shown, fixes #41 2025-01-17 10:10:14 -07:00
Jeremy Soller
bde7e2bfc2
Don't capture ctrl+tab in text box, fixes #123 2025-01-17 09:49:30 -07:00
Jeremy Soller
686185b0f1
Implement revert all changes, fixes #128 2025-01-17 09:43:46 -07:00
Jeremy Soller
03de470425 Remove unimplemented spell-check menu item, fixes #300 2025-01-16 12:43:35 -07:00
toftpokk
c6cd819fff Fix clicking outside textbox to unfocus 2024-12-22 07:35:33 -07:00