Nathan Sobo
af99d0ef42
Attempt to assign a language when a new buffer is saved
2021-09-18 11:46:22 -07:00
Nathan Sobo
9691267dc8
Only blink local cursors
2021-09-17 16:17:47 -07:00
Nathan Sobo
42bf88b52a
Base soft wrapping on TextStyle instead of Settings
2021-09-17 15:39:19 -07:00
Nathan Sobo
68039b9d48
Remove font_family and font_size from editor::Snapshot
...
We'll rely on the style struct instead.
2021-09-16 16:46:35 -06:00
Nathan Sobo
f13a3544fc
Move editor layout code into element
...
Now that most of the layout code is based on the EditorStyle struct, I think it makes more sense to put it in the element.
2021-09-16 16:43:43 -06:00
Nathan Sobo
4f0c9a3e31
Build workspace editor TextStyle from font fields in settings
...
We'll specify values in the theme but we'll only end up using the color for these editors.
2021-09-16 14:43:19 -06:00
Nathan Sobo
a1f0693599
Specify full TextStyles in EditorStyle
2021-09-16 14:12:38 -06:00
Nathan Sobo
c21b754c4c
Make placeholder text style optional
2021-09-16 13:23:42 -06:00
Nathan Sobo
606aa148a6
Require a build_style callback to be passed to Editor on construction
...
We're going to use this to control the text style, so it really doesn't make sense to allow an editor to be constructed without it.
2021-09-16 13:20:12 -06:00
Nathan Sobo
ad9712db70
Move EditorStyle into editor module
2021-09-16 12:26:18 -06:00
Nathan Sobo
17d46cef7f
Recompute wraps when font size changes
2021-09-07 21:38:14 -06:00
Max Brunsfeld and Nathan 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 Brunsfeld and Antonio 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 Scandurra and Nathan 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 Scandurra and Nathan 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 Sobo and Antonio 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 Brunsfeld and Nathan 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 Brunsfeld and Nathan 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 Brunsfeld and Nathan 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 Brunsfeld and Nathan 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 Brunsfeld and Nathan 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 Sobo and Antonio 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 Sobo and Antonio 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 Sobo and Antonio 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 Scandurra and Nathan 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 Brunsfeld and Nathan 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