Commit Graph
598 Commits
Author SHA1 Message Date
Max BrunsfeldandAntonio Scandurra <antonio@zed.dev 1b0e93b153 Change interpretation of marked_text and edit when handling input
Co-authored-by: Antonio Scandurra <antonio@zed.dev
2022-07-20 09:53:49 -07:00
Antonio Scandurra 42ac4bf9fc WIP 2022-07-20 18:06:29 +02:00
Antonio Scandurra 2ea0b89e7c WIP 2022-07-20 15:07:09 +02:00
Keith Simmons c2868a39e8 Merge pull request #1388 from zed-industries/mouse-region-refactor
Mouse Region Refactor
2022-07-19 16:50:12 -07:00
Antonio Scandurra 7757fbe241 Implement NSTextInputClient protocol on window using no-ops 2022-07-19 14:52:02 +02:00
Antonio Scandurra 456a390166 Add character palette menu item 2022-07-19 14:51:57 +02:00
Max BrunsfeldandNathan Sobo 7998771d9f Avoid panic when unable to access a GPU
This will remove noise from our panic logs.

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2022-07-18 14:13:12 -07:00
K Simmons 8add81350e Rework presenter and MouseRegion to use Handler hashmap rather than individual fields 2022-07-17 23:19:32 -07:00
Antonio Scandurra 8e2e5b5cf0 Don't borrow window state mutably until we need to invoke resize callback 2022-07-13 10:38:34 +02:00
Antonio Scandurra c53fa4941a Ensure no borrows are held when activating window or creating prompts 2022-07-13 10:37:55 +02:00
Antonio Scandurra d4e0f73ffe Drop window borrow before calling makeKeyAndOrderFront
We're seeing some stack traces where calling `makeKeyAndOrderFront`
could invoke `setFrameSize`, which is causing a double borrow.
2022-07-13 10:19:46 +02:00
Keith Simmonsand 8d34fe7e94 Refactor terminal connection into a model which can be copied between terminal views
Refactor terminal modal code to use TerminalConnection model handle so we aren't storing TerminalViews in the globals
Adjust INSTANCE_BUFFER_SIZE in renderer to handle pathological terminal renders

Co-authored-by: mikayla.c.maki@gmail.com
2022-07-08 16:10:09 -07:00
Keith Simmons c139f1e6b6 combine branches of events in from_native 2022-07-06 16:59:58 -07:00
Keith Simmons bcb553f233 Combine platform mouse events to use common MouseEvent struct and remove MouseDragged event in favor of MouseMoved 2022-07-06 16:37:56 -07:00
Keith Simmons 686e57373b pull event data out into individual Event structs 2022-07-06 15:36:42 -07:00
Antonio Scandurra d43e8b270a Add unit test for ViewContext::observe_window_activation 2022-07-05 17:51:01 +02:00
Max Brunsfeld 6f49f4a9cf Recalculate Metal layer's drawable size when window's scale factor changes 2022-07-04 15:14:08 -07:00
Antonio Scandurra 9a6092dd1b Support hitting enter on numpad 2022-07-04 10:01:56 +02:00
Keith Simmons 92ab107fc9 working jump to definition with tests 2022-06-24 15:09:31 -07:00
Keith Simmons 848445455d Working underline based on symbol origin 2022-06-24 15:05:35 -07:00
Antonio Scandurra 2dae0ddcdb Add test to verify closing window via the mouse 2022-06-23 14:18:53 +02:00
Antonio Scandurra 06033d7fa9 Introduce ViewContext::on_window_should_close
This is a new callback that can be used to interrupt closing the window
when the user has unsaved changes.
2022-06-23 11:43:19 +02:00
Antonio Scandurra ca8ddcdeec Set window's edited = true when there are unsaved changes 2022-06-23 10:59:50 +02:00
Antonio Scandurra a35d7c5e15 Use BOOL instead of Rust booleans in handle_key_equivalent 2022-06-17 17:19:18 +02:00
Antonio Scandurra 8f6d081de8 Override performKeyEquivalent to handle key events
This lets us bypass the application menu and invoke the event handler
in Zed first. If that doesn't handle the event, the application menu
item corresponding to the shortcut will be actioned. Prior to this
commit the opposite would happen, which would dramatically limit the
throughput at which we could handle events.
2022-06-17 17:12:56 +02:00
Antonio Scandurra 607903eed5 Return true in the Window::on_event callback if event was handled 2022-06-17 17:09:16 +02:00
Max Brunsfeld a3b17ffd15 Allow creating application menus with submenus 2022-06-16 17:47:39 -07:00
Antonio Scandurra 22dd68fbfb Add keystroke for menu item only when action is equal to binding
This fixes a bug where we would show `cmd-e` instead of `cmd-f` for
`Edit -> Find` because both bindings would have the `buffer_search::Deploy`
action and we were mistakenly selecting the former.
2022-06-06 09:26:33 +02:00
Antonio Scandurra 20e1044d49 Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Max Brunsfeld 04bd57b2c7 Add an API for setting a window's title
This controls how the window appears in the Window menu.
2022-05-27 10:45:55 -07:00
Nathan Sobo b110fd5fb7 Render a context menu when right-clicking in project panel
It doesn't currently do anything, but I managed to get it rendering in an absolutely positioned way.
2022-05-26 09:59:25 +02:00
Max Brunsfeld fbd589b589 Start work on handling multibuffers properly when closing unsaved buffers 2022-05-22 16:48:33 -07:00
Max Brunsfeld b72d97ce78 Disable menu item key equivalents while there are pending keystrokes 2022-05-20 10:04:43 -07:00
Max Brunsfeld 21862faa58 Convert function keys to the correct macOS codes for menu items 2022-05-19 17:37:46 -07:00
Max Brunsfeld ea85473f4f Enable and disable application menu items based on the active view 2022-05-19 16:50:40 -07:00
Max Brunsfeld 7445197f4d Derive application menu key equivalents from the keymap 2022-05-19 10:04:01 -07:00
Max Brunsfeld 8445eaab85 Fix crash when emptying atlases
Previously, when an atlas was emptied, we would move it into a different
vector: free_atlases. This removal could cause existing atlas ids to
refer to the wrong atlases.
2022-05-05 17:52:47 -07:00
Antonio Scandurra 61346f734d WIP 2022-05-05 15:15:58 +02:00
Antonio Scandurra 7ec5c04fdf Correctly alpha-blend border and background in quad SDF 2022-04-28 13:54:18 +02:00
Max Brunsfeld e8d263274c Remove duplication between windowDid{Become,Resign}Key callbacks 2022-04-22 15:06:50 -07:00
Max Brunsfeld 6b9e93ac6d Fix double-borrow crash by calling window activated callback asynchronously 2022-04-22 15:01:19 -07:00
Max Brunsfeld 7f64076f8d Focus/blur views when application windows become active/inactive 2022-04-22 14:18:50 -07:00
Nathan SoboandAntonio Scandurra 92f040df00 Apply cursor styles during paint
This makes the editor's cursor an IBeam and properly deals with nested cursor styles.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-04-22 10:54:18 -06:00
Antonio Scandurra fb87bacc7e Merge branch 'main' into auto-update 2022-04-21 09:53:06 +02:00
Antonio ScandurraandNathan Sobo a210b05d00 Remove App::on_open_files, as it's a subset of on_open_urls
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:36:27 +02:00
Max Brunsfeld fbd1afc51f Add a command for installing the CLI 2022-04-20 17:27:33 +02:00
Nathan SoboandMax Brunsfeld 75f0326e54 Use ipc_channel crate to communicate between cli and app
We still aren't handling CLI requests in the app, but this lays the foundation for bi-directional communication.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-04-20 17:15:46 +02:00
Antonio ScandurraandNathan Sobo 01eb2dce24 WIP: Start on a new cli crate
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-20 17:15:45 +02:00
Keith Simmons 4b55b578b2 Don't panic when allocating tiny_skia pixmap 2022-04-13 14:57:16 -07:00
Antonio ScandurraandNathan Sobo 8e89074714 Reduce allocations when caching fonts
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-04-13 19:06:34 +02:00