sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
807 stars 39 forks source link

`"use_find_clipboard": false` setting not working #6371

Closed frou closed 2 months ago

frou commented 5 months ago

Description of the bug

Using the "use_find_clipboard": false Preference to tell ST not to participate in the global shared clipboard for Find/Search terms isn't working.

(I'm using a macOS 12 (Monterey) machine at the moment because my up-to-date Mac is out of action, it's possible that this bug is only happening on macOS 12?)

Steps to reproduce

  1. Start ST in Safe Mode
  2. Edit Preferences and set "use_find_clipboard": false
  3. In another app, e.g. Safari, search on a page for something using ⌘F
  4. Back in ST, bring up the Find-in-Files panel. The "Find" field will be populated with that same search term.

Expected behavior

No sharing when the setting is disabled.

Sublime Text build number

4169

Operating system & version

macOS 12.7.4

BenjaminSchaaf commented 5 months ago

I can't reproduce this on macOS 12.7.4. Do you see any errors in the console (View > Show Console)?

frou commented 5 months ago

@BenjaminSchaaf That's strange. Nope, nothing in the console. I just tried the dev build (4175) and can still reproduce it with the 4 steps above.

BenjaminSchaaf commented 5 months ago

Could you paste the output of entering view.settings().to_dict() into the console?

