sometimes selection object can have no elements but eval truthy

This commit is contained in:
Alan Hamlett 2022-08-23 15:13:44 +02:00
parent 74583a6845
commit 5299efd6fa
1 changed files with 1 additions and 1 deletions

View File

@ -422,7 +422,7 @@ def append_heartbeat(entity, timestamp, is_write, view, project, folders):
'lines_in_file': view.rowcol(view.size())[0] + 1,
}
selections = view.sel()
if selections:
if selections and len(selections) > 0:
rowcol = view.rowcol(selections[0].begin())
row, col = rowcol[0] + 1, rowcol[1] + 1
heartbeat['lineno'] = row