Skip to content

Commit 1da5e87

Browse files
committed
Fix bug for right clicking in non editor windows
1 parent f438167 commit 1da5e87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/php-debug.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ module.exports = PhpDebug =
193193
command: 'php-debug:addWatch'
194194
shouldDisplay: =>
195195
editor = atom.workspace.getActivePaneItem()
196+
if (!editor || !editor.getSelectedText)
197+
return false
196198
expression = editor?.getSelectedText()
197199
if !!expression then return true else return false
198200
},
@@ -202,6 +204,7 @@ module.exports = PhpDebug =
202204
shouldDisplay: =>
203205
editor = atom.workspace.getActivePaneItem()
204206
return false if !editor
207+
return false if !editor.getSelectedBufferRange
205208
range = editor.getSelectedBufferRange()
206209
path = editor.getPath()
207210
line = range.getRows()[0]+1

0 commit comments

Comments
 (0)