Commit Graph
241 Commits
Author SHA1 Message Date
Nathan Sobo 8136d8a8a6 Fix formatting 2023-04-06 15:54:44 -06:00
Nathan Sobo de9bf6dfbd Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
Antonio Scandurra 6e821eea4b Prevent tab from accepting a copilot suggestion when it isn't visible 2023-04-05 10:31:11 +02:00
Antonio Scandurra ec5309b543 Make autocompletion and copilot mutually exclusive 2023-04-03 14:15:21 +02:00
Mikayla Maki 81411b9114 Merge branch 'main' into copilot 2023-03-30 16:57:18 -07:00
Antonio Scandurra af4c4c7cf0 Speed up tab searching in TabMap::sync by looking for \t only
Instead of looking for `\n` as a stopping condition, we cap the range
we pass to `SuggestionSnapshot::chunks` to stop on the next line. This
makes character searching faster, because looking for a single character
uses `memchr`. Also, this avoids an extra conditional in a tight loop such
as the chunk scanning one contained in `TabMap::sync`.
2023-03-30 10:03:13 +02:00
Antonio Scandurra 79346b0706 Use + instead of | to break out of tab expansion in TabMap::sync 2023-03-30 09:49:07 +02:00
Mikayla Maki ae3b3ea458 Merge branch 'main' into copilot 2023-03-29 16:57:38 -07:00
Max Brunsfeld 0c07a373a8 🎨 2023-03-29 14:43:01 -07:00
Antonio Scandurra 49447128a9 Make edits smaller when tab expansion changes on a line 2023-03-29 21:40:37 +02:00
Antonio Scandurra b86f8188d1 Expand edit to end of the line when old/new row exceeds max expansion 2023-03-29 16:49:21 +02:00
Antonio Scandurra 719d0f0abf Rename skip_leading_tab to inside_leading_tab 2023-03-29 14:53:28 +02:00
Antonio Scandurra 813f722925 Increment input_column correctly when inside the leading tab 2023-03-29 14:52:50 +02:00
Max Brunsfeld 5c1f82ae3d Don't use TabMap::expand_tabs in line_indent_for_buffer_row 2023-03-28 17:37:57 -07:00
Max Brunsfeld 08e93e9321 Only expand tabs up until a limited column 2023-03-28 16:40:04 -07:00
Max Brunsfeld c23feeab3a 🎨 Make expand_tabs and collapse_tabs instance methods on TabSnapshot 2023-03-28 14:10:43 -07:00
Antonio Scandurra 6715e5247c Rework SuggestionMap to take highlight style when retrieving chunks 2023-03-28 09:42:01 -07:00
Antonio Scandurra f7cba4cec4 Make Suggestion fields public 2023-03-21 16:51:33 +01:00
Antonio Scandurra 9c8732a355 Integrate SuggestionMap into the rest of DisplayMap 2023-03-21 16:39:02 +01:00
Antonio Scandurra d1978a719b Add a version field to SuggestionSnapshot 2023-03-21 12:47:04 +01:00
Antonio Scandurra 3d165f705f Extract a SuggestionMap::randomly_mutate method 2023-03-21 11:51:06 +01:00
Antonio Scandurra 35830a0271 Implement SuggestionSnapshot::to_{fold,suggestion}_point 2023-03-21 11:39:29 +01:00
Antonio Scandurra d448a5cb5c Implement SuggestionSnapshot::to_point 2023-03-21 11:28:36 +01:00
Antonio Scandurra f829ce5641 Implement SuggestionSnapshot::to_offset 2023-03-21 11:28:33 +01:00
Antonio Scandurra c0e124a55a Implement SuggestionSnapshot::text_summary_for_range 2023-03-21 11:28:30 +01:00
Antonio Scandurra 52a156aebe Implement SuggestionSnapshot::clip_point 2023-03-21 11:28:27 +01:00
Antonio Scandurra ccb6196224 Implement SuggestionSnapshot::buffer_rows 2023-03-21 11:28:23 +01:00
Antonio Scandurra 1a9dbfa86a Add unit test to verify basic properties of the SuggestionMap 2023-03-21 08:29:33 +01:00
Antonio ScandurraandMax Brunsfeld 3edf83cb99 Implement SuggestionSnapshot::line_len
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-03-20 19:45:39 +01:00
Antonio ScandurraandMax Brunsfeld f44549eb29 Enhance randomized test to verify SuggestionMap::{chunks,sync}
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-03-20 19:29:22 +01:00
Antonio Scandurra 4d6726ef39 WIP: Flesh out more of the suggestions randomized test 2023-03-20 18:06:24 +01:00
Antonio Scandurra 9970e5f60c Start on randomized test and add SuggestionMapSnapshot::chunks 2023-03-20 15:56:15 +01:00
Antonio Scandurra fb48854e5a Simplify signature of SuggestionMap::replace 2023-03-20 14:00:14 +01:00
Antonio Scandurra 83051f1e86 Add SuggestionMap::replace 2023-03-20 13:50:14 +01:00
Antonio Scandurra 94a9e28e35 Start on SuggestionMap 2023-03-20 13:22:14 +01:00
Mikayla Maki 5356ec4730 Merge pull request #2287 from zed-industries/fix-fold-range-finding
Fix code folds with wraps
2023-03-17 17:18:56 -07:00
Mikayla MakiandMax eba119b914 Fix fold tests with new representation
Switch UI code from using display rows to using buffer rows
Make folds only show up on lines with line layouts

co-authored-by: Max <max@zed.dev>
2023-03-17 16:00:22 -07:00
Antonio Scandurra 4d915f4530 Don't make fonts::Features Copy 2023-03-17 13:54:56 +01:00
Antonio Scandurra b2c733baab WIP: Allow specifying font features in the editor
This just lays the foundation for threading through a `fonts::Features`
struct, but it's not used yet.
2023-03-17 09:51:36 +01:00
Mikayla Makiandmax 75bea91245 Convert code folding to be in terms of buffer points instead of display points
Co-authored-by: max <max@zed.dev>
2023-03-14 16:48:03 -07:00
Mikayla MakiandMax 606d683f29 Add interactable fold markers
Change fold handlers to be driven by the fold map
Switch to a mouse region based implementation for click regions

Co-authored-by: Max <max@zed.dev>
2023-03-03 12:26:36 -08:00
Mikayla Maki 6cf62a5b02 Update tests to use new fold indicator 2023-02-28 17:17:29 -08:00
Mikayla Maki c397fd9a71 Added click regions and cursor styles 2023-02-28 16:34:28 -08:00
Max Brunsfeld f71145bb32 Add a layer of indirection between excerpt ids and locators 2022-11-28 14:18:49 -08:00
Julia 2149c17a0a Merge pull request #1768 from zed-industries/git-gutter-meets-code-folding
Git gutter meets code folding (and word wrap fixes)
2022-10-17 14:51:47 -04:00
Julia 9c47325c25 Use correct range to get diff hunks in the presence of wrapped lines 2022-10-13 13:52:44 -04:00
Max Brunsfeld 6cdf4e98fc Re-export basic text types from text and language crates
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Mikayla Maki 0beb97547e Finished refactoring out fs and rope 2022-10-11 15:25:54 -07:00
Julia b18dd8fcff Fully qualify outside git-related code when a diff is a git diff 2022-09-29 13:16:02 -04:00
JuliaandMax Brunsfeld 883d5b7a08 Update git gutter status after debounced delay
Co-authored-by: Max Brunsfeld <max@zed.com>
2022-09-29 13:16:02 -04:00