Commit graph

652 commits

Author SHA1 Message Date
Jeremy Soller
a82573e650 Do not keep github pages history 2024-06-18 09:13:09 -06:00
Jeremy Soller
7677ba388c Revert "Promote Noto Color Emoji fallback"
This reverts commit 5e82de11cf.
2024-06-17 17:20:34 -06:00
Jeremy Soller
24fb208953
Downgrade fontdb until iced can update resvg 2024-06-15 18:51:57 -06:00
Kristoffer Ödmark
542b20ca43 Upgrade dependencies, and re-export ttf-parser so that dependents can verify fonts using the same ttf-parser version 2024-06-15 06:05:18 -06:00
Jeremy Soller
8bb45d7aca
Shape tabs as spaces, fixes #248 2024-06-12 10:34:19 -06:00
Piotr
a46e992396 add method to set syntax highlighting by file extension 2024-06-12 09:56:59 -06:00
Jeremy Soller
69d5aec7fc
Fix infinite loop if scroll is on invalid line 2024-06-12 09:42:27 -06:00
Jeremy Soller
93a7df859a Allow for undefined buffer width and/or height, fixes #70 2024-06-12 09:14:56 -06:00
Jeremy Soller
cd1cd0a337 Allow syn duplicate until derivative updates its syn dependency 2024-06-12 08:00:33 -06:00
Jeremy Soller
b288de13ae Allow layout to be calculated without specifying width 2024-06-12 08:00:33 -06:00
Pavel Strakhov
a3a6262e5d Add Edit::cursor_position 2024-06-10 10:39:58 -06:00
Jeremy Soller
320b034f5b Performance improvement in set_tab_width 2024-06-10 10:21:25 -06:00
Pavel Strakhov
10ae9a9b16 Add an option to set selected text color 2024-06-10 10:15:09 -06:00
Jeremy Soller
3c94352f3f Support expanding tabs 2024-06-10 08:12:42 -06:00
Jeremy Soller
56812a8348 Make vertical scroll by pixels instead of layout lines 2024-06-10 08:05:27 -06:00
Jeremy Soller
6eb67bb524
Use default metrics for empty lines, fixes #258 2024-06-07 11:27:49 -06:00
Jeremy Soller
21e88ebc45
Move line height calculation to LayoutLine 2024-06-07 10:52:26 -06:00
Julian Braha
31d3ceca51 Only use libm dependency for no_std feature 2024-06-06 19:42:47 -06:00
Jeremy Soller
c7100dc989 Format 2024-06-06 19:38:40 -06:00
Jeremy Soller
497003e67e Fall back to buffer line height only if no glyphs found 2024-06-06 19:38:40 -06:00
Jeremy Soller
020701734e Address review 2024-06-06 19:38:40 -06:00
Jeremy Soller
896f36cdab Embed font for wrap_word_fallback test 2024-06-06 19:38:40 -06:00
Jeremy Soller
37688747e1 Use line height from attrs 2024-06-06 19:38:40 -06:00
Jeremy Soller
8638ec29bb Add metrics to attributes 2024-06-06 19:38:40 -06:00
Jeremy Soller
89503b254f
Fix compilation without std feature 2024-06-05 08:19:34 -06:00
Itsusinn
39c4e3e02b refactor: move "rayon" feature under "std" 2024-06-05 08:15:51 -06:00
Itsusinn
1f52b5211c fix: no redundant load 2024-06-05 08:15:51 -06:00
Itsusinn
658025314c feat: concurrently load & parse fonts 2024-06-05 08:15:51 -06:00
apricotbucket28
5e82de11cf Promote Noto Color Emoji fallback 2024-06-04 17:51:21 -06:00
Jeremy Soller
b0a70c70ff
Fix horizontal scrolling to start of empty line 2024-05-30 14:36:18 -06:00
Jeremy Soller
cb9d405c20
Fix horizontal scroll to end of line 2024-05-30 14:33:35 -06:00
Jeremy Soller
570999809c
Track horizontal scroll (which must be implemented by renderers) 2024-05-30 14:26:38 -06:00
Jeremy Soller
2f5f2c63da
Fix extra newline in crlf sample 2024-04-30 12:26:28 -06:00
Jeremy Soller
10d5888d11
Ensure at least one line is in Buffer 2024-04-30 12:21:21 -06:00
Jeremy Soller
0cfd9b64ef
Add line ending abstraction (#250)
* Add line ending abstraction

* Make Buffer::set_text use LineIter

* Add ctrl+s for saving to editor
2024-04-30 12:12:25 -06:00
Joshua Megnauth
ff5501d9a3
Fix: Undo and redo correctly updates editor modified status (#244)
* Set an index for the last saved change

I added an index that represents the last saved change.

Editors are considered to be unsaved or modified if the current change
is different from the save index. In other words, if the last saved
change is `5`, undoing or redoing past that change should indicate that
the editor has been modified.

This is needed to fix two bugs in COSMIC Edit:
* https://github.com/pop-os/cosmic-edit/issues/116
* https://github.com/pop-os/cosmic-edit/issues/128

* Unit test that confirms pivot logic works

I'll most likely simplify the API as end users don't have a way to
cleanly use `Pivot::Exact` without access to the internal command
buffer.

* Simplify save point API

* Implement more save point unit tests

A unit test for an edge case currently fails but normal usage works.

* Fix edge case for empty command index and pivot

* More save point unit tests for common use cases
2024-03-25 08:55:44 -06:00
Jeremy Soller
b08676909f
Remove todos about highlight color, it is implemented 2024-03-18 08:41:42 -06:00
Mohammad AlSaleh
18c3d2acec Skip trying monospace fallbacks if default font supports all codepoints
Instead of blindly pushing default font to the start of the monospace
 fallbacks map. Actually collect codepoint support info for it, and if
 it supports all codepoints, skip collecting that info from other
 monospace fonts. If it doesn't, push it to the start of the map as
 before.

 This actually provides a big performance boost, while the sophisticated
 monospace fallback process is still done whenever needed.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-03-10 15:05:07 -06:00
Mohammad AlSaleh
729dc868c2 Only try monospace fonts that support at least one requested script
When font fallback involves monospace fonts, and if word has known
 scripts, limit the fonts tried for fallback to ones that support at
 least one requested script.

 Codepoint support info is still collected for these fonts to guide
 the fallback order selection process.

 A map of per-script monospace font-ids is pre-populated in font system
 to acquire lists of wanted font ids efficiently.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-03-10 15:05:07 -06:00
Mohammad AlSaleh
59ac0b824c Store a sorted list of monospace font ids in font system
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-03-10 15:05:07 -06:00
Mohammad AlSaleh
3e02ae1ea6 Cache codepoint support info for monospace fonts
For the simplest case of " " words, a quick binary search in
 `supported` vec will suffice, instead of using `slice::contains()`
 for all monospace fonts, where some of them may support thousands of
 codepoints.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2024-03-10 15:05:07 -06:00
Nico Burns
a53a0b3a8c Convert rich-text example to winit 2024-03-03 17:22:33 -07:00
Nico Burns
9615978557 Refactor scrollbar width handling for editor example 2024-03-03 17:22:33 -07:00
Nico Burns
43d3620e44 Convert editor example to winit
Swap color channels

Remove unused code in rich-text-winit example

Port editor example to winit

WIP

Implement scroll logic + add shape_as_needed

Handle text input using named keys

request redraw on click

cargo fmt

Implement dragging

Refactor winit event handlers to avoid duplication

Re-enable text size keyboard shortcuts

Remove unused imports

Fix updating scale factor

Fix unused variable warnings

Remove logging

Remove commented code

Delete rich-text-winit example

Rename editor-winit example to editor
2024-03-02 18:33:51 -07:00
Nico Burns
22e61965aa Enable vi feature for docs.rs build 2024-03-01 10:20:55 -07:00
Aapo Alasuutari
2766961af6 Handle inverted Ranges in add_span 2024-02-22 10:06:50 -07:00
Christopher Serr
8582173128 Fix no_std build
This fixes the `no_std` build and also makes sure it's tested properly
in the CI workflow.
2024-02-12 10:37:49 -07:00
Jeremy Soller
0cb6eba6e7
0.11.2: Fix glyph start and end when using shape-run-cache 2024-02-09 15:12:33 -07:00
Jeremy Soller
cb447ea8c6
0.11.1 2024-02-08 11:13:33 -07:00
Jeremy Soller
1eb3233373
Add shape-run-cache feature, that can significantly improve shaping performance 2024-02-08 11:12:41 -07:00