Mishkat al-Masabih

Jabir said the Prophet (ﷺ) decreed the right to buy neighbouring property applicable to everything which is not divided, but when boundaries were fixed and separate roads made there was no option. Bukhari transmitted it.

عَنْ جَابِرٍ قَالَ: قَضَى النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ بِالشُّفْعَةِ فِي كُلِّ مَا لَمْ يُقْسَمْ فَإِذَا وَقَعَتِ الْحُدُودُ وَصُرِفَتِ الطُّرُقُ فَلَا شُفْعَة. رَوَاهُ البُخَارِيّ