andriyko / sublime-robot-framework-assistant

Robot Framework plugin for Sublime Text3
MIT License
109 stars 43 forks source link

Column selection is broken for Mac users because jump_to_keyword mouse map conflicts with mouse/key combination #141

Closed mikekokuba closed 8 years ago

mikekokuba commented 8 years ago

After installing Robot Framework Assistant v4.0.0 the Sublime Text 3.0 (build 3114 on OS X 10.11.4) column selection feature is broken. Uninstall Robot Framework Assistant and column selection works again.

aaltat commented 8 years ago

Can't reproduce the problem with these details. Could you enable the robot_framework_log_commands and send the console output when you use column selection.

aaltat commented 8 years ago

Did you get the problem solved or is this still a problem? If it's a problem could you provide the details asked in the previous post.

mikekokuba commented 8 years ago

Sorry for the delay. It's still not working. To clarify column selection is broken for all file types, not just file types handled by robot framework assistant. When I uninstall robot framework assistant column selection works again.

When I option click for column selection in a non-robot file type there is no console output. When I option click for column selection in a .robot file over white space there is no console output. When I option click for column selection in a .robot file over a keyword the console output is:

Indexing done with rc: 0
Updating current view is done for file: /path/to/the/robot/file/file.robot 
Indexing done with rc: 0
Updating current view is done for file: /path/to/the/robot/file/file.robot 
aaltat commented 8 years ago

Could you explain what you do, click menus, press keyword shortcuts or something else, when you do this: click for column selection

mikekokuba commented 8 years ago

Following the directions here, Left Mouse Button + Option

aaltat commented 8 years ago

Sorry for long delay in answer. I did perform the steps described in the documentation but I am not able reproduce the problem. I do don't own a mac, but in my Windows and Linux environments the column selection works perfectly.

I did notice that the robot_framework_log_commands was not actually telling what steps user must perform to enabled the logging and therefore your copy/paste from the console did not contain the required details. I did update the robot_framework_log_commands documentation, so could you retry with the problem.

When enabled correctly you should something like this in the console:

command: drag_select {"by": "columns", "event": {"button": 2, "x": 463.5, "y": 523.5}}
command: drag_select {"event": {"button": 1, "x": 631.5, "y": 923.5}}
command: drag_select {"event": {"button": 1, "x": 610.5, "y": 922.5}}
aaltat commented 8 years ago

Would you have an update?

mikekokuba commented 8 years ago

I'll retest later today.

mikekokuba commented 8 years ago
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 574, in run_
    return self.run(edit)
  File "/Users/mikekokuba/Library/Application Support/Sublime Text 3/Packages/Robot Framework Assistant/commands/index_open_tab.py", line 34, in run
    sublime.set_timeout_async(add_builtin_vars(db_dir))
  File "/Users/mikekokuba/Library/Application Support/Sublime Text 3/Packages/Robot Framework Assistant/commands/scan_and_index.py", line 36, in add_builtin_vars
    f_table = open(table_path, 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/Users/mikekokuba/Library/Application Support/Sublime Text 3/Packages/Robot Framework Assistant/database/scanner/BuiltIn-ca8f2e8d70641ce17b9b304086c19657.json'
command: drag_select {"event": {"button": 1, "x": 107.53125, "y": 86.4140625}}
command: jump_to_keyword {"event": {"button": 1, "x": 195.5859375, "y": 172.3828125}}

I'm getting the Traceback and FileNotFoundError every time I bring focus back to the editor portion of Sublime Text. Some situations I found:

aaltat commented 8 years ago

It is a different error. The error caused that the plugin internal database does not contain table for the BuiltIn library. By the current implementation, plugin tries to refresh the keyword and variable index on those situations, but because it can not find the table for the BuiltIn library it displays that error.

Why the table is not in the internal database is a more difficult question, because the error could be caused by several reasons.

mikekokuba commented 8 years ago

Should we disregard the Traceback and FileNotFoundError and just focus on the messages when I tried to do column select by holding option then select and drag or do you think it's related? What I see:

command: drag_select {"event": {"button": 1, "x": 107.53125, "y": 86.4140625}}
command: jump_to_keyword {"event": {"button": 1, "x": 195.5859375, "y": 172.3828125}}

I'm not seeing the line you're seeing:

command: drag_select {"by": "columns", "event": {"button": 2, "x": 463.5, "y": 523.5}}

I'm getting the extra jump_to_keyword command.

aaltat commented 8 years ago

My command is somewhat different because it was done with Windows But in Mac there is only one mouse button, right? In that case I think I have a hunch about the problem. It is because of the default mouse map for Mac. It has bind the mouse 1 and option to a jump to keyword command. To try that out, could you create a user mouse map, for Mac, where jump to keyword is bind to some other key/mouse combination.

If that solves the problem, I must change the combination because it overlaps with default Sublime combination. Any good suggestions?

mikekokuba commented 8 years ago

I changed the mouse map for jump_to_keyword to

{
  "button": "button1", "count": 1, "modifiers": ["shift"],
  "press_command": "drag_select",
  "command": "jump_to_keyword"
}

and column selection works again when I option + click and drag, I see this in the console

command: drag_select {"by": "columns", "event": {"button": 1, "x": 251.54296875, "y": 329.41796875}}

When I do the shift + click (the new mouse map for jump_to_keyword) I see this in the console.

command: jump_to_keyword {"event": {"button": 1, "x": 297.2421875, "y": 145.828125}}

Shift + click stomps on other functionality (probably should't be the new default) but is helpful in this investigation. Command + click and control + click are also used for other shortcuts and probably shouldn't be stomped on. Maybe alt + shift + click? I'm not confident that doesn't stomp on something but in my quick tests and research it does't look like it.

aaltat commented 8 years ago

Thank you from input, I will try to come up with some sort of solution for a next major release. For now you can user specific settings.

aaltat commented 8 years ago

Closed by 028e87a289ceb1459ab566dedd4135b9a363a2a7