Commit Graph
39175 Commits
Author SHA1 Message Date
Antonio ScandurraandNathan Sobo ab2a09f071 Get wrapping randomized test passing with wrap width as small as 0
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-23 15:58:05 +02:00
Antonio ScandurraandNathan Sobo 1b4357919c Expand tabs correctly in TabMap's highlighted chunks iterator
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-23 15:08:59 +02:00
Antonio Scandurra e93eed360f Don't poll foreground futures during DeterministicExecutor::block_on 2021-07-23 12:06:58 +02:00
Antonio Scandurra 6e49f2a02e Fix wrap map randomized tests 2021-07-23 11:26:53 +02:00
Max Brunsfeld 908cead699 Get randomized test compiling against new WrapMap structure
It doesn't pass.
2021-07-22 20:45:14 -07:00
Max Brunsfeld c3c94b023f Move LineWrapper test to line_wrapper.rs 2021-07-22 20:42:18 -07:00
Max BrunsfeldandNathan Sobo ebc986a0e2 Start restructuring WrapMap with simpler concurrency
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-22 16:21:42 -07:00
Antonio Scandurra 30b31de8f5 WIP 2021-07-22 18:31:01 +02:00
Antonio Scandurra 9d400b96c6 Fix panic in WrapMap::highlighted_chunks_for_rows
Also, add a unit test for `DisplayMap` with syntax highlighting when
soft wrap is on.
2021-07-22 10:08:29 +02:00
Max Brunsfeld e7c1d015a3 Start work on wrapping lines without text shaping 2021-07-21 17:50:37 -07:00
Nathan Sobo e6f90775e1 Ensure that soft wrapped lines don't cause horizontal scrolling 2021-07-21 12:27:01 -06:00
Nathan Sobo 3decbcd368 Remove logging 2021-07-21 11:21:13 -06:00
Antonio ScandurraandNathan Sobo 4381aa205b Fix WrapMap::clip_point at the end of a soft-wrapped line
If that's the case and `Bias` is `Left` we clip to the last
character of the soft-wrapped line.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-21 18:32:32 +02:00
Antonio ScandurraandNathan Sobo fe015848d8 Ensure that we use the WrapMap where appropriate in DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-21 18:04:58 +02:00
Antonio ScandurraandNathan Sobo f7edc950d3 Account for the impact of edits on tab expansion
Tab characters are expanded differently based on the column on which
they appear, which edits can affect. Thus, `TabMap::sync` will now
expand edits to the first tab that appears on the line in which the edit
occurred.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-21 17:18:15 +02:00
Antonio Scandurra 9fcbea3180 Add randomized test for DisplayMap::buffer_rows and fix logic errors 2021-07-21 14:45:25 +02:00
Max BrunsfeldandNathan Sobo 8e1e6bc3be Start rendering highlighted text and line numbers via the wrap map
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 18:03:02 -07:00
Nathan Sobo eb3f539b60 WIP 2021-07-20 17:22:03 -06:00
Max Brunsfeld 6cb84ca3e8 wip 2021-07-20 15:30:50 -07:00
Max Brunsfeld c4d825cf33 Get simple unit test passing for soft-wrap in DisplayMap 2021-07-20 15:22:11 -07:00
Max BrunsfeldandNathan Sobo 1aea691494 Add WrapMap as a member of DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 13:03:59 -07:00
Max BrunsfeldandNathan Sobo 2705e3bd1a Fix assertions in fold map test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 11:43:10 -07:00
Max BrunsfeldandNathan Sobo e8d2dda42f Avoid holding executor's state lock while parked
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 11:37:02 -07:00
Nathan SoboandMax Brunsfeld 31d248318a Replace DeterministicExecutor::reset with forbid_parking
There's really no point calling reset if we plan on parking afterwards.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-20 12:28:04 -06:00
Nathan Sobo e438010a18 Allow DeterministicExecutor to park until forbid_parking is called
This allows us to perform async setup such as talking to the database.
2021-07-20 12:22:02 -06:00
25a96a16ba WIP: interpolate edits into snapshot coming from BackgroundWrapper
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-20 19:21:52 +02:00
7efff39465 Add DeterministicExecutor::block_on(duration, future)
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-20 19:20:50 +02:00
Antonio Scandurra b94ba6efd5 Implement Snapshot::interpolate 2021-07-20 14:25:56 +02:00
Antonio Scandurra 56b79edcd4 Ensure that WrapMap's input lines match TabMap's output lines 2021-07-20 11:30:00 +02:00
Antonio Scandurra b10aa10bc0 Coalesce contiguous isomorphic transforms 2021-07-20 11:27:12 +02:00
Antonio Scandurra e77309f8e3 Remove stray logging statements 2021-07-20 11:10:02 +02:00
Antonio Scandurra a20d4ed00a Make randomized tests pass with one operation 2021-07-20 11:06:17 +02:00
Nathan SoboandMax Brunsfeld 540eac9f0e Iterate on randomized wrapping test and fix some bugs
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-19 19:31:03 -06:00
Nathan SoboandMax Brunsfeld 45a03fd5e7 Get the randomized soft wrap test passing with no edits
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-19 18:37:29 -06:00
Nathan SoboandMax Brunsfeld f00d418057 Honor the last line when wrapping even if it doesn't end in \n
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-19 18:29:20 -06:00
Max BrunsfeldandNathan Sobo 277b64a5f0 Start work on WrapMap::chunks_at
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 16:23:56 -07:00
Max Brunsfeld 5067ba9f70 Fix typo in Point::add_assign 2021-07-19 13:28:35 -07:00
Nathan Sobo 2cc93834d8 WIP 2021-07-19 13:59:07 -06:00
Antonio ScandurraandNathan Sobo 71789dd861 WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 19:34:41 +02:00
Antonio ScandurraandNathan Sobo 426a7ca30d Re-enable wrap_map module and fix compile errors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 18:40:57 +02:00
Antonio ScandurraandNathan Sobo bdfbc2fdb7 Extract tab expansion logic into TabMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 17:29:03 +02:00
Antonio ScandurraandNathan Sobo 5d60e364af Clarify input and output coordinates in display_map
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 16:18:20 +02:00
Antonio Scandurra c9a3dd0d18 WIP 2021-07-19 15:45:49 +02:00
Antonio Scandurra 7e3a9dca2a Add fold_map::Snapshot::text_summary_for_range 2021-07-19 12:25:27 +02:00
Antonio Scandurra f1b23774c9 Change fold_map::Edit to return DisplayOffsets
This is needed so that we can translate display offsets into display
points in the `WrapMap`.
2021-07-19 11:34:47 +02:00
Antonio Scandurra 092a625ce6 Fix errors in WrapMap randomized tests 2021-07-19 10:48:13 +02:00
Max Brunsfeld 51320e815c Implement FontSystem::wrap_line 2021-07-16 17:14:43 -07:00
Antonio Scandurra 53311059e1 WIP 2021-07-16 18:43:50 +02:00
Antonio ScandurraandNathan Sobo 34cda642ae Start on adding a randomized test for BackgroundWrapper
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-16 17:53:23 +02:00
Antonio Scandurra 2541d95051 Work on a randomized test for edits/snapshots returned by FoldMap
...and make it pass too!
2021-07-16 15:48:43 +02:00