mawww/kakoune

Restore multiple-selections upon hitting `g.`

lenormf opened this issue · 1 comments

Steps

In kak -n:

% a-s A i esc space

g.

Outcome

The selection is set to the last inserted i.

Expected

Both i that were inserted on both lines are selected, in a multiple selection.

HTH.

Looks like g. is currently related to the last_modification_coord:
https://github.com/mawww/kakoune/blob/master/src/normal.cc#L312-L322

which itself relies on the last undo_group:

kakoune/src/buffer.cc

Lines 702 to 707 in a2fce67

Optional<BufferCoord> Buffer::last_modification_coord() const
{
if (m_history_id == HistoryId::First)
return {};
return current_history_node().undo_group.back().coord;
}

So it's not really tied to the concept of selections yet.