frou commented 5 months ago
{'adaptive_dividers': False, 'allow_git_home_dir': False, 'always_prompt_for_file_reload': False, 'always_show_minimap_viewport': False, 'animation_enabled': True, 'auto_close_tags': True, 'auto_complete': True, 'auto_complete_commit_on_tab': False, 'auto_complete_cycle': False, 'auto_complete_delay': 50, 'auto_complete_include_snippets': True, 'auto_complete_include_snippets_when_typing': True, 'auto_complete_preserve_order': 'some', 'auto_complete_selector': 'meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc', 'auto_complete_size_limit': 4194304, 'auto_complete_trailing_spaces': True, 'auto_complete_trailing_symbols': False, 'auto_complete_triggers': [{'characters': '<', 'selector': 'text.html, text.xml'}, {'rhs_empty': True, 'selector': 'punctuation.accessor'}], 'auto_complete_use_history': False, 'auto_complete_use_index': True, 'auto_complete_with_fields': False, 'auto_find_in_selection': False, 'auto_hide_menu': False, 'auto_hide_status_bar': False, 'auto_hide_tabs': False, 'auto_indent': True, 'auto_match_enabled': True, 'binary_file_patterns': ['*.jpg', '*.jpeg', '*.png', '*.gif', '*.ttf', '*.tga', '*.dds', '*.ico', '*.eot', '*.pdf', '*.swf', '*.jar', '*.zip'], 'block_caret': False, 'bold_folder_labels': False, 'caret_extra_bottom': 4, 'caret_extra_top': 4, 'caret_extra_width': 1, 'caret_style': 'solid', 'close_deleted_files': True, 'close_find_after_find_all': True, 'close_find_after_replace_all': True, 'close_windows_when_empty': True, 'color_scheme': 'Mariana.sublime-color-scheme', 'console_max_history_lines': 3000, 'control_character_style': 'hex', 'copy_with_empty_selection': True, 'create_window_at_startup': True, 'dark_color_scheme': 'Mariana.sublime-color-scheme', 'dark_theme': 'Default Dark.sublime-theme', 'default_encoding': 'UTF-8', 'default_line_ending': 'system', 'detect_indentation': False, 'dictionary': 'Packages/Language - English/en_US.dic', 'drag_text': True, 'draw_centered': False, 'draw_indent_guides': True, 'draw_minimap_border': False, 'draw_unicode_bidi': True, 'draw_unicode_white_space': 'punctuation', 'draw_white_space': ['selection'], 'enable_hexadecimal_encoding': True, 'enable_tab_scrolling': True, 'ensure_newline_at_eof_on_save': False, 'fade_fold_buttons': True, 'fallback_encoding': 'Western (Windows 1252)', 'file_exclude_patterns': ['*.pyc', '*.pyo', '*.exe', '*.dll', '*.obj', '*.o', '*.a', '*.lib', '*.so', '*.dylib', '*.ncb', '*.sdf', '*.suo', '*.pdb', '*.idb', '.DS_Store', '.directory', 'desktop.ini', '*.class', '*.psd', '*.db', '*.sublime-workspace'], 'file_tab_style': 'rounded', 'find_highlight_matches_max_size': 16777216, 'find_in_files_context_characters': 300, 'find_in_files_context_lines': 2, 'find_in_files_max_file_size': 104857600, 'find_in_files_max_result_size': 16777216, 'find_in_files_side_by_side': False, 'find_in_files_suppress_errors': False, 'find_regex_highlight_matches_max_size': 1048576, 'find_scroll_highlights_limit': 8192, 'find_selected_text': False, 'focus_on_file_drop': False, 'fold_buttons': True, 'fold_style': 'auto', 'folder_exclude_patterns': ['.svn', '.git', '.hg', 'CVS', '.Trash', '.Trash-*'], 'font_face': 'Menlo', 'font_options': [], 'font_size': 12, 'git_diff_target': 'index', 'goto_anything_exclude_gitignore': False, 'goto_anything_file_preview': True, 'gutter': True, 'hardware_acceleration': 'opengl', 'hide_new_tab_button': False, 'hide_pointer_while_typing': True, 'hide_tab_scrolling_buttons': False, 'highlight_find_results_in_scrollbar': True, 'highlight_gutter': True, 'highlight_line': False, 'highlight_line_number': True, 'highlight_modified_tabs': False, 'hot_exit': 'always', 'hot_exit_projects': True, 'ignored_packages': ['Vintage'], 'ignored_snippets': [], 'image_file_patterns': ['*.jpeg', '*.jpg', '*.gif', '*.png', '*.ico', '*.bmp', '*.tga', '*.psd', '*.ppm', '*.pgm', '*.webp', '*.hdr'], 'inactive_sheet_dimming': True, 'indent_guide_options': ['draw_normal'], 'indent_subsequent_lines': True, 'indent_to_bracket': False, 'index_exclude_gitignore': True, 'index_exclude_patterns': ['*.log'], 'index_files': True, 'index_skip_unknown_extensions': True, 'index_workers': 0, 'light_color_scheme': 'Breakers.sublime-color-scheme', 'light_theme': 'Default.sublime-theme', 'line_numbers': False, 'line_padding_bottom': 0, 'line_padding_top': 0, 'margin': 4, 'match_brackets': True, 'match_brackets_angle': False, 'match_brackets_braces': True, 'match_brackets_content': True, 'match_brackets_square': True, 'match_selection': True, 'match_tags': True, 'mini_diff': True, 'minimap_horizontal_scrolling': False, 'move_to_limit_on_up_down': True, 'native_tabs': 'system', 'open_files_in_new_window': 'finder_only', 'open_tabs_after_current': True, 'output_tag': 1, 'overlay_scroll_bars': 'system', 'popup_shadows': True, 'preview_on_click': True, 'regex_auto_escape': True, 'relative_line_numbers': False, 'reload_file_on_change': True, 'remember_full_screen': False, 'remember_layout': False, 'remember_workspace': True, 'result_base_dir': '', 'result_file_regex': '^([^ \t].*):$', 'result_line_regex': '^ +([0-9]+):', 'reveal_menu': True, 'reveal_tabs_with_timeout': False, 'ruler_style': 'dotted', 'ruler_width': 1.0, 'rulers': [], 'save_on_focus_lost': False, 'scroll_context_lines': 0, 'scroll_past_end': True, 'scroll_speed': 1.0, 'select_across_groups': False, 'selection_description_column_type': 'virtual', 'shell_environment': True, 'shift_tab_unindent': False, 'show_definitions': True, 'show_encoding': False, 'show_errors_inline': True, 'show_full_path': False, 'show_git_status': True, 'show_git_status_in_status_bar': True, 'show_indentation': True, 'show_line_column': 'enabled', 'show_line_endings': False, 'show_navigation_bar': True, 'show_panel_on_build': True, 'show_project_first': False, 'show_rel_path': False, 'show_sidebar_button': True, 'show_spelling_errors': True, 'show_syntax': True, 'show_tab_close_buttons': True, 'show_tab_close_buttons_on_left': False, 'smart_indent': True, 'spell_check': False, 'spelling_selector': 'markup.raw, source string.quoted - punctuation - meta.preprocessor.include, source comment - source comment.block.preprocessor, -(source, constant, keyword, storage, support, variable, markup.underline.link, meta.tag)', 'sub_word_separators': '_', 'sublime_merge_path': '', 'syntax': 'Packages/Default/Find Results.hidden-tmLanguage', 'syntax_detection_size_limit': 16777216, 'tab_completion': True, 'tab_size': 4, 'theme': 'auto', 'theme_font_options': [], 'themed_title_bar': True, 'translate_tabs_to_spaces': False, 'tree_animation_enabled': True, 'trim_automatic_white_space': True, 'trim_only_modified_white_space': True, 'trim_trailing_white_space_on_save': 'none', 'ui_scale': 0.0, 'update_system_recent_files': True, 'use_find_clipboard': False, 'use_tab_stops': True, 'vintage_ctrl_keys': False, 'vintage_start_in_command_mode': False, 'vintage_use_clipboard': False, 'word_separators': './\\()"\'-:,.;<>~!@#$%^&*|+=[]{}`~?', 'word_wrap': 'auto', 'wrap_width': 0, 'wrap_width_style': 'constant'}
BenjaminSchaaf commented 5 months ago

Looks like the setting's there as expected. There's only one place in our codebase where we read from the find clipboard and that place checks for that setting so I don't see how the behavior you're seeing is possible. Could you provide a screen recording of it?

frou commented 5 months ago

Here's a screen recording:

https://github.com/sublimehq/sublime_text/assets/172663/ee51d647-fbe4-46d9-8684-a4c4b79132b5

frou commented 5 months ago

I was thinking if there was anything unusual about this setup, and the only thing I can think of is that this Mac uses a very old processor architecture: "Ivy Bridge" Xeon (on the off-chance there's a compilation issue).

BenjaminSchaaf commented 5 months ago

What happens if you open the find panel before searching in safari? I'm still unable to reproduce this in build 4169 and 4175.

frou commented 5 months ago

What happens if you open the find panel before searching in safari?

The field in ST is blank, but when focusing the ST window again it gets populated with the search term.


I notice the bug only happens with the Find-in-Files panel, not the Find/Replace/Incremental-Find panels.

BenjaminSchaaf commented 3 months ago

Thanks, I did not check find-in-files. We've got a fix in the works.

BenjaminSchaaf commented 2 months ago

Fixed in build 4176.