slynch8 / 10x

10x IDE/Editor
190 stars 34 forks source link

Feature: Python API - Function to replace current selected text with replacement text #2567

Open neeraj9 opened 7 months ago

neeraj9 commented 7 months ago

Python AI feature request:

It is helpful to use a function which replaces current text selection with a replacement text. This is useful for code or text transformation tools, which will do the following:

  1. get the selected text via N10X.Editor.GetSelection()
  2. Transform the text
  3. Write it back

This functionality can be implemented in existing python API, but an optimal version in C++ is possible which will also keep things simple for script writers and make 10x even more powerful.

slynch8 commented 6 months ago

For now I'd recommend writing the function in python. If it ever becomes a speed issue let me know and I'll convert it into C++.