Skip to content

Commit e0b77bc

Browse files
committed
position (row,column) of the cursor in statusbar - improved
1 parent 0069bc1 commit e0b77bc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/ct/ct_column_edit.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,13 @@ void CtColumnEdit::focus_in()
519519
void CtColumnEdit::selection_update()
520520
{
521521
const Gdk::Point cursorPlace = _get_cursor_place();
522-
if (_newCursorRowColCallback) {
523-
_newCursorRowColCallback(cursorPlace.get_y()+1, cursorPlace.get_x());
524-
}
525-
else {
526-
spdlog::debug("{} {},{}", __FUNCTION__, cursorPlace.get_y()+1, cursorPlace.get_x());
522+
if (_textView.has_focus()) {
523+
if (_newCursorRowColCallback) {
524+
_newCursorRowColCallback(cursorPlace.get_y()+1, cursorPlace.get_x());
525+
}
526+
else {
527+
spdlog::debug("{} {},{}", __FUNCTION__, cursorPlace.get_y()+1, cursorPlace.get_x());
528+
}
527529
}
528530
Glib::RefPtr<Gtk::TextBuffer> rTextBuffer = _textView.get_buffer();
529531
if (not rTextBuffer->get_has_selection()) {

0 commit comments

Comments
 (0)