Skip to content

Commit 6a02638

Browse files
committed
Fixed minor bug.
1 parent 1bfe0e9 commit 6a02638

File tree

6 files changed

+23
-4
lines changed

6 files changed

+23
-4
lines changed

.idea/Editor.iml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

model/Autocompleter.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def keyPressEvent(self, event):
7676
text = self.textCursor().block().text()
7777
if text.strip() == "for":
7878
self.insertPlainText("( i = 0; i < length; i += 1 )")
79-
self.finish_braces_for_block("{")
79+
self.finish_braces_for_block("{", after_for=True)
8080
else:
8181
self.insertPlainText(" ")
8282
return
@@ -181,7 +181,7 @@ def keyPressEvent(self, event):
181181
+ self.completer.popup().verticalScrollBar().sizeHint().width())
182182
self.completer.complete(cr) # popup
183183

184-
def finish_braces_for_block(self, start=""):
184+
def finish_braces_for_block(self, start="", after_for=False):
185185
spaces = ""
186186
count = 1/4
187187
if self.textCursor().block().text().startswith(" "):
@@ -193,6 +193,9 @@ def finish_braces_for_block(self, start=""):
193193
move = 1
194194
if count == 1/4:
195195
move = 0
196+
if after_for:
197+
self.insertPlainText("}")
198+
move +=1
196199
cursor.movePosition(cursor.Left, cursor.MoveAnchor, count * 4 + move)
197200
self.setTextCursor(cursor)
198201
return

viewer/local_data.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
4+
int neka_funkcija(){
5+
return 1;
6+
}
7+
8+
int main(){
9+
int a;
10+
a = neka_funkcija();
11+
printf("%d\n", a);
12+
a = 8;
13+
a = 7;
14+
return 0;
15+
}

viewer/main.py

100755100644
File mode changed.

viewer/temp.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/home/ivanmrs/Desktop/Projekat_brick|/home/ivanmrs/Desktop/Projekat_brick/Sources/nesto.c

0 commit comments

Comments
 (0)