Commit Graph
74 Commits
Author SHA1 Message Date
Antonio ScandurraandNathan Sobo 3cab32d201 WIP: Add keybinding to open buffers under cursors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 16:12:50 +01:00
Max Brunsfeld 94e9c7fd5b Give a full-width background to the diagnostic headers 2022-01-06 17:55:56 -08:00
Max BrunsfeldandNathan Sobo b19d92e918 Keep selections at the top of the project diagnostics view when it is first populated
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 17:01:13 -08:00
Antonio ScandurraandNathan Sobo 1875a0e349 Polish rendering of inline errors
- Don't soft-wrap
- Render multiple lines

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-06 16:17:53 +01:00
Antonio Scandurra f37f839330 Wire up refresh_anchors in Editor::refresh_selections and call it 2022-01-06 15:32:37 +01:00
Max Brunsfeld 7340e83059 WIP - MultiBuffer::refresh_anchors 2022-01-05 21:12:49 -08:00
Max BrunsfeldandNathan Sobo 5a53eeef63 Don't scroll editors away from the top of their buffer when content changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-05 12:31:00 -08:00
Antonio Scandurra 29b63ae4c6 Remove invalid excerpts as opposed to styling them differently 2022-01-05 18:21:17 +01:00
Antonio Scandurra 508b9dc024 Rip out "diagnostic providers" 2022-01-04 16:32:17 +01:00
Antonio Scandurra ed361f2d1a Position selections correctly when duplicating lines in a multi-buffer 2022-01-04 15:17:37 +01:00
Antonio Scandurra 8dc9197324 Position cursors correctly in Editor::delete_line in a multi-buffer 2022-01-04 15:17:37 +01:00
Nathan Sobo 6d6a82655a Create blocks with anchors to allow a bias to be specified
This allows us to respect the bias on anchors we use to create excerpt headers so that they always remain above any content inserted at the start of an excerpt.
2021-12-30 01:03:19 -08:00
Nathan Sobo 984378e12c Use anchors for line movement edits to support multi-buffers
Because multi-buffers can contain the same content multiple times, we need to use anchors to track our desired insertion and removal locations when moving lines. This is because deleting a line in order to move it might end up deleting *multiple* lines.
2021-12-29 23:47:03 -08:00
Max Brunsfeld 137fbd0088 Update editor element to use new {next,prev}_line_boundary methods
Since these methods take buffer points instead of display points, this adjusts
the logic for retrieving the visible selections, so that they are initially returned
in terms of buffer points.
2021-12-28 13:47:09 -08:00
Nathan Sobo 7f786ca8a6 WIP: Start moving toward a simpler interface for detecting prev/next line boundaries 2021-12-27 22:11:05 -08:00
Nathan Sobo 89bbfb8154 wip 2021-12-27 21:14:23 -08:00
Max Brunsfeld 6057d819b0 Add a unit test showing panic in move_line_down 2021-12-27 20:58:01 -08:00
Max BrunsfeldandNathan Sobo accf90e843 Add MultiBufferSnapshot::range_contains_excerpt_boundary
Use this method to disable move_line_down across excerpt boundaries.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-27 17:08:31 -08:00
Nathan Sobo cbc162acf5 WIP: Allow lines to be moved down across excerpts
This is still a bit weird because we can't remove the last line of an excerpt but we still move it into another buffer. There also seem to be issues with undo.
2021-12-27 15:46:19 -08:00
Max BrunsfeldandNathan Sobo 3040cfece1 Fix Editor::newest_selection
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-27 15:42:37 -08:00
Max BrunsfeldandNathan Sobo cbd9e186b5 Store selections with a right start bias so that autoindent moves them
Previously, cursors at column 0 had to be explicitly moved when those lines
were autoindented. This behavior was lost when we moved selections from
the buffer to the editor. Now, with the right bias, we get this behavior automatically.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-27 15:33:57 -08:00
Nathan SoboandAaron Hillegass e9a750be71 Don't merge keymap contexts from containing elements
Co-Authored-By: Aaron Hillegass <charmedliferaft@gmail.com>
2021-12-24 16:44:35 -07:00
Antonio Scandurra 393009a05c Implement Buffer::diagnostic_group 2021-12-24 12:08:55 +01:00
Antonio ScandurraandNathan Sobo 304afc1813 Only preserve excerpts for invalid diagnostics if they contain cursors
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-23 16:33:50 +01:00
Antonio Scandurra dcf26acaac Use a different invalidation strategy for project-wide diagnostics 2021-12-23 15:41:43 +01:00
Max Brunsfeld a86ba57983 Add Editor::remove_blocks 2021-12-22 17:30:14 -08:00
Antonio ScandurraandMax Brunsfeld eec1748dc7 Render excerpt headers using DisplayMap::insert_blocks
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-12-21 18:32:27 +01:00
Max BrunsfeldandNathan Sobo 466a377e1d Merge branch 'main' into share-project
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-20 11:42:59 -08:00
Nathan Sobo e4f18947de Insert a time heading when creating a journal entry 2021-12-18 10:38:54 -07:00
Antonio Scandurra 7d2b74a93b Implement MultiBuffer::{is_dirty,has_conflict} 2021-12-17 15:33:09 +01:00
Antonio Scandurra 3914d1d072 Display filename on the first excerpt's header for a group 2021-12-17 13:49:21 +01:00
Max Brunsfeld 528d64d3cc WIP - Improve project diagnostic context rendering 2021-12-16 18:34:29 -08:00
Max Brunsfeld fb492a9fb8 Correctly incorporate editor settings into diagnostic header rendering 2021-12-16 16:36:33 -08:00
Max Brunsfeld 31eeffa5a7 Autoscroll after inserting blocks 2021-12-16 14:20:01 -08:00
Max Brunsfeld f8ef605cbd Update all MultiBuffer unit tests, removing expected trailing newline 2021-12-15 17:04:57 -08:00
Nathan SoboandMax Brunsfeld 6c5b27af1d Group diagnostics by primary
Render primary message above the excerpt and supporting messages as block decorations with a `Below` disposition. This is still super rough.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 18:26:42 -07:00
Nathan SoboandMax Brunsfeld e1a2897d53 Render basic diagnostic messages in project diagnostics view
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 17:00:57 -07:00
Nathan SoboandMax Brunsfeld ad05c0cc7a Implement MultiBufferSnapshot::excerpt_headers_in_range
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-12-14 16:24:48 -07:00
Max BrunsfeldandNathan Sobo 06e241117c Fix assertions in test for selection restoration after undo/redo
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-14 13:04:51 -08:00
Max BrunsfeldandNathan Sobo e38c1814d5 Update selections on text insertion using anchors
The delta-based approach doesn't work for multi-excerpt buffers.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-14 12:15:26 -08:00
Max BrunsfeldandAntonio Scandurra bf9daf1529 Allow left-biased anchors at the beginnings of excerpts
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-12-14 09:58:28 -08:00
Antonio Scandurra 119d44caf7 Remove test-only transaction_group_interval method from MultiBuffer 2021-12-14 14:19:04 +01:00
Antonio Scandurra 163ce95171 Implement MultiBufferSnapshot::remote_selections_in_range 2021-12-14 11:34:26 +01:00
Max Brunsfeld 4efdc53d9f WIP 2021-12-13 17:44:20 -08:00
Max BrunsfeldandNathan Sobo 52b8e3d1a2 Get tests passing after diagnostic + selection changes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 11:34:56 -08:00
Antonio ScandurraandNathan Sobo 85674ba506 WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-12-13 16:46:35 +01:00
Antonio Scandurra c984b39aaa Show remote collaborators' active selections 2021-12-13 11:38:38 +01:00
Nathan Sobo cdbcbdfe6d Test undo/redo at editor layer, including selection restoration 2021-12-12 15:04:19 -07:00
Nathan Sobo 44cd0be068 Restore selections upon undo/redo of edits performed in the current editor 2021-12-12 14:12:03 -07:00
Nathan Sobo 1e7184ea07 Get selections rendering again when local selections are owned by Editor 2021-12-11 13:42:46 -07:00