Append a line after the given line (1-indexed).

 To maintain backwards compatibility with +vim+, the cursor is forced back
 to its previous position after inserting the line.

 @param index [Integer]
 @param str [String]
 @return [String]
424890
def append(index, str)
      check_index(index)
      window = @session.request(:nvim_get_current_win)
      cursor = window.cursor

      set_lines(index, index, true, [*str.split($/)])
      window.set_cursor(cursor)
      str
    end
693964
public void appendLine(final Line line)
    {
        if (this.lineTail == null)
        {
            this.lines = this.lineTail = line;
        }
        else
        {
            this.lineTail.nextEmpty = line.isEmpty;
            line.prevEmpty = this.lineTail.isEmpty;
            line.previous = this.lineTail;
            this.lineTail.next = line;
            this.lineTail = line;
        }
    }
1006987
def append_index(self, num_rows):
        
        width = len(str(num_rows - 1))

        def f(datum):
            return str(datum.idx).ljust(width)
        header = ' '*width

        self.append(header, f)
942752
function( text, index, character ) {
			if(text && text.length > index){
			   return text.substr(0, index) + character + text.substr(index+character.length);
			}else{
				return text;
			}
		}
443600
function (str, index) {
            var res = false;
            for (var i = index - 1; i >= 0; i--) {
                if (str.charAt(i) == "\\") {
                    res = !res;
                } else {
                    return res;
                }
            }
            return res;
        }
827263
public static void appendAsString(
        final StringBuilder sb, final DirectBuffer buffer, final int index, final Encoding encoding)
    {
        switch (encoding.primitiveType())
        {
            case CHAR:
                sb.append('\'').append((char)buffer.getByte(index)).append('\'');
                break;

            case INT8:
                sb.append(buffer.getByte(index));
                break;

            case INT16:
                sb.append(buffer.getShort(index, encoding.byteOrder()));
                break;

            case INT32:
                sb.append(buffer.getInt(index, encoding.byteOrder()));
                break;

            case INT64:
                sb.append(buffer.getLong(index, encoding.byteOrder()));
                break;

            case UINT8:
                sb.append((short)(buffer.getByte(index) & 0xFF));
                break;

            case UINT16:
                sb.append(buffer.getShort(index, encoding.byteOrder()) & 0xFFFF);
                break;

            case UINT32:
                sb.append(buffer.getInt(index, encoding.byteOrder()) & 0xFFFF_FFFFL);
                break;

            case UINT64:
                sb.append(buffer.getLong(index, encoding.byteOrder()));
                break;

            case FLOAT:
                sb.append(buffer.getFloat(index, encoding.byteOrder()));
                break;

            case DOUBLE:
                sb.append(buffer.getDouble(index, encoding.byteOrder()));
                break;
        }
    }
754039
def add_line(self, string):
        
        self.code_strings.append(string)
        code = ''
        if len(self.code_strings) == 1:
            code = '(setv result ' + self.code_strings[0] + ')'
        if len(self.code_strings) > 1:
            code = '(setv result (and ' + ' '.join(self.code_strings) + '))'
        self._compiled_ast_and_expr = self.__compile_code(code_string=code)
88462
public StrBuilder insert(int index, Object obj) {
		if (obj instanceof CharSequence) {
			return insert(index, (CharSequence) obj);
		}
		return insert(index, Convert.toStr(obj));
	}
661108
public static String[] appendStrArray(String[] arr, String str) {
		String[] newArr = new String[arr.length + 1];
		System.arraycopy(arr, 0, newArr, 0, arr.length);
		newArr[arr.length] = str;
		return newArr;
	}
1163749
def insert_lines(self, count=None):
        
        count = count or 1
        top, bottom = self.margins or Margins(0, self.lines - 1)

        # If cursor is outside scrolling margins it -- do nothin'.
        if top <= self.cursor.y <= bottom:
            self.dirty.update(range(self.cursor.y, self.lines))
            for y in range(bottom, self.cursor.y - 1, -1):
                if y + count <= bottom and y in self.buffer:
                    self.buffer[y + count] = self.buffer[y]
                self.buffer.pop(y, None)

            self.carriage_return()
282143
def join_next_line(self, separator=' '):
        
        if not self.document.on_last_line:
            self.cursor_position += self.document.get_end_of_line_position()
            self.delete()

            # Remove spaces.
            self.text = (self.document.text_before_cursor + separator +
                         self.document.text_after_cursor.lstrip(' '))
664453
def translate_index_to_position(self, index):
        
        # Find start of this line.
        row, row_index = self._find_line_start_index(index)
        col = index - row_index

        return row, col
616906
def add_str(window, line_num, str):
    
    try:
        window.addstr(line_num, 0, str)
    except curses.error:
        pass
572428
def lines
      @value.inject(0) do |s, e|
        next s + e.count("\n") if e.is_a?(String)
        next s
      end
    end
1084485
public void append(String str, int off, int len) {
	int restLength = buffer.length - pos;
	if (len < restLength) {
	    str.getChars(off, off + len, buffer, pos);
	    pos += len;
	}
	else {
	    str.getChars(off, off + restLength, buffer, pos);
	    curr.next = new Entity(buffer);
	    curr = curr.next;
	    length += buffer.length;
	    buffer = new char[(buffer.length > len - restLength) ? buffer.length : len - restLength];

	    str.getChars(off + restLength, off + len, buffer, 0);
	    pos = len - restLength;

	}
    }
38660
def append_text_column(self, text: str, index: int):
        
        width = self.columns[index]["width"]
        return f"{text:<{width}}"
805363
function nextLine() {
            var at;
            line += 1;
            if (line >= lines.length) {
                return false;
            }
            character = 0;
            s = lines[line];
            at = s.search(cx);
            if (at >= 0) {
                warningAt("Unsafe character.", line, at);
            }
            return true;
        }