Commit Graph
404 Commits
Author SHA1 Message Date
Antonio Scandurra 97ce3998ec Position IME input according to where the selection is rendered 2022-07-21 17:35:40 +02:00
Antonio Scandurra 3c5d7e001e Always mark keydown events as handled to suppress beep 2022-07-21 15:53:21 +02:00
Antonio Scandurra 3d6c257551 🎨 2022-07-21 14:39:22 +02:00
Antonio Scandurra b2f2c5b055 Handle keydown event even when charactersIgnoringModifiers is empty
This allows the input system to work in the presence of dead keys.
2022-07-21 14:36:47 +02:00
Antonio Scandurra 101a0663d3 Remove input from KeyDownEvent 2022-07-21 14:29:27 +02:00
Antonio Scandurra f170582c26 Remove println statements from NSTextInputClient protocol functions 2022-07-21 13:51:31 +02:00
Antonio Scandurra a4ceae3cf2 Remove unused {cancel,finish}_composition methods 2022-07-21 13:48:56 +02:00
Antonio Scandurra 481078ae22 Restructure IME composition to not follow Chromium so closely 2022-07-21 13:41:55 +02:00
Antonio Scandurra b02681ee8a Treat NSTextInputClient ranges as UTF-16 2022-07-21 13:41:35 +02:00
Antonio Scandurra eda60effed Honor setting the selected range in addition to marking text 2022-07-21 08:57:20 +02:00
Max Brunsfeld 0b81a4dfae Call methods on the focused view during input events 2022-07-20 16:44:26 -07:00
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
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 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 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