mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Properly cancel visual select mode on OS window close request
This commit is contained in:
@@ -916,7 +916,7 @@ class Boss:
|
|||||||
window.send_cmd_response(response)
|
window.send_cmd_response(response)
|
||||||
|
|
||||||
def mark_os_window_for_close(self, os_window_id: int, request_type: int = IMPERATIVE_CLOSE_REQUESTED) -> None:
|
def mark_os_window_for_close(self, os_window_id: int, request_type: int = IMPERATIVE_CLOSE_REQUESTED) -> None:
|
||||||
if self.current_visual_select is not None and self.current_visual_select.os_window_id == os_window_id and request_type == IMPERATIVE_CLOSE_REQUESTED:
|
if self.current_visual_select is not None and self.current_visual_select.os_window_id == os_window_id:
|
||||||
self.cancel_current_visual_select()
|
self.cancel_current_visual_select()
|
||||||
mark_os_window_for_close(os_window_id, request_type)
|
mark_os_window_for_close(os_window_id, request_type)
|
||||||
|
|
||||||
@@ -1504,6 +1504,7 @@ class Boss:
|
|||||||
if self.current_visual_select:
|
if self.current_visual_select:
|
||||||
self.current_visual_select.cancel()
|
self.current_visual_select.cancel()
|
||||||
self.current_visual_select = None
|
self.current_visual_select = None
|
||||||
|
self.mappings.pop_keyboard_mode_if_is('__visual_select__')
|
||||||
|
|
||||||
def visual_window_select_action(
|
def visual_window_select_action(
|
||||||
self, tab: Tab,
|
self, tab: Tab,
|
||||||
@@ -1827,6 +1828,8 @@ class Boss:
|
|||||||
if tm is None:
|
if tm is None:
|
||||||
self.mark_os_window_for_close(os_window_id)
|
self.mark_os_window_for_close(os_window_id)
|
||||||
return
|
return
|
||||||
|
if self.current_visual_select is not None and self.current_visual_select.os_window_id == os_window_id:
|
||||||
|
self.cancel_current_visual_select()
|
||||||
active_window = tm.active_window
|
active_window = tm.active_window
|
||||||
windows = []
|
windows = []
|
||||||
for tab in tm:
|
for tab in tm:
|
||||||
|
|||||||
Reference in New Issue
Block a user