Remove temp cut buffer commands and cleanup related SourceView code
- Moved cut_to_temp_buffer and paste_temp_buffer commands to plugin - Remove temp buffer state and timeout logic from SourceView - Remove associated keybindings (Ctrl+K / Ctrl+U) - Ignore "buffer" pseudo-path when filtering loaded files - Ensure view receives focus after DnD file load
This commit is contained in:
24
plugins/code/commands/nanoesq_temp_buffer/helpers.py
Normal file
24
plugins/code/commands/nanoesq_temp_buffer/helpers.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
|
||||
from gi.repository import GLib
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
def clear_temp_cut_buffer_delayed(view: any):
|
||||
if not hasattr(view, "_cut_temp_timeout_id"): return
|
||||
if not view._cut_temp_timeout_id: return
|
||||
|
||||
GLib.source_remove(view._cut_temp_timeout_id)
|
||||
|
||||
def set_temp_cut_buffer_delayed(view: any):
|
||||
def clear_temp_buffer(view: any):
|
||||
view._cut_buffer = ""
|
||||
view._cut_temp_timeout_id = None
|
||||
return False
|
||||
|
||||
view._cut_temp_timeout_id = GLib.timeout_add(15000, clear_temp_buffer, view)
|
||||
Reference in New Issue
Block a user