Re: Substitute text



On Thu, 2016-08-18 at 22:37 +0200, Stefan Salewski wrote:
Do you have an idea how I best can substitute text?


Well, it seems to be really easy. I have used 

  buffer.createSourceMark(NullStr, "Stef", iter)

to set marks with category "Stef" at desired positions, and then

  buffer.getStartIter(iter)
  while buffer.forwardIterToSourceMark(iter, "Stef") or iter.isStart:
    endIter = iter
    discard endIter.forwardChars(fix.len.cint)
    buffer.delete(iter, endIter)
    buffer.insert(iter, "NewText", -1)

Seems to be not very fast due to permanently updating the display. Is
there a way to suppress view update?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]