MCPcopy Create free account
hub / github.com/Genivia/ugrep / insert

Method insert

src/query.cpp:778–802  ·  view source on GitHub ↗

insert text to line at cursor

Source from the content-addressed store, hash-verified

776
777// insert text to line at cursor
778void Query::insert(const char *text, size_t size)
779{
780 char *end = line_end();
781 if (end + size >= line_ + sizeof(Line))
782 {
783 size = line_ + sizeof(Line) - end - 1;
784 Screen::alert();
785 }
786 if (size > 0)
787 {
788 char *ptr = line_ptr(col_);
789 memmove(ptr + size, ptr, end - ptr + 1);
790 memcpy(ptr, text, size);
791 int oldlen = len_;
792 len_ = line_len();
793 int forward = len_ - oldlen;
794 if (forward > 0)
795 {
796 updated_ = true;
797 error_ = -1;
798 col_ += forward;
799 draw();
800 }
801 }
802}
803
804// insert one character (or a byte of a multi-byte sequence) in the line at the cursor
805void Query::insert(int ch)

Callers 15

unicode_classFunction · 0.45
convert_unicode_rangesFunction · 0.45
convert_anycase_rangesFunction · 0.45
insert_escape_classFunction · 0.45
insert_escapeFunction · 0.45
insert_posix_classFunction · 0.45
insert_listFunction · 0.45
parse4Method · 0.45
compile_transitionMethod · 0.45
analyze_dfaMethod · 0.45
gen_minMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected