Commit Graph
190 Commits
Author SHA1 Message Date
Nathan Sobo 0fdc955732 Insert a time heading when creating a journal entry 2021-12-18 10:38:54 -07:00
Max Brunsfeld f831277317 Upgrade tree-sitter to 0.20.1 2021-12-05 21:37:08 -08:00
Nathan SoboandMax Brunsfeld 8e3630df62 Fix alignment of blocks adjacent to other blocks
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-01 17:58:44 -07:00
Nathan SoboandMax Brunsfeld 26ab95eae9 Get all tests passing with new blocks API
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-01 17:52:34 -07:00
Nathan SoboandMax Brunsfeld 26a4b9cca6 Use new BlockMap API to render diagnostics
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-01 17:22:40 -07:00
Max BrunsfeldandNathan Sobo cf3093aace Start work on generalizing the BlockMap to allow arbitrary elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 15:25:55 -08:00
Antonio ScandurraandNathan Sobo 9fb5b384dc Use the new buffer subscription API to keep DisplayMap in sync
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 16:08:53 +01:00
Antonio ScandurraandNathan Sobo 137a1969bd Introduce text::Buffer::subscribe
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-01 15:55:05 +01:00
Antonio Scandurra 8bb9cb3953 Bump FoldMap's version in FoldMap::sync (and not in DisplayMap) 2021-12-01 12:05:02 +01:00
Max BrunsfeldandNathan Sobo 80a05508ba WIP - maintain foldmap with Buffer::edits_since
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-30 17:23:02 -08:00
Max Brunsfeld a0cb583fcb Use &Snapshot directly instead of impl Into<Content<'a>>
The text::Buffer and its snapshot already used the same representation
for their content, so we can just make Buffer deref to a Snapshot.
2021-11-30 13:32:11 -08:00
Nathan SoboandMax Brunsfeld 93322a4858 Name the root file of every crate after the crate to ease navigation
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:46:39 -07:00
Nathan SoboandMax Brunsfeld 811689d234 Rename buffer crate to text and name its entrypoint after the crate
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-11-30 12:26:12 -07:00
Nathan SoboandAntonio Scandurra 539698ec40 Avoid building up pending edits when soft wrapping is disabled
This was causing us to get slower over time as we stacked up hundreds of thousands of pending edits whenever soft wrap was disabled.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-11-30 08:28:29 -07:00
Max BrunsfeldandNathan Sobo ca11c68a19 Introduce weak_handle methods on ModelContext and ViewContext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 14:13:22 -08:00
Antonio Scandurra 43583e1e80 Embed a plain text grammar and override settings for that too 2021-11-29 18:01:51 +01:00
Antonio ScandurraandNathan Sobo c9e4f7a7eb Introduce a new Grammar struct and allow it to be optional
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-29 17:38:59 +01:00
Antonio Scandurra f1ef633508 Allow overriding editor settings on a per-language basis 2021-11-29 09:39:13 +01:00
Nathan Sobo 19dd12e1c6 Associate collaborator avatars with "ribbons" corresponding to their cursor color 2021-11-28 13:25:05 -07:00
Nathan Sobo ca3e7ff87f Implement cmd-k cmd-d to replace selection with next 2021-11-25 13:39:08 -07:00
Nathan Sobo ee129edc89 Improve range-based selection queries to only resolve the requested selections 2021-11-25 13:19:49 -07:00
Antonio ScandurraandNathan Sobo e66e9eac0d Return Selections from Editor::selections_in_range
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-25 16:45:06 +01:00
Antonio ScandurraandNathan Sobo 8d6a2c0b33 Autoscroll vertically to the newest selection on SelectNext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-25 16:02:39 +01:00
Antonio ScandurraandNathan Sobo 5dca1085a8 Implement SelectNext
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-25 15:44:06 +01:00
Nathan Sobo 13c4cc06f6 Restore scroll position and selections when cancelling go-to-line
But preserve the line when confirming.
2021-11-24 15:43:48 -07:00
Nathan Sobo 7e0245f2fc Highlight the selected line when typing in the go to line dialog 2021-11-24 15:23:45 -07:00
Antonio Scandurra 70d58a658d Allow centering selections when requesting autoscroll
We use this new capability in the "go to line" modal.
2021-11-24 19:50:47 +01:00
Antonio Scandurra ee817d5518 WIP: Start on go to line 2021-11-24 18:45:36 +01:00
Antonio ScandurraandNathan Sobo 69531cd8bf Invert dependency between editor and workspace
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-24 17:07:16 +01:00
Antonio Scandurra a11408997a Introduce "entry openers" but still register editors in workspace 2021-11-24 15:18:15 +01:00
Antonio Scandurra e2ae3ca9cf Skip over block lines when building columnar selections 2021-11-24 10:40:06 +01:00
Antonio Scandurra 00cfdaf5f3 Reverse columnar selections when head moves before tail's column 2021-11-24 10:37:35 +01:00
Antonio Scandurra cd92190b62 Calculate an overshoot when mousing to build columnar selections 2021-11-24 10:28:32 +01:00
Nathan Sobo 87fcf9b9bc WIP 2021-11-24 09:18:41 +01:00
Nathan Sobo 5dec861a22 Merge pull request #244 from zed-industries/mouse-selections
Improve support for selecting text via the mouse
2021-11-23 18:11:04 -07:00
Max Brunsfeld 3ff3de4493 Add outdent command, fix indent bugs 2021-11-23 16:44:05 -08:00
Nathan Sobo 6a7f39051a Remove newest selection when adding a selection with a click count > 1
This prevents selections added in earlier clicks from being rendered under the pending selection.
2021-11-23 16:30:33 -07:00
Nathan Sobo cc9baaab67 Use alt modifier instead of cmd to add selections 2021-11-23 16:23:30 -07:00
Nathan Sobo 5b660c2da7 Simplify handling of shift-click to extend selections 2021-11-23 16:03:21 -07:00
Nathan Sobo 010e0116e4 Implement shift-click to extend the newest selection 2021-11-23 15:42:21 -07:00
Max Brunsfeld 468004c958 Implement toggle-comments 2021-11-23 14:13:28 -08:00
Antonio Scandurra 1c364d393e Simulate line-wise selection when clicking on the gutter 2021-11-23 19:14:39 +01:00
Antonio Scandurra 34aa97fcd7 Implement line-wise selection 2021-11-23 19:10:15 +01:00
Antonio ScandurraandNathan Sobo 3dd485e48e Implement word-wise mouse selection
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-11-23 18:50:17 +01:00
Antonio Scandurra 1ce80a3c9e WIP: Start integrating SelectMode and movement::surrounding_word 2021-11-23 17:04:58 +01:00
Antonio Scandurra 7abc3325c7 Add a new movement::surrounding_word function 2021-11-23 17:04:37 +01:00
Antonio Scandurra 27c1f29654 Retry flaky test_soft_wraps 5 times before giving up
We have other tests that rely on loading fonts that intermittently
fail on CI and for which we used the same mitigation.
2021-11-23 11:25:04 +01:00
Max Brunsfeld ff0a922449 Merge pull request #233 from zed-industries/fix-split-selection-into-lines
Place the cursor at end of first line when splitting selections into lines
2021-11-22 16:25:19 -08:00
Max Brunsfeld 51b7715981 Adjust assertion in test for split_selection_into_lines 2021-11-22 16:19:24 -08:00
Nathan Sobo ddd1eefce0 Place the cursor at end of first line when splitting selections into lines 2021-11-22 15:53:37 -07:00