Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1006440 // Concepts (Auto-Saving Text Editor)

JavaX fragment (include)

concept Session {}

concept Event {
  new Ref<Session> session;
}

Event > EChange {
  int startIndex, endIndex;
  S text;
}

Event > ECaret {
  int pos;
}  

static S replayEdit(EChange change, S text) {
  if (change == null) ret text;
  ret substring(text, 0, change.startIndex)
    + change.text
    + substring(text, change.endIndex);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006440
Snippet name: Concepts (Auto-Saving Text Editor)
Eternal ID of this version: #1006440/1
Text MD5: 3ed5be937de1332bb1b37c53a06644c3
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-03 16:31:41
Source code size: 360 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 533 / 992
Referenced in: [show references]