summaryrefslogtreecommitdiff
path: root/src/filebuffer.java
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@simplelittledream.com>2022-01-13 18:39:09 -0500
committerJacob McDonnell <jacob@simplelittledream.com>2022-01-13 18:39:09 -0500
commit9927436cc355eb09675bcd6dd026a984c6ba9309 (patch)
tree16321703329c3741b24946e6046443f1c721080f /src/filebuffer.java
parentf8961a182cb023d941e6a241ee70e316aa8b2617 (diff)
Added previous, next, and last line commands
Diffstat (limited to 'src/filebuffer.java')
-rw-r--r--src/filebuffer.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/filebuffer.java b/src/filebuffer.java
index 7ee27c2..ff6b225 100644
--- a/src/filebuffer.java
+++ b/src/filebuffer.java
@@ -19,7 +19,6 @@ public class filebuffer {
readFile();
}
}
-
/* getFileSize: gets the size of the buffer arraylist */
public int getFileSize() {
return buffer.size();
@@ -33,6 +32,12 @@ public class filebuffer {
/* changeCurrentLine: changes the current line value */
public void changeCurrentLine(int n) {
currentLine = n;
+ printLine(currentLine);
+ }
+
+ /* printLine: prints the line */
+ private void printLine(int n) {
+ System.out.printf("%d %s\n", n + 1, getLine(n));
}
/* getLine: returns the selected line as a string */