190908
使いながら気になるところから改善
アウトラインを書き直したいけど面倒でのびのびになってる
実用し出すととりあえず今でも動いてる部分は直すのが億劫になるものだなあ・・・
190909
190910
gPadでマクロを書いていた機能
シンチラなので普通に実装出来る
import re
def calcline(self):
self.SendScintilla(2314) # SCI_LINEEND = 2314
line , index = self.getCursorPosition()
result = re.findall(r'\d{1,}', self.text( line) )
p= sum( [ int(l) for l in result ] )
p='| ' + str( p ) # 挿入文字列
self.insertAt ( p , line , index )
今注釈行にしてるのを解除してみた
変わりなさそう
ここらへんはまだ理解が不十分だな
sciのキーバインドを忘れてるのでヘルプを作って既定フォルダに置いた、これでいいな
VScodeで便利だった機能を追加したほかsci独自のモノもある
昔調べたのを思いだした、自作ものはこういう部分が自由で良いな
① if token[0] in list[ , , ] :
これの意味が何となくだけどわかるようでわからなかった
② if hoge in hogetta :
これは真だが、前の文字列が後ろの中に含まれているか
①も理屈は同じか??
文字列じゃ無くてリストベースなんだな
まあ文字列もリストだし、結局同じって事か??
https://qscintilla.com/superfast-syntax-highlighting/
ここに書いてあった、やっぱりカスタムは遅い
早くするためにはCythonを使うみたい
アウトライン解析も早くなるかな
190911
def searchline( self ) :
self.ui.treeWidget.clear()
search= self.ui.lineEdit.text()
line , index = self.currentSci.getCursorPosition()
treeID1 =QTreeWidgetItem([ '< 検索時のポジション >' , str(line) ])
self.ui.treeWidget.addTopLevelItem(treeID1)
counter = 0
for i in range( self.currentSci.lines() ) :
if search in self.currentSci.text( i ) :
string= '[ ' + str(i+1) + ' 行]' + self.currentSci.text( i )[ : 10]
treeID1 =QTreeWidgetItem([ string , str(i) ])
self.ui.treeWidget.addTopLevelItem(treeID1)
counter += 1
if counter >50 :
counter=-1
break
def calcline2 ( self ) :
line , index = self.getCursorPosition()
p = re.compile( r'\d+' )
n,sum = 0,0
while( 1 ):
res = p.search( self.text( line + n)[index : ] )
if res :
sum += int( res[0] )
n += 1
else :
break
self.insertAt ( str(sum) , line +n+1 , index )
---> scieditor2