sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

ctrl+space closes completion panel if only one item is displayed

Open deathaxe opened this issue 1 year ago • 0 comments

Description of the bug

Title and the following should make it clear.

Steps to reproduce

  1. open ST in safe mode

  2. create a new view and paste

    <table>
      <thead>
        <?php bcompiler_write_header ?>
      </thead>
    </table>
    
  3. set caret behind bcompiler_write_header and hit ctrl+space -> completions popup opens

  4. hit ctrl+space again

Expected behavior

In this particular situation, nothing should happen as there is only one completion available.

ST should however query new completions and update completions if more ore found.

Actual behavior

If multiple completions are displayed, ctrl+space works as expected, doing nothing if last of multiple items is selected.

If however a single completion (bcompiler_write_header) is displayed, completion popup is closed by hitting ctrl+space and caret moves to next line.

Animation

Sublime Text build number

4175

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

It seems to be related with a change made by ST 4145. Can't find a changelog entry or related bug entry though, which gives reasons for this change in behavior. Maybe moving to next line is intentional for some reason, but it feels odd in the particular situation, described.

diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap
--- a/Default (Windows).sublime-keymap
+++ b/Default (Windows).sublime-keymap
@@ -360,6 +361,5 @@
-	{ "keys": ["ctrl+space"], "command": "move", "args": { "by": "lines", "forward": true }, "context":
+	{ "keys": ["ctrl+space"], "command": "move", "args": {"by": "lines", "forward": true}, "context":
 		[
-			{ "key": "auto_complete_visible", "operator": "equal", "operand": true }
+			{ "key": "auto_complete_primed", "operator": "equal", "operand": true },
 		]
 	},

OpenGL context information

No response

deathaxe avatar May 08 '24 07:05 deathaxe