about summary refs log tree commit diff stats
path: root/src/ui/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/buffer.c')
-rw-r--r--src/ui/buffer.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/ui/buffer.c b/src/ui/buffer.c
index 88d7eb42..16919c08 100644
--- a/src/ui/buffer.c
+++ b/src/ui/buffer.c
@@ -95,52 +95,4 @@ buffer_yield_entry(ProfBuff* buffer, int entry)
     } else {
         return buffer->entry[entry % (buffer->current)];
     }
-}
-
-int
-buffer_yield(ProfBuff* buffer, int line, ProfBuffEntry** list)
-{
-    //Returns the size of the (line+1)-th last line, and list contains the line
-    //e.g. if line == 0, returns the last line
-    //bug if the wrap happens in the middle of a line
-    int current = buffer->current;
-    int imax = current;
-
-    if (buffer->wrap == 1) {
-        imax = BUFF_SIZE;
-    }
-
-    int i = 1;
-    int j = 0;
-    while (i <= imax) {
-        ProfBuffEntry e = buffer->entry[(current - i) % BUFF_SIZE];
-
-        if (j == line && (e.flags & NO_EOL) == 0) {
-            //We found our line and we are at its last entry
-            int nb_entries = 1;
-
-            while (i + nb_entries <= imax) {
-                e = buffer->entry[(current - i - nb_entries) % BUFF_SIZE];
-                if ((e.flags & NO_EOL) == 0) {
-                    break;
-                }
-                nb_entries += 1;
-            }
-
-            if ((buffer->wrap == 1) && (i + nb_entries > imax)) {
-                //The line is at the top of the buffer, we don't know if it's complete
-                return 0;
-            } else {
-                *list = &(buffer->entry[(current - i - nb_entries + 1) % BUFF_SIZE]);
-                return nb_entries;
-            }
-        }
-
-        if ((e.flags & NO_EOL) == 0) {
-            j++;
-        }
-        i++;
-    }
-
-    return 0;
 }
\ No newline at end of file