mirror of
https://github.com/wakatime/sublime-wakatime.git
synced 2023-08-10 21:13:02 +03:00
sometimes selection object can have no elements but eval truthy
This commit is contained in:
parent
74583a6845
commit
5299efd6fa
@ -422,7 +422,7 @@ def append_heartbeat(entity, timestamp, is_write, view, project, folders):
|
|||||||
'lines_in_file': view.rowcol(view.size())[0] + 1,
|
'lines_in_file': view.rowcol(view.size())[0] + 1,
|
||||||
}
|
}
|
||||||
selections = view.sel()
|
selections = view.sel()
|
||||||
if selections:
|
if selections and len(selections) > 0:
|
||||||
rowcol = view.rowcol(selections[0].begin())
|
rowcol = view.rowcol(selections[0].begin())
|
||||||
row, col = rowcol[0] + 1, rowcol[1] + 1
|
row, col = rowcol[0] + 1, rowcol[1] + 1
|
||||||
heartbeat['lineno'] = row
|
heartbeat['lineno'] = row
|
||||||
|
Loading…
Reference in New Issue
Block a user