Commit Graph
74 Commits
Author SHA1 Message Date
Max BrunsfeldandNathan Sobo 9346aa300d Start work on underlined text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-06 15:36:09 -07:00
Antonio Scandurra 94959d18c4 Load embedded fonts when initializing settings 2021-09-06 14:08:42 +02:00
Antonio Scandurra 6e71c43d29 Delete Editor::newline and just use the Insert action 2021-09-06 13:17:44 +02:00
Antonio Scandurra 2aadc97126 Simplify how we determine if enter should insert a newline or propagate 2021-09-06 13:08:19 +02:00
Antonio Scandurra ffc873252e Rename BufferView to Editor in ui_name 2021-09-06 12:51:11 +02:00
Antonio Scandurra 77d1574679 Pass how many lines the editor should expand to in auto height mode 2021-09-06 12:50:04 +02:00
Antonio Scandurra 1b8ea08377 Exclude selections from editor splits in Editor::active_selection_sets 2021-09-03 14:54:24 +02:00
Antonio Scandurra bd13584807 Clone Editor::build_style on split 2021-09-03 14:40:31 +02:00
Max Brunsfeld 522bef2e3a Add placeholder text as a feature of Editor, use it in chat panel 2021-09-02 17:36:56 -07:00
Max BrunsfeldandAntonio Scandurra 1c43121ae0 In theme, add an InputEditorSyle for styling small editors
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-09-02 11:20:30 -07:00
Max Brunsfeld 007d6f5eca Add a with_style method to Editor 2021-09-01 17:15:21 -07:00
Antonio ScandurraandNathan Sobo ef89ceae4d Take &mut self in View::render
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-30 17:51:26 +02:00
Antonio ScandurraandNathan Sobo 53dc08dfc5 Remove lock from element states
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-27 18:04:21 +02:00
Max Brunsfeld f810464983 Send chat messages based on input buffer's unwrapped text 2021-08-26 16:22:37 -07:00
3bb5610ad1 Overhaul handling of font families
* Specify font families in the theme.
* Load fonts eagerly when loading themes, instead of loading
  them lazily when rendering.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-26 15:06:00 -07:00
Nathan SoboandAntonio Scandurra e4a232acc9 Send messages on enter
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-08-24 08:15:46 -06:00
Antonio Scandurra 54b4a4bf6a Allow editor to be created in auto-height mode 2021-08-24 14:17:15 +02:00
Max BrunsfeldandNathan Sobo 6df80d94ad Allow subscription/notification to be cancelled by dropping the returned Subscription
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-23 15:54:24 -07:00
Max BrunsfeldandNathan Sobo fa0739ee2e Remove model and view specific observe/subscribe methods
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-23 15:07:50 -07:00
Max Brunsfeld 5ecedd894d Add ChannelList to AppState 2021-08-23 15:03:45 -07:00
Nathan Sobo 638b533fc7 WIP 2021-08-22 13:29:54 -06:00
Nathan Sobo 24639ec900 WIP 2021-08-22 11:58:19 -06:00
Nathan Sobo 34eb2c446f Start on custom titlebar 2021-08-05 11:48:35 -06:00
Max BrunsfeldandNathan Sobo 802f1f4e78 Get new theme structure working
* Fix precedence of extends directives
* Always group color with font properties for text theming

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-04 14:07:19 -07:00
Max BrunsfeldandNathan Sobo ef0ffbe819 Use custom color wrapper type everywhere in gpui & zed
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-03 12:48:58 -07:00
Max BrunsfeldandNathan Sobo b30d0daabf Add a theme picker
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-02 14:55:27 -07:00
Antonio Scandurra db9cfb0d2b Highlight active lines 2021-07-30 09:50:28 -07:00
Antonio Scandurra 3abed88c76 Highlight active row(s) in the gutter 2021-07-30 09:50:28 -07:00
Max Brunsfeld 372d2ccb6d Extract most colors in codebase into theme file. switch to dark 2021-07-30 09:50:28 -07:00
Nathan Sobo e7d03af942 Fix moving to previous word across a wrap boundary
I'm just going to the end of the soft-wrapped line, mirroring the behavior with hard wraps. It's maybe not perfectly technically correct but that behavior would require us to consider word boundaries outside of the current line, which doesn't seem worth the complexity.
2021-07-30 09:50:28 -07:00
Max Brunsfeld 25c472acd0 WIP - unit test for word-wise movement w/ soft wrap 2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra c779633154 Make unfolding inclusive
If the range *touches* the fold, we unfold. This was needed to fix the behavior for unfolding at the current selection position. Previously, there was some kind of translation issue that was allowing us to accidentally work the way we wanted without this.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra a6a8f4fd81 Introduce a struct for spanned_rows result
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Nathan SoboandAntonio Scandurra 029460bf7e Respect buffer row boundaries in line-oriented edit operations
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Max Brunsfeld 05f8a61bc8 Add a bias parameter when converting buffer points to fold points 2021-07-30 09:50:28 -07:00
Nathan Sobo 613192974f Don't render line numbers for soft-wrapped line segments 2021-07-30 09:50:28 -07:00
Nathan Sobo 7a5f1b5446 Preserve logical scroll position when wrap width changes 2021-07-30 09:50:28 -07:00
Antonio ScandurraandNathan Sobo 3d07be34f8 Remove unnecessary Mutex from scroll-related state in Editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-30 09:50:28 -07:00
Max BrunsfeldandNathan Sobo dd6820e714 Avoid crashes from trying to lay out too large of lines
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-26 11:28:05 -07:00
Antonio Scandurra b647e3ee71 Make WrapMap and DisplayMap models
This removes the need for a lock around in `WrapMap` and also removes
`WrapMap::notifications` because gpui already has a standard way of
notifying when a model updates.
2021-07-26 13:02:31 +02:00
Antonio Scandurra 623d574b51 Fix mistakenly moved line in beginning/end of line editor tests 2021-07-26 12:11:22 +02:00
Nathan Sobo da50576129 Fix remaining errors and warnings 2021-07-25 07:56:53 -06:00
Nathan Sobo 9edc8b9a06 WIP 2021-07-24 08:40:48 -06:00
Nathan Sobo 3bf47be51e WIP 2021-07-24 08:09:04 -06:00
Nathan Sobo f81f043058 WIP 2021-07-23 12:25:09 -06:00
Max BrunsfeldandNathan Sobo 5d22c6c4bd Start restructuring WrapMap with simpler concurrency
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-22 16:21:42 -07:00
Nathan Sobo f169f8e358 Ensure that soft wrapped lines don't cause horizontal scrolling 2021-07-21 12:27:01 -06:00
Max BrunsfeldandNathan Sobo 72fdd3fb9a 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
Max Brunsfeld 07e97e6cad wip 2021-07-20 15:30:50 -07:00
Max BrunsfeldandNathan Sobo 7832562675 Add WrapMap as a member of DisplayMap
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 13:03:59 -07:00