@Skif-off
Thank you for continuing to work on these tools.
The two new scripts you provided work great.
The only one I had a question on was TOOL 4
`TOOL 1`
`ADD LINES BELOW CURSOR - Cursor at Top`
done
`TOOL 2`
`ADD LINES BELOW CURSOR - Cursor at Bottom`
done
`TOOL 3`
`ADD LINES TO BOTTOM OF DOCUMENT - Cursor at Top`
done
`TOOL 4`
`ADD LINES TO BOTTOM OF DOCUMENT - Cursor at Bottom`
Do you mean that this one cannot be achieved?
I had mentioned I tried combining your TOOL 2 with older version of TOOL 3 and
it kind of works. The first time I tested this the document I used for the
test had blank lines at the end. I just tested it again on a document that did
have text in the last lines and realized that it actually appears that it is
more like adding new blank lines in the line number right before the end,
because that last line (with or without text in it) actually ends up at the
bottom of the document.
Again when last line is already blank it gives illusion that it is almost
working.
Here is that code
```
local function GetEmptyLines(sLE, iLE)
local sR = ""
for i = 1, iLE do sR = sR .. sLE end
return sR
end
local aEOL = {"\r\n", "\r", "\n"}
local iEOL = geany.scintilla("SCI_GETEOLMODE")
local sAdd = GetEmptyLines(aEOL[iEOL + 1], 10)
local iLines = geany.height()
local iCurPos = geany.caret()
local iL, iC = geany.rowcol(iCurPos)
iCurPos = geany.rowcol(iLines + 1, 0)
geany.caret(iCurPos)
geany.selection(sAdd)
```
Probably some issues in it, I just added some random lines to the bottom to see
what would happen :)
I was wondering, to achieve TOOL 4, would it be possible to add a line to the
latest version you just provided for TOOL 3, where after the new blank lines
are added, then a new instruction to just move the caret to the bottom line of
the document? Only thing I can think of.
Thank you again for your help with this.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/discussions/4091#discussioncomment-11661304
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/repo-discussions/4091/comments/[email protected]